User:HueSatLum/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:HueSatLum/common.css. |
$( '#n-recentchanges' ).appendTo( '#p-navigation .body ul' );
importScript( 'User:HueSatLum/pendingChangesLink.js' ); // [[User:HueSatLum/pendingChangesLink.js]]
importScript( 'User:HueSatLum/pageInfo.js' ); // [[User:HueSatLum/pageInfo.js]]
importScript( 'User:HueSatLum/highlightMyEdits.js' ); // [[User:HueSatLum/highlightMyEdits.js]]
importScript( 'User:Shubinator/DYKcheck.js' ); // [[User:Shubinator/DYKcheck.js]]
importScript( 'User:Ais523/topcontrib.js' ); // [[User:Ais523/topcontrib.js]]
importScript( 'User:GregU/dashes.js' ); // [[User:GregU/dashes.js]]
importScript( 'User:PleaseStand/userinfo.js' ); // [[User:PleaseStand/userinfo.js]]
importScript( 'User:Js/urldecoder.js' ); // [[User:Js/urldecoder.js]]
importScript( 'User:Equazcion/SkipFileWizard.js' ); // [[User:Equazcion/SkipFileWizard.js]]
importScript( 'User:Ucucha/HarvErrors.js' ); // [[User:Ucucha/HarvErrors.js]]
importScript('User:Gary/nominations viewer.js'); // [[Wikipedia:Nominations Viewer]]
// importStylesheet( 'User:Rezonansowy/FloatHead.css' ); // [ [User:Rezonansowy/FloatHead.css]]
/**
* Guard against accidental rollbacks and logouts
*/
$( '.mw-rollback-link a, #pt-logout' ).click( function () {
return confirm( 'Are you sure you want to do that?' );
} );
/**
* Add a link to a user's subpages
*/
var username = mw.config.get( 'wgRelevantUserName' ),
namespace = mw.config.get( 'wgNamespaceNumber' ) === 3 ? 3 : 2;
if ( username ) {
mw.loader.using( 'mediawiki.util', function () {
mw.util.addPortletLink(
'p-tb', // Toolbox ID
mw.util.getUrl( 'Special:PrefixIndex', {
prefix: username + '/',
namespace: namespace,
stripprefix: 1
} ),
'Subpages',
't-subpages',
'A list of this user\'s subpages',
null, // accesskey
'#t-log' // put it before the log link
);
} );
}
/**
* Ability to toggle interlanguage links
*/
var numLanguages = $( '#p-lang .interlanguage-link' ).length;
if ( numLanguages > 1 && mw.config.get( 'skin' ) !== 'cologneblue' ) {
$( '#p-lang ul' ).hide();
var showText = '[Show ' + numLanguages + ' languages]';
$( '<a>' )
.attr( 'href', '#' )
.css( 'font-size', 12 )
.text( showText )
.appendTo( '#p-lang > div' )
.click( function ( evt ) {
evt.preventDefault();
var $showhide = $( this );
$( '#p-lang ul' ).css( 'display', function( _ind, curVal ) {
if ( curVal === 'none' ) {
$showhide.text( '[Hide languages]' );
return 'block';
}
else {
$showhide.text( showText );
return 'none';
}
} );
} );
}
/**
* Use Mediawiki UI for some buttons
*/
mw.loader.using( 'mediawiki.ui.button', function () {
var progressiveButtons = [
'#mw-fr-submit-accept',
'.mw-history-compareselectedversions-button'
];
var destructiveButtons = [
'#mw-fr-submit-reject',
'#mw-fr-submit-unaccept'
];
$( progressiveButtons.join() ).addClass( 'mw-ui-button mw-ui-progressive' );
$( destructiveButtons.join() ).addClass( 'mw-ui-button mw-ui-destructive' );
} );
/**
* Make clicking "Mark all pages as visited"
* on the watchlist much quicker
$( '#mw-watchlist-resetbutton' ).submit( function ( evt ) {
evt.preventDefault();
var submitBtn = $( '#mw-watchlist-resetbutton input[type="submit"]' ).prop( 'disabled', true );
new mw.Api().post( {
action: 'setnotificationtimestamp',
entirewatchlist: '',
token: mw.user.tokens.get( 'csrfToken' )
} ).done( function () {
submitBtn.removeProp( 'disabled' );
$( '.mw-changeslist-line-watched' )
.removeClass( 'mw-changeslist-line-watched' )
.addClass( 'mw-changeslist-line-not-watched' );
} );
} );
*/