User:Cheeseskates/global.js

// JavaScript Extension Tweaks //—————————————————————————————— ! ! ! ———————————————————————————————// // Quick Access to EditCount if ($('.tally').length) { var $tally = $('.tally'); $tally.attr('title', 'EditCount'); $tally.click(function {        window.location.href = wgServer + '/wiki/Special:EditCount/' + $('h1[itemprop="name"]').text;    }); }

// AjaxRC: Used to Make imputted pages refresh in Ajax. window.ajaxRefresh = 1000; window.ajaxPages = [

// --WatchList specific pages (temporary) // ////* Put any page name or URL into this list to monitor this specific page. *////

// ——————————————————— InterLanguage Wiki Monitor pages ————————————————————— // ////* Note 1: The order is according to the Language Brigade Wiki. *////   ////* Note 2: The first language name is the English word. The second language name is the language's word/original word. The two letters after are the abbreviations for the second language names. *////

/////* 1. Always add the language names in this order: English word -> Original -> Abbreviation (e.g. fr for french) *///// /////* 2. Always add the page names in this order: WikiActivity -> RecentChanges -> Log */////

////* Note 3: The Chinese and Romanian's WikiActivity are the same as the English WikiActivity page, and the Brazilian Portuguese (including their Log page), Catalan, Galician, and occitan's WikiActivity are the same as the Spanish WikiActivity page. Because of this, They are not added to prevent duplication. *////

////* English (en)                                      *//// "Special:WikiActivity", "Special:RecentChanges", "Special:AbuseLog", "Special:Log", "Special:Log/upload", "Special:Images", "Special:Videos", "Report:Vandalism",

////* German (Deutsch) (de)                             *//// "Spezial:WikiActivity", "Spezial:Letzte_Änderungen", "Spezial:Logbuch",

////* Spanish (Español) (es)                            *//// "Especial:WikiActivity", "Especial:CambiosRecientes", "Especial:Registro",

////* Suomi (Finnish) (fi)                              *//// "Toiminnot:WikiActivity", "Toiminnot:Tuoreet_muutokset", "Toiminnot:Loki",

////* French (Français) (fr)                            *//// "Spécial:WikiActivity", "Spécial:Modifications_récentes", "Spécial:Journal",

////* Italian (Italiano) (it)                           *//// "Speciale:WikiActivity", "Speciale:UltimeModifiche", "Speciale:Registri",

////* Japanese (日本語) (ja)                            *//// "特別:WikiActivity", "特別:最近の更新", "特別:ログ",

////* Korean (한국어) (ko)                              *//// "특수기능:위키활동내역", "특수기능:최근바뀜", "특수기능:기록",

////* Nederlands (nl)                                   *//// "Speciaal:WikiActivity", "Speciaal:RecenteWijzigingen", "Speciaal:Logboeken",

////* Polish (Polski) (pl)                              *//// "Specjalna:Aktywność_na_wiki", "Specjalna:Ostatnie_zmiany", "Specjalna:Rejestr",

////* Brazilian Portuguese (Português do Brasil) (pt-br) *//// "Especial:Mudanças_recentes",

////* Russian (Русский) (ru)                            *//// "Служебная:WikiActivity", "Служебная:RecentChanges", "Служебная:Log",

////* Vietnamese (Tiếng Việt) (vi)                      *//// "Đặc_biệt:Hoạt_động_wiki", "Đặc_biệt:Thay_đổi_gần_đây", "Đặc_biệt:Nhật_trình",

////* Chinese (中文) (zh)                               *//// "Special:最近更改", "Special:日志",

////* Chinese (Taiwan) ( 中文(台灣) ) (zh-tw)           *//// "特殊:WikiActivity", "特殊:近期變動", "特殊:日誌",

////* Afrikaans (af)                                    *//// "Spesiaal:WikiActivity", "Spesiaal:Onlangse_wysigings", "Spesiaal:Logboek",

////* Arabic (العرب) (ar)                                *//// ////* Note: RecentChanges and Log pages have been swapped here due to textspace compatibility issues. *////   "خاص:WikiActivity", "خاص:أحدث_التغييرات", "خاص:سجل",

////* Belorussian (Беларуская) (be)                     *//// "Адмысловае:WikiActivity", "Адмысловае:RecentChanges", "Адмысловае:Log",

////* Bulgarian (Български) (bg)                        *//// "Специални:WikiActivity", "Специални:Последни_промени", "Специални:Дневници",

////* Catalan (Català) (ca)                             *//// "Especial:Canvis_recents", "Especial:Registre",

////* Greek (Ελληνικά) (el)                             *//// "Ειδικό:WikiActivity", "Ειδικό:ΠρόσφατεςΑλλαγές", "Ειδικό:Μητρώο",

////* Estonia (Eesti) (et)                              *//// "Eri:WikiActivity", "Eri:Viimased_muudatused", "Eri:Logid",

