Difference between revisions of "MediaWiki:Common.js"

From Hitchwiki
Jump to navigation Jump to search
m
Line 1: Line 1:
 
/* Any JavaScript here will be loaded for all users on every page load. */
 
/* Any JavaScript here will be loaded for all users on every page load. */
 +
 +
 +
/**
 +
* Zendesk Inbox contact form
 +
* https://hitchwiki.zendesk.com/inbox */
 +
*/
 +
window.zEmbed||function(e,t){var n,o,d,i,s,a=[],r=document.createElement("iframe");window.zEmbed=function(){a.push(arguments)},window.zE=window.zE||window.zEmbed,r.src="javascript:false",r.title="",r.role="presentation",(r.frameElement||r).style.cssText="display: none",d=document.getElementsByTagName("script"),d=d[d.length-1],d.parentNode.insertBefore(r,d),i=r.contentWindow,s=i.document;try{o=s}catch(e){n=document.domain,r.src='javascript:var d=document.open();d.domain="'+n+'";void(0);',o=s}o.open()._l=function(){var o=this.createElement("script");n&&(this.domain=n),o.id="js-iframe-async",o.src=e,this.t=+new Date,this.zendeskHost=t,this.zEQueue=a,this.body.appendChild(o)},o.write('<body onload="document._l();">'),o.close()}("//assets.zendesk.com/embeddable_framework/main.js","hitchwiki.zendesk.com");
 +
  
 
/* https://github.com/Hitchwiki/hitchwiki/issues/23 */
 
/* https://github.com/Hitchwiki/hitchwiki/issues/23 */
if ($('body.mw-special-Block')) {  
+
if ($('body.mw-special-Block').length) {  
  console.log('MediaWiki:Common.js in action');
 
 
   $('#mw-input-wpDisableEmail').click();
 
   $('#mw-input-wpDisableEmail').click();
 
   $('#mw-input-wpHardBlock').click();
 
   $('#mw-input-wpHardBlock').click();
 
   $('#mw-input-wpExpiry')[0].value = 'infinite';
 
   $('#mw-input-wpExpiry')[0].value = 'infinite';
/*  $('#mw-input-wpReason')[0].value = "Spamming links to external sites"; */
 
 
}
 
}

Revision as of 16:29, 17 November 2016

/* Any JavaScript here will be loaded for all users on every page load. */


/**
 * Zendesk Inbox contact form
 * https://hitchwiki.zendesk.com/inbox */
 */
window.zEmbed||function(e,t){var n,o,d,i,s,a=[],r=document.createElement("iframe");window.zEmbed=function(){a.push(arguments)},window.zE=window.zE||window.zEmbed,r.src="javascript:false",r.title="",r.role="presentation",(r.frameElement||r).style.cssText="display: none",d=document.getElementsByTagName("script"),d=d[d.length-1],d.parentNode.insertBefore(r,d),i=r.contentWindow,s=i.document;try{o=s}catch(e){n=document.domain,r.src='javascript:var d=document.open();d.domain="'+n+'";void(0);',o=s}o.open()._l=function(){var o=this.createElement("script");n&&(this.domain=n),o.id="js-iframe-async",o.src=e,this.t=+new Date,this.zendeskHost=t,this.zEQueue=a,this.body.appendChild(o)},o.write('<body onload="document._l();">'),o.close()}("//assets.zendesk.com/embeddable_framework/main.js","hitchwiki.zendesk.com");


/* https://github.com/Hitchwiki/hitchwiki/issues/23 */
if ($('body.mw-special-Block').length) { 
  $('#mw-input-wpDisableEmail').click();
  $('#mw-input-wpHardBlock').click();
  $('#mw-input-wpExpiry')[0].value = 'infinite';
}