User:Michał56/global.js

//=======// //Importy// //=======//

importScriptPage('User:Wedkarski/chatpack.js', 'wedkarski'); //ChatPack importScriptPage('MediaWiki:Interwiki.js', 'community');

//importy artices importArticles({   type: 'script',    articles: [        'u:dev:PortableCSSPad/code.js',    ] });

// Fast dalete button window.fdButtons = []; window.fdButtons.push(   {        summary: 'Niepotrzebne',        label: 'Niepotrzebne'    },    {        summary: 'Wandalizm',        label: 'Wandalizm'    },    {        summary: 'Spam',        label: 'Spam'    } ); importArticles( {   type: 'script',    articles: [        // ...        'u:dev:FastDelete/code.js',        // ...    ] } );

//MassBlock massBlockDelay = 1000; importScriptPage('MassBlock/code.js', 'dev');

//massCategorization massCategorizationDelay = 1000; importScriptPage('MassCategorization/code.js', 'dev');

//massProtect massProtectDelay = 1000; importScriptPage('MassProtect/code.js', 'dev');

//massRedorect massRedirectDelay = 1000; importScriptPage('MassRedirect/code.1.js', 'dev');

//massUserRight massUserRightsDelay = 1000; importScriptPage('MassUserRights/code.js', 'dev');

//MassRenameRevert importScriptPage('MassRenameRevert/code.js', 'dev');

//GiveChatModPrompt importScriptPage('GiveChatModPrompt/code.js', 'dev');

//AjaxBatchDelete (mass delete) batchDeleteDelay = 1000; importScriptPage('AjaxBatchDelete/code.2.js', 'dev');

//ChatBlockbutton chatBlockReason = "ToU violation"; chatBlockExpiry = "3 months"; importScriptPage('ChatBlockButton/code.2.js','dev') importScriptPage('ChatBlockButton/code.js','dev')

//AnchoredRollback anchoredRollbackBot = true; importScriptPage('AnchoredRollback/code.js', 'dev');

//AjaxPatrol importScriptPage('AjaxPatrol/code.js', 'dev' );

// MATIKOWE EMOTIKONY by Super Miron var faces = [ ["( ≖‿≖)", "( ≖⁔≖)"],   ["( ͡° ͜ʖ ͡°)", "٩(͡๏̯͡๏)۶"], ["ಠ_ಠ", "( ͡° ʖ̯ ͡°)"], ["(✖╭╮✖)", "ʕ ͡·ᴥ ͡· ʔ"] ];

//ChatAnnouncements chatAnnouncementsAll = true; importScriptPage('ChatAnnouncements/code.js','dev');

//FilterWords filteredWords = [ 'FILTEREDWORD', 'ANOTHERFILTEREDWORD' ]; removedText = 'TEXTTOREPLACEFILTEREDWORD'; importScriptPage('Filter/code.js','dev');

//Kolorki ;v importScriptPage('ColoredColors/code.js','dev');

importArticles( {   type: 'script',    articles: [        // ...        'u:dev:FasterBanModule/code.js',        // ...    ] } );

//Wham var ug = mw.config.get("wgUserGroups"); if (mw.config.get("wgCanonicalSpecialPageName") === "Contributions" && (ug.indexOf('rollback') + ug.indexOf('sysop') + ug.indexOf('vstf') + ug.indexOf('staff') + ug.indexOf('helper') > -5)) { /*    var walls = [ "Message Wall", "Nachrichtenseite", "Muro", "Viestiseinä", "Mur", "Üzenőfal", "Bacheca", "メッセージ ウォール", "Prikbord", "Tablica wiadomości", "Mural de mensagens", "Стіна обговорення", "Стена обсуждения", "留言墙" ],   username = mw.config.get("wgPageName").split("/")[1], token = mw.user.tokens.get("editToken"); $("#contentSub").append('  Narzędzia administracyjne'); $('#contribs-wham').click(function {     $.showCustomModal('Narzędzia administracyjne', '', { id: 'form-main', width: 660, buttons: [{ message: 'Usuń wszystkie strony', defaultButton: true, handler: function { doDelete; }	       },{		           message: 'Usuń wybrane strony', defaultButton: true, handler: function { startSelectiveDelete; }       },{		           message: 'Cofnij wszystkie edycje', defaultButton: true, handler: function { doRollback; }       },{		           message: 'Szybka blokada', defaultButton: true, handler: function { doBlock; }       },{		           message: 'Wszystkie opcje', defaultButton: true, handler: function { doRollback; doDelete; doBlock; closeRefresh; }       },{          message: 'Anuluj', handler: function { closeRefresh; }       }]      });      $(".close").click(closeRefresh);      mw.util.addCSS('.modalWrapper .modalContent .modalToolbar {text-align:left;}');    }); function apiDelete(page,reason) { new mw.Api.post({     format: 'json',      action: 'delete',      title: page,      reason: reason,      bot: true,      token: token      }) .done(function(d) {        if (!d.error) {          console.log('Zakończono usuwanie strony: '+page+'!');        } else {          console.log('Wystąpił błąd podczas usuwania strony: '+page+' - '+ d.error.code);        }      }) .fail(function {       console.log('Wystąpił błąd podczas usuwania strony: '+page+'!');      }); }   function closeRefresh { $('#form-main').closeModal; setTimeout((function{ location.reload; }), 5000);   }    function doRollback { $('.mw-rollback-link a').each(function {       var href = $(this).attr('href');	$.get(href);        $(this).text('Wykonano!').parents.eq(2).css({'color':'grey','text-decoration':'line-through'}).removeAttr('href');      }); }   function doDelete { var deleteReason = prompt('Proszę podać powód usunięcia','naprawa'); if (!deleteReason) return; $('li .newpage ~ a').each(function {       var title = $(this).attr('title');        if (walls.indexOf(title.split(':')[0]) !== -1)          return;        apiDelete(title,deleteReason);        $(this).parent.css({'color':'grey','text-decoration':'line-through'}).removeAttr('href');      }); $('#mw-content-text ul li').each(function {       var title = $(this).children('a').first.attr('title');	if (title.split('-').length == 1 || title.split('/@comment').length == 1)	  return;           apiDelete(title,deleteReason);        $(this).css({'color':'grey','text-decoration':'line-through'}).removeAttr('href');      }); }   function doBlock { var duration = prompt('Proszę podać czas trwania blokady','2 weeks'), blockReason = prompt('Proszę podać powód blokady','wandalizm'); if (!duration || !blockReason) return; new mw.Api.post({     format: 'json',      action: 'block',      user: username,      expiry: duration,      nocreate: 0,      autoblock: 0,      reason: blockReason,      bot: true,      token: token      }) .done(function(d) {        if (!d.error) {          console.log(username+' został pomyślnie zablokowany!');        }         else {          alert('Wystąpił błąd podczas blokowania: '+username+' - '+ d.error.code);        }      }) .fail(function {       alert('Wystąpił błąd podczas blokowania: '+username+'!');      }); }   function startSelectiveDelete { var chk = ' '; $('#form-main').closeModal; if ($('#btn-wham-del').length && $('#btn-wham-check').length) return; $('#mw-content-text').find('ul').before('Usuń zaznaczone Zaznacz wszystkie'); $('li .newpage ~ a').each(function {       if (!$(this).parent.find('input').length)          $(this).parent.prepend(chk);      }); $('#btn-wham-del').click(function {       var deleteReason = prompt('Proszę podać powód usunięcia','naprawa');        if (!deleteReason)          return;        $('.selectiveDel').each(function { var chkObj = $(this), title = $(this).parent.find('a').first.attr('title'); if (chkObj.attr('Checked') && walls.indexOf(title.split(':')[0]) == -1) { apiDelete(title,deleteReason); $(this).parent.css({'color':'grey','text-decoration':'line-through'}).removeAttr('href'); }       });        setTimeout((function{          location.reload;        }), 5000);      }); $('#btn-wham-check').click(function {       var btn = $(this);        if (btn.text == 'Odznacz wszystkie') {          $('.selectiveDel').each(function { var chkObj = $(this); if (chkObj.attr('Checked')) chkObj.removeAttr('Checked'); });         btn.text('Zaznacz wszystkie');        }        else {          $('.selectiveDel').each(function { var chkObj = $(this); if (!chkObj.attr('Checked')) chkObj.attr('Checked','Checked'); });         btn.text('Odznacz wszystkie');         }      }); } } }) (this.jQuery, this.mediaWiki);
 * (function($, mw) {
 * Message wall equivalents list, used to prevent deletion of message walls (causes glitches and not necessary)
 * Acquired from https://github.com/Wikia/app/blob/ae6cd75a04ba92270931d8fee70f14d40146091b/extensions/wikia/Wall/Wall.namespaces.php

//Link do wkładu if ($('a[data-id="Wkład"]').length) return; $('#AccountNavigation > li > .subnav > li:first').after(		$('').append('Mój wkład')	); }) (this.jQuery, this.mediaWiki);
 * (function($, mw) {

//Link do profilu if ($('a[data-id="Profil"]').length) return; $('#AccountNavigation > li > .subnav > li:first').after(		$('').append('Mój profil')	); }) (this.jQuery, this.mediaWiki);
 * (function($, mw) {