Jump to content

User:Fredddie/global.js

From Meta, a Wikimedia project coordination wiki

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* Admin highlighting */
;(function($){
	$.getJSON( mw.config.get('wgScriptPath')+'/index.php?action=raw&ctype=application/json&title=User:Amalthea_(bot)/userhighlighter.js/sysop.js', function(data){
		$(function(){
			function highlightadmins_inner(n,h) //node, relevant hyperlink fragment
			{
			  if (n.nodeType!=1||n.tagName.toLowerCase()!="a") return 0; // not an anchor
			  if (n.href.indexOf(mw.config.get('wgScript')+"?title="+h) == -1 &&
			      n.href.indexOf(mw.config.get('wgArticlePath').split("$1")[0]+h) == -1) return 0; // to the wrong target
			  var u=n.href.split(h)[1];
			  if(data[u.split("_").join(" ")]==1)
			  {
			    n.style.backgroundColor="#FFDEAD";
			    if(n.className===null||n.className==="") n.className="amalthea_userhighlighter_sysop";
			    else n.className+=" amalthea_userhighlighter_sysop";
			  }
			  return 1;
			}
			 
			function highlightadmins(n) //node
			{
			  while(n!==null)
			  {
			    if(highlightadmins_inner(n,"User:")) n=n.nextSibling;
			    else if(highlightadmins_inner(n,"User_talk:")) n=n.nextSibling;
			    else if(highlightadmins_inner(n,"Special:Contributions:")) n=n.nextSibling;
			    else
			    {
			      if(n.firstChild!==null) highlightadmins(n.firstChild);
			      n=n.nextSibling;
			    }
			  }
			}
			
			highlightadmins(document.getElementById('bodyContent'));			
		});	
	});
}(jQuery));

mw.loader.load('//ru.wikipedia.org/w/index.php?title=MediaWiki:Gadget-markblocked.js&action=raw&ctype=text/javascript');

mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript'); // Backlink: [[User:Joeytje50/JWB.js/load.js]]

/* mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hedonil/XTools/XTools.js&action=raw&ctype=text/javascript'); */

if (mw.config.get('wgNamespaceNumber') === 6 && mw.config.get('wgIsArticle'))
    mw.loader.load( '//commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-CropTool.js&action=raw&ctype=text/javascript' );

/* Global Twinkle */
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Xiplus/TwinkleGlobal/load.js&action=raw&ctype=text/javascript');