User:Pirr-fduser/global.js

/** * Scripts which should be loaded always */ ajaxPages = [   // AjaxRC "Specjalna:Aktywność_na_wiki", "Specjalna:Ostatnie_zmiany", "Specjalna:Rejestr", "Specjalna:Nowe_pliki", "Specjalna:Nowe_strony" ]; AjaxRCRefreshText = 'Auto-odświeżanie'; AjaxRCRefreshHoverText = 'Automatycznie aktualizuje tę stronę';

window.lastEdited = {   // LastEdited avatar: true, size: true, diff: true, comment: true, lang: 'pl', time: true, position: { element: document.getElementById('WikiaMainContent'), method: 'append' } };

PurgeButtonText = 'Odśwież';   // PurgeButton

var qtUserPageTemplate = '';  // QuickCreateUserPage var qtEnableUserPageOverwrite = true;

window.monoBookText = "Monobook";  // SkinSwitchButton window.oasisText = "Oasis"; window.mobileText = "Mobile";

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AjaxRC/code.js',                       // AjaxRC        'u:dev:MediaWiki:FindAndReplace/code.js',               // FindAndReplace        'u:dev:MediaWiki:LastEdited/code.js',                   // LastEdited        'u:dev:MediaWiki:NavButtonsDropdown.js',                // NavButtonsDropdown        'u:dev:MediaWiki:NullEditButton/code.js',               // NullEditButton        'u:dev:MediaWiki:PortableCSSPad/code.js',               // PortableCSSPad        'u:dev:MediaWiki:QuickCreateUserPage/code.js',          // QuickCreateUserPage        'u:dev:MediaWiki:SkinSwitchButton/code.js',             // SkinSwitchButton    ] });

/** * Imports which should be loaded whin I'm in specified group of users */ for (var i in wgUserGroups) { // content-moderator if(wgUserGroups[i] == 'content-moderator') { linkSweepConfirmation = true;   // Linksweeper LinkSweeperDelay = 1000; importArticles({           type: 'script',            articles: [                'u:dev:MediaWiki:AjaxBatchDelete/code.2.js',            // AjaxBatchDelete                'u:dev:MediaWiki:CategoryRenameAuto-update/code.js',    // CategoryRenameAuto-update                'u:dev:MediaWiki:FileUsageAuto-update/code.js',         // FileUsageAuto-update                'u:dev:Linksweeper/code.js',                            // Linksweeper                'u:dev:MediaWiki:RevealAnonIP/code.js',                 // RevealAnonIP            ]        }); }

// thread-moderator if(wgUserGroups[i] == 'threadmoderator') { importArticles({           type: 'script',            articles: [                'u:dev:MediaWiki:AjaxBatchDelete/code.2.js',            // AjaxBatchDelete                'u:dev:MediaWiki:RevealAnonIP/code.js',                 // RevealAnonIP            ]        }); }

// admin if(wgUserGroups[i] == 'sysop') { importArticles({           type: 'script',            articles: [                'u:dev:MediaWiki:AjaxBatchDelete/code.2.js',            // AjaxBatchDelete                'u:dev:MediaWiki:CategoryRenameAuto-update/code.js',    // CategoryRenameAuto-update                'u:dev:MediaWiki:FileUsageAuto-update/code.js',         // FileUsageAuto-update                'u:dev:Linksweeper/code.js',                            // Linksweeper                'u:dev:ListFiles/code.js',                              // ListFiles                'u:dev:MediaWiki:RevealAnonIP/code.js',                 // RevealAnonIP                'u:dev:MediaWiki:WHAM/pl/code.2.js'                     // WHAM            ]        }); }

// bot if(wgUserGroups[i] == 'bot') { linkSweepConfirmation = true;   // Linksweeper LinkSweeperDelay = 1000; importArticles({           type: 'script',            articles: [                'u:dev:MediaWiki:AjaxBatchDelete/code.2.js',            // AjaxBatchDelete                'u:dev:MediaWiki:CategoryRenameAuto-update/code.js',    // CategoryRenameAuto-update                'u:dev:MediaWiki:FileUsageAuto-update/code.js',         // FileUsageAuto-update                'u:dev:Linksweeper/code.js',                            // Linksweeper            ]        }); } }

/** * Other scripts */ $(function {   $("#LastEdited").wrap(" ");    $("#LastEdited").before(" Ostatnio edytowane "); });

// Snippets by Nanaki

/* Link to my and bot's contribs */ $('.wds-global-navigation__user-menu li:has(a[data-tracking-label="account.message-wall"])').clone.insertAfter('.wds-global-navigation__user-menu li:has(a[data-tracking-label="account.message-wall"])').find('>a').attr('data-tracking-label','account.contributions').attr('href', '/wiki/Special:Contributions/PiBot').text('Mój bot'); $('.wds-global-navigation__user-menu li:has(a[data-tracking-label="account.message-wall"])').clone.insertAfter('.wds-global-navigation__user-menu li:has(a[data-tracking-label="account.message-wall"])').find('>a').attr('data-tracking-label','account.botcontributions').attr('href', '/wiki/Special:Contributions/Pirr').text('Mój wkład'); /* Bypass Special:InfoboxBuilder */ if($('.template-classification-type-text').data('type') == 'infobox') $('#ca-edit').attr('href', function(a) { return this.href + '&useeditor=source'; }) /* Special:Insights won't lead directly to editor */ $('.insights-list-item-title').attr('href', function { return this.href.replace(/([\?&])action=edit&/, '$1') })