////* Farsi (فارسی) (fa)                                 *//// ////* Note: RecentChanges and Log pages have been swapped here due to textspace compatibility issues. *////   "ویژه:WikiActivity", "ویژه:تغییرات_اخیر", "ویژه:سیاهه‌ها",

////* Galician (Galego) (gl)                            *//// "Especial:Cambios_recentes", "Especial:Rexistros",

////* Hungarian (Magyar) (hu)                           *//// "Speciális:WikiActivity", "Speciális:Friss_változtatások", "Speciális:Rendszernaplók",

////* Indonesian (Bahasa Indonesia) (id) *//// "Istimewa:WikiActivity", "Istimewa:Perubahan_terbaru", "Istimewa:Catatan",

////* Limburg (Limburgs in Dutch) (li)                  *//// ////* Note: Wikiactivity is the same as the Nederlands' WikiActivity page, so it is not included. *////   "Speciaal:Lètste_verangeringe", "Speciaal:Logbeuk",

////* Lithuanian (Lietuvių) (lt)                        *//// "Specialus:WikiActivity", "Specialus:Naujausi_keitimai", "Specialus:Sąrašas",

////* Norwegian Bokmål ( ‪Norsk (bokmål) ‬) (no)          *//// "Spesial:WikiActivity", "Spesial:Siste_endringer", "Spesial:Logg",

////* Occitan (oc)                                      *//// "Especial:Darrièrs_cambiaments", "Especial:Jornal",

////* Romanian (Română) (ro)                            *//// "Special:Schimbări_recente", "Special:Jurnal",

////* Serbian / serbian (Српски / Srpski) (sr)          *//// "Посебно:WikiActivity", "Посебно:СкорашњеИзмене", "Посебно:Извештај",

////* Ukrainian (Українська) (uk)                       *//// "Спеціальна:WikiActivity", "Спеціальна:RecentChanges", "Спеціальна:Log",

////* End Language page section *////

// End of AjaxRC section //

];

/* var page = mw.config.get("wgPageName"), globalLinks = { "User": "Special:Mypage", "Talk": "Special:Mytalk", "Contributions": "Special:Contributions/" + mw.config.get('wgUserName'), "Common JS": "Special:Mypage/common.js", "Common CSS": "Special:Mypage/common.css", "Recent Changes": "Special:RecentChanges", "Admins": "Special:ListAdmins", "Settings": "Special:Preferences", "Log off": "Special:UserLogout?returnto=" + page, "Abuse Log": "Special:AbuseLog", "Purge": page + "?action=purge", "QQX": page + "?uselang=qqx", "Raw": page + "?action=raw" },   linksContent = ""; if (mw.config.get("wgCityId") === "177") { globalLinks = $.extend(globalLinks, {       "Abuse Log": "Special:AbuseLog",        "New Wikis": "Special:Newwikis",        "Global JS": "Special:Mypage/global.js",        "Global CSS": "Special:Mypage/global.css",    }); } for (var prop in globalLinks) linksContent += "" + prop + ""; $(".notifications-container").first.before(linksContent);
 * * Name:       Global navbar modifications                                 |
 * * Author:     KockaAdmiralac <1405223@gmail.com>                          |
 * * Description: Modifies the global navbar to add useful buttons           |

// WHAM WHAMBotMe = true; WHAMBotReason = "Official Cleanup Business"; WHAMDelay = 100;

// CacheCheck window.cacheSkip = []; window.cacheSkipLimit = 1000; window.topLevelCat = '';

// Fast Delete var fdButtons = []; fdButtons[fdButtons.length] = { 'summary': 'spam', 'label': 'S' }; fdButtons[fdButtons.length] = { 'summary': 'vandalism', 'label': 'V' }; fdButtons[fdButtons.length] = { 'summary': 'Housekeeping', 'label': 'HK' }; fdButtons[fdButtons.length] = { 'summary': 'Cleanup', 'label': 'C' }; fdButtons[fdButtons.length] = { 'summary': 'Unused', 'label': 'U' }; fdButtons[fdButtons.length] = { 'summary': 'Unofficial/Not-Needed/Irrelevant', 'label': 'UNI' }; fdButtons[fdButtons.length] = { 'summary': 'Other reason', 'label': 'Other' };

// Direct JavaScript code. /* Note: When there is a code/etc.js page with the code, please put the page name into ImportArticles instead. //—————————————————————————————— ! ! ! ———————————————————————————————// /* --- var mwApiCounter1291238 = setInterval(function {    if (typeof mw.Api !== 'undefined') {        if ($("#UserProfileMasthead").length === 0) {            return;        } else {            var username = $("h1").text;            new mw.Api.get({ action: "query", list: "users", ususers: username, usprop: "editcount" }).done(function (data) { if (data.error) { new BannerNotification("Error while fetching user edit count: " + data.error.code, 'error').show; } else if (typeof data.query.users[0].editcount !== 'undefined') { $(' ' + data.query.users[0].editcount.toString.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") + ' global edits ').insertAfter(".tally"); }               $("#globaleditcount").click(function  {                    window.location.href = "/wiki/Special:Editcount/" + username;                }); }).fail(function { new BannerNotification("Error while fetching user edit count", 'error').show; });       }        clearInterval(mwApiCounter1291238);    } }, 100);
 * * Name:       Global edit count script                                   |
 * * Author:     Noreplyz                                                   |
 * *             KockaAdmiralac <1405223@gmail.com> (smaller modifications) |
 * * Description: Adds a global edit count to user's masthead.              |

////* End Direct Import section  *////

// Javascript wrapped in ImportArticles. //—————————————————————————————— ! ! ! ———————————————————————————————// /* Note: Every 50 lines of JavaScript imports must be followed by an extra ImportArticle. */ /* Note 2: Organise each import from what wiki they were from. e.g. Dev wiki.

/* ImportArticles 1 */ $(window).load(function {    importArticles({ type: "script", articles: [ 'u:dev:MediaWiki:AjaxBatchDelete/code.2.js', 'u:dev:MediaWiki:AjaxBlock/code.js', 'u:dev:MediaWiki:AjaxPatrol/code.js', 'u:dev:MediaWiki:AjaxRC/code.js', 'u:dev:MediaWiki:AjaxRedirect/code.js', 'u:dev:MediaWiki:AjaxUndo/code.js', 'u:dev:MediaWiki:AntiUnicruft/code.js', 'u:dev:MediaWiki:AutoEditDropdown/code.js', 'u:dev:MediaWiki:CacheCheck/code.js', 'u:dev:MediaWiki:CategoryRenameAuto-update/code.js', 'u:dev:MediaWiki:ChatReload/code.js', 'u:dev:MediaWiki:CleanWantedFiles/code.js', 'u:dev:MediaWiki:ContribsLink/code.js', 'u:dev:MediaWiki:DisplayTimer/code.js', 'u:dev:MediaWiki:EditIntroButton/code.js', 'u:dev:MediaWiki:FastDelete/code.js', 'u:dev:MediaWiki:FileUsageAuto-update/code.js', 'u:dev:MediaWiki:FindAndReplace/code.js', 'u:dev:MediaWiki:FloatingToc/code.js', 'u:dev:MediaWiki:HeaderLinks/code.js', 'u:dev:MediaWiki:LastEdited/code.js', 'u:dev:MediaWiki:Notiplus.js', "u:dev:MediaWiki:MarkForDeletion/code.js", 'u:dev:MediaWiki:MassBlock/code.js', 'u:dev:MediaWiki:MassRenameRevert/code.js', 'u:dev:MediaWiki:MassProtect/code.js', 'u:dev:MediaWiki:MassCategorization/code.js', 'u:dev:MediaWiki:Message/code.js', 'u:dev:MediaWiki:MessageBlock/code.js', 'u:dev:MediaWiki:MisspelledPage/code.js', 'u:dev:MediaWiki:MultipleFileDelete/code.js', 'u:dev:MediaWiki:Nuke/code.js', 'u:dev:MediaWiki:NullEditButton/code.js', 'u:dev:MediaWiki:QuickDiff/code.js', 'u:dev:MediaWiki:QuickThreads/code.js', 'u:dev:MediaWiki:QuickToolsv2/code.js', 'u:dev:MediaWiki:Rollback/code.js', 'u:dev:MediaWiki:RecentChangesMultiple/code.2.js', 'u:dev:MediaWiki:ReplyAndClose/code.js', 'u:dev:MediaWiki:RevealAnonIP/code.js', 'u:dev:MediaWiki:SearchSuggest/code.js', 'u:dev:MediaWiki:Sine/code.js', 'u:dev:MediaWiki:ThreadIndicator/code.js', 'u:dev:MediaWiki:ViewRemoved/code.js', 'u:dev:MediaWiki:View Source/code.js', 'u:kocka:MediaWiki:AjaxCommentDelete/code.js', 'u:kocka:MediaWiki:AjaxThreadDelete/code.js', 'u:starmanw:MediaWiki:MultiUpload/code.js', 'u:starmanw:MediaWiki:QuickLogs/code.js', 'u:starmanw:User:Dorumin/WHAM', ]   }); });

/* ImportArticles 2 */ $(window).load(function {    importArticles({ type: "script", articles: [ 'u:dev:MediaWiki:CatFilter/code.js', 'u:dev:MediaWiki:ScriptAssist/code.js', 'u:dev:MediaWiki:UnsafeScripts/code.js', 'u:dev:MediaWiki:YouTubeModal/code.js', 'u:admintools:MediaWiki:Common.js/ajaxRollback.js', 'u:admintools:MediaWiki:Common.js/extraRollbacks.js', 'u:kocka:MediaWiki:MessageWallActions/code.js', 'u:kocka:MediaWiki:RedirectMessageWall/code.js', 'u:josephhawk:User:Josephyr/linksweeper.js', ]   }); });