User:Tribe of Tiger/common.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
The accompanying .css page for this skin is at User:Tribe of Tiger/common.css. |
mw.loader.load( '//www.mediawiki.org/w/index.php?title=MediaWiki:Gadget-UTCLiveClock.js&action=raw&ctype=text/javascript' );
// [[User:Amalthea/userhighlighter.js]]
// Based on [[User:Ais523/adminrights.js]], inner logic taken straight from there.
// Consider using [[User:Theopolisme/Scripts/adminhighlighter.js]] instead, a better version of this script
//
// This script highlights bluelinks to admins' userpages or talkpages in bodyContent (that is, everything but the tabs, personal
// links at the top of the screen and sidebar) by giving them a cyan background.
//
// If you want a colour other than cyan, add something like
// .amalthea_userhighlighter_sysop {background-color: red !important}
// to your common.css file.
;(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=decodeURIComponent(n.href).split(h)[1];
if(data[u.split("_").join(" ")]==1)
{
n.style.backgroundColor="#00FFFF";
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));
if ( mw.config.values.wgCanonicalSpecialPageName === 'Whatlinkshere' ) {
$( function() {
'use strict';
var ul = $( '#mw-whatlinkshere-list' );
ul.before( '<button id="whatlinksheresort">Sort</button>' );
$( '#whatlinksheresort' ).click( function() {
var li = ul.children( 'li' );
li.detach().sort( function( a, b ) {
return $( a ).find( 'a' ).first().text().localeCompare( $( b ).find( 'a' ).first().text() );
} );
ul.append( li );
} );
} );
}
importScript( 'User:Equazcion/ScriptInstaller.js' ); // Backlink: [[User:Equazcion/ScriptInstaller.js]]
importScript('User:Writ Keeper/Scripts/previewAndDiff.js'); //Linkback: [[User:Writ Keeper/Scripts/previewAndDiff.js]] Added by Script installer
importScript('User:Salix alba/Citoid.js'); //Linkback: [[User:Salix alba/Citoid.js]] Added by Script installer
importScript('User:GoldenRing/generate-diffs.js'); //Linkback: [[User:GoldenRing/generate-diffs.js]] Added by Script installer
importScript('User:Writ Keeper/Scripts/commonHistory.js'); //Linkback: [[User:Writ Keeper/Scripts/commonHistory.js]] Added by Script installer
importScript('User:Enterprisey/reply-link.js'); //Linkback: [[User:Enterprisey/reply-link.js]] Added by Script installer
importScript('User:SD0001/DYK-helper.js'); // Backlink: [[User:SD0001/DYK-helper.js]]