User:Beau/global.js
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)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
// -----------------------------------------------------------------
// Navigation Popups
// -----------------------------------------------------------------
// opóźnienie w sekundach
popupDelay = 1;
// naprawianie linków do przekierowań
popupFixRedirs = true;
// naprawianie linków do stron ujednoznaczniających
popupFixDabs = true;
// możliwość zmiany tekstu przy rewertowaniu
popupRevertSummaryPrompt = true;
simplePopups = 1;
popupAdminLinks = true;
// ---------------------------------------------------------------
// kolorowanie nicków
// ---------------------------------------------------------------
var cn$replacement = {
'לערי ריינהארט': 'Gangleri',
'76.21.25.40': '~Pcirrus',
'84.40.201.151': '~Kreskówek',
'145.97.39.143': '~hemlock',
'83.13.213.19': '~Bijansej',
'87.207.42.50': '~Police-chello',
'195.205.156.34': '~xxx'
};
// ---------------------------------------------------------------
function addCollapsiblePortlet( href, text, id, tooltip, accesskey, nextnode ) {
var portlet = 'p-cactions';
if ( jQuery( "#p-views" ).length ) {
portlet = 'p-views';
}
if ( !nextnode ) {
if ( jQuery( '#ca-view' ).length ) {
nextnode = '#ca-view';
} else if ( jQuery( '#ca-edit' ).length ) {
nextnode = '#ca-edit';
}
}
var item = mw.util.addPortletLink( portlet, href, text, id, tooltip, accesskey, nextnode );
jQuery( item ).addClass( "collapsible" );
return item;
}
/* Purge tab */
jQuery( document ).ready( function() {
var matches = document.location.href.match( /^([^?]+)(?:\?([^#]+))?/ );
if ( !matches ) {
return;
}
var query = matches[2] ? matches[2] : '';
if ( query.match( /action=[^&]/ ) ) {
query = query.replace( /action=[^&]+/, 'action=purge' );
} else {
query += '&action=purge';
}
addCollapsiblePortlet( matches[1] + query.replace( /^&?/, '?' ), "Purge", 'ca-purge', 'Purge cache', '*' );
} );
/* Logs tab */
jQuery( document ).ready( function() {
if ( !mw.config.get( 'wgArticleId' ) ) {
return;
}
var link = mw.config.get( 'wgScript' ) + '?title=Special:Log&page=' + encodeURIComponent( mw.config.get( 'wgPageName' ) );
addCollapsiblePortlet( link, "Rejestr operacji", 'ca-logs', 'Rejestr operacji' );
} );
/* Userpage tabs */
jQuery( document ).ready( function() {
if ( mw.config.get( 'wgCanonicalNamespace' ) == "User" || mw.config.get( 'wgCanonicalNamespace' ) == "User_talk" ) {
var username = mw.config.get( 'wgTitle' ).replace( /\/.*$/, '' );
var usernameEncoded = encodeURIComponent( username );
addCollapsiblePortlet( mw.config.get( 'wgScript' ) + '?title=Special:Contributions&target=' + usernameEncoded, 'Edycje', 'ca-contribs', 'Edycje' );
addCollapsiblePortlet( mw.config.get( 'wgScript' ) + '?title=Special:Prefixindex&namespace=2&prefix=' + usernameEncoded + '/', 'Podstrony', 'ca-subpages', 'Podstrony' );
}
} );
/* Schowek */
jQuery( document ).ready( function() {
mw.util.addPortletLink( 'p-personal', mw.util.getUrl( 'User:Beau/schowek' ), "Schowek", 'pt-cupboard', null, null, '#pt-mytalk' );
} );
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) == 'Recentchanges' || mw.config.get( 'wgCanonicalSpecialPageName' ) == 'Log' ) jQuery( document ).ready( function() {
addCollapsiblePortlet( mw.util.getUrl( 'Special:Log/newusers' ), 'Nowi', 'ca-log-newusers', 'Nowi użytkownicy' );
addCollapsiblePortlet( mw.util.getUrl( 'Special:Log/block' ), 'Blokady', 'ca-log-block', 'Rejestr blokad' );
addCollapsiblePortlet( mw.util.getUrl( 'Special:Ipblocklist' ), 'Zablokowani', 'ca-ipblocklist', 'Zablokowani' );
addCollapsiblePortlet( mw.util.getUrl( 'Special:Log/delete' ), 'Usunięte', 'ca-log-delete', 'Rejestr usunięć' );
addCollapsiblePortlet( mw.util.getUrl( 'Special:Log/protect' ), 'Zabezpieczone', 'ca-log-protect', 'Rejestr zabezpieczeń' );
addCollapsiblePortlet( mw.util.getUrl( 'Special:AbuseLog' ), 'Rejestr nadużyć', 'ca-abuselog', 'Rejestr nadużyć' );
} );
mw.loader.load( '//localhost/wiki/temp.js' );