User:RavenZuza/global.js

// Importy importArticles({   type: "script",    articles: [    //    "u:wed:user:Wedkarski/chatpack.js",               // ChatPack    //    "u:szynka:user:Szynka013/chatpackExtended.js",   // ChatPackExtended        "u:dev:MediaWiki:MultiUpload/code.js",              // MultiUploads         "u:dev:MediaWiki:PortableCSSPad/code.js",            // PortableCSSPad        "u:dev:MediaWiki:WHAM/pl/code.2.js",                // WHAM!        "u:dev:MediaWiki:AjaxBatchDelete/code.2.js",        // AjaxBatchDelete    ] });

/** Small enchancements by Luqgreg **/ var config = mw.config.get([  "wgCanonicalNamespace",   "wgCanonicalSpecialPageName",   "wgUserName" ]); // Correct polish months names in profiles by Luqgreg if(config.wgCanonicalNamespace === "User") { var detailsCode = $(".UserProfileMasthead .details").html; detailsCode = detailsCode.replace("styczeń", "stycznia"); detailsCode = detailsCode.replace("luty", "lutego"); detailsCode = detailsCode.replace("marzec", "marca"); detailsCode = detailsCode.replace("kwiecień", "kwietnia"); detailsCode = detailsCode.replace("maj", "maja"); detailsCode = detailsCode.replace("czerwiec", "czerwca"); detailsCode = detailsCode.replace("lipec", "lipca"); detailsCode = detailsCode.replace("sierpień", "sierpnia"); detailsCode = detailsCode.replace("wrzesień", "września"); detailsCode = detailsCode.replace("październik", "października"); detailsCode = detailsCode.replace("listopad", "listopada"); detailsCode = detailsCode.replace("grudzień", "grudnia"); $(".UserProfileMasthead .details").html(detailsCode); }

// Hide sysops edits in RC by Luqgreg var newGetParam = "hidesysops=", sysopsHidden = false, sysopsList = [], enchancedView = true; if(config.wgCanonicalSpecialPageName === "Recentchanges") { var getParams = window.location.search; if(getParams !== "") { if(getParams.includes("hidesysops=1")) { var sysopsHidden = true; newGetParam = getParams.replace("hidesysops=1", "hidesysops=0"); } else { newGetParam = getParams + "&" + newGetParam + (sysopsHidden ? "0" : "1"); }       if(getParams.includes("hideenhanced=1")) enchancedView = false; } else { newGetParam = "?" + newGetParam + "1"; }   $.getJSON("/api.php?action=query&list=allusers&augroup=sysop&format=json", function(data) {        if(!data.error) {            $.each(data.query.allusers, function(i, sysop) { sysopsList.push(sysop.name); });           if(sysopsHidden) RC_HideSysopsEdits;        }    }); /*var api = new mw.Api; api.get({       action: 'query',        list: 'allusers',        augroup: 'sysop',        format: 'json'    }).done(function(data) {});*/ RC_HideSysopsEdits; window.ajaxCallAgain = window.ajaxCallAgain || []; window.ajaxCallAgain.push(RC_HideSysopsEdits); } function RC_HideSysopsEdits { $('a[href*="hidemyself="').before(''+ (sysopsHidden ? "Pokaż": "Ukryj") + ' administratorów • '); if(sysopsHidden) { $.each(sysopsList, function(i, sysop) {           $('a.mw-userlink[title$="' + sysop + '"]').each(function { if(enchancedView) { parentElem = $(this).parent.parent.parent.parent; if(parentElem.parent.is("table")) parentElem.parent.remove; else parentElem.remove; }               else $(this).parent.remove; });       });        $(".rc-conntent h4").each(function {            var nextElem = $(this).next;            if(enchancedView) {                if(nextElem.is("h4")) {                    $(this).remove;                } else if(nextElem.is("div") & nextElem.children.length < 1) {                    $(this).remove;                }            } else {                if(nextElem.is("ul.special") & nextElem.children.length < 1) {                    $(this).remove;                }            }        }); } }