User:Lience/global.js

/* GlobalNavModifications */ window.globalLinks = { global: { "User": "User:Mamvik", "Talk": "User talk:Mamvik", "Contribs": "Special:Contributions/Mamvik", "RC": "Special:RecentChanges?hidebots=0&hideminor=0", "Themes": "MediaWiki:Themes.css", "Wikia": "MediaWiki:Wikia.css", "Common": "MediaWiki:Common.css", "Global JS": "w:User:Mamvik/global.js", "Global CSS": "w:User:Mamvik/global.css", },   community: { "Global JS": "User:Mamvik/global.js", "Global CSS": "User:Mamvik/global.css" } };

/* AjaxDelete: all reasons */ if(mw.config.get('wgContentLanguage') === 'ru') { window.AjaxDelete = { deleteReasons: { 'Не используется': 'Не используется', 'Справка:Вандализм': 'Вандализм', 'Справка:Спам': 'Спам', 'Дубликат файла': 'Дубликат файла', 'По просьбе автора': 'По просьбе автора', 'Неинформативный контент': 'Неинформативный контент', 'Нарушение правил': 'Нарушение правил', },   }; } else { window.AjaxDelete = { deleteReasons: { 'Help:Vandalism': 'Vandalism', 'Help:Spam': 'Spam' },   }; } $(function {    window.AjaxDelete.autoCheckWatch = false;    window.AjaxDelete.noUndelete = true; });

/* Automatically creating my user page and greeting */ if(mw.config.get('wgContentLanguage') === 'ru') { window.AutoCreateUserPagesConfig = { content: { 2: ,           3: ,            1202: ''        },        summary: 'Автоматическое создание страницы участника' }; } else { window.AutoCreateUserPagesConfig = { content: { 2: ,           3: ,            1202: ''        },        summary: 'Auto creating user page' }; }

/* Remove MassProtect later */ massProtectDelay = 1000;

/* Standard Edit Summaries: default reasons */ window.dev = window.dev || {}; if (mw.config.get('wgCityId') === "621556") { window.dev.editSummaries = { select: [ 'Standard Edit Summaries', '1.Interwiki', [ 'Interwiki', 'Updated interwiki link', 'Fixed interwiki link', 'Removing Portuguese redirect', 'Alphabetical order', ],           '2.CVN thing', [ 'Removed vandalism', 'Removed spam', 'Improved the previous revision' ],       ]    }; } else if(mw.config.get('wgContentLanguage') === 'en') { window.dev.editSummaries = { select: [ 'Standard Edit Summaries', '1.Interwiki', [ 'Interwiki', 'Updated interwiki link', 'Fixed interwiki link' ],           '2.CVN thing', [ 'Removed vandalism', 'Removed spam', 'Improved the previous revision' ],           '3.Translation', [ 'Started the translation', 'Added the translation', 'Finished the translation', 'Fixed the translation' ],       ]    }; } else if (mw.config.get('wgCityId') === "1435801") { window.dev.editSummaries = { select: [ 'Standard Edit Summaries', '1.Translation', [ 'Started the translation', 'Added the translation', 'Finished the translation', 'Fixed the translation' ],           '2.Updating Interwiki', [ 'Updated Arabic links', 'Updated Czech links', 'Updated German links', 'Updated English links', 'Updated Spanish links', 'Updated Finnish links', 'Updated French links', 'Updated Hungarian links', 'Updated Indonesian links', 'Updated Italian links', 'Updated Japanese links', 'Updated Dutch links', 'Updated Polish links', 'Updated Portuguese links', 'Updated Romanian links', 'Updated Russian links', 'Updated Turkish links', 'Updated Ukrainian links', 'Updated Vietnamese links', 'Updated Chinese links' ],       ]    }; } else if(mw.config.get('wgContentLanguage') === 'ru') { window.dev.editSummaries = { select: [ 'Standard Edit Summaries', '1.Интервики', [ 'Интервики', 'Обновление интервики', 'Исправление ссылки интервики', ],           '2.Контрвандализм', [ 'Удаление вандализма', 'Удаление спама', 'Улучшение предыдущей правки' ],           '3.Перевод', [ 'Начало перевода', 'Добавление перевода', 'Окончание перевода', 'Исправление перевода' ],       ]    }; } else if (mw.config.get('wgContentLanguage') === 'de') { window.dev.editSummaries = { select: [ 'Standard Edit Summaries', '1.Interwiki', [ 'Interwiki', 'Updated interwiki link', 'Fixed interwiki link' ],           '2.CVN thing', [ 'Removed vandalism', 'Removed spam', 'Improved the previous revision' ],       ]    }; } else if (mw.config.get('wgContentLanguage') === 'fr') { window.dev.editSummaries = { select: [ 'Standard Edit Summaries', '1.Interwiki', [ 'Interwiki', 'Updated interwiki link', 'Fixed interwiki link' ],           '2.CVN thing', [ 'Removed vandalism', 'Removed spam', 'Improved the previous revision' ],       ]    }; } else if(mw.config.get('wgContentLanguage') === 'uk') { window.dev.editSummaries = { select: [ 'Standard Edit Summaries', '1.Interwiki', [ 'Interwiki', 'Updated interwiki link', 'Fixed interwiki link' ],           '2.CVN thing', [ 'Removed vandalism', 'Removed spam', 'Improved the previous revision' ],       ]    }; } else if(mw.config.get('wgContentLanguage') === 'vi') { window.dev.editSummaries = { select: [ 'Standard Edit Summaries', '1.Interwiki', [ 'Interwiki', 'Updated interwiki link', 'Fixed interwiki link' ],           '2.CVN thing', [ 'Removed vandalism', 'Removed spam', 'Improved the previous revision' ],       ]    }; } else { window.dev.editSummaries = { select: [ 'Standard Edit Summaries', '1.Interwiki', [ 'Interwiki', 'Updated interwiki link', 'Fixed interwiki link' ],           '2.CVN thing', [ 'Removed vandalism', 'Removed spam', 'Improved the previous revision' ],       ]    }; }

/* Imports */ importArticles({   type: 'script',    articles: [        'u:kocka:User:KockaAdmiralac/GlobalNavModifications.javascript',        'u:botcentral:User:Ditto_Duck_Penguin/FixedRollback.javascript',        'u:kocka:User:KockaAdmiralac/AutoCreateUserPages.javascript',        'u:dev:MediaWiki:UnhideUserMasthead/code.js',        'u:dev:MediaWiki:Standard_Edit_Summary/code.js',        'u:kocka:MediaWiki:VSTFReport/code.js',        'u:dev:MediaWiki:AjaxDelete/code.js',        'u:dev:MediaWiki:QuickDiff/code.js',        'u:dev:NullEditButton/code.js',        'u:dev:MassProtect/code.js'    ] });

/* Inspired by Me, tackled by Ditto Duck Penguin */ $('textarea#wpTextbox1').change(function(e) {   var signature;    if (mw.config.get('wgContentLanguage') === "ru") {        if (mw.config.get('wgNamespaceNumber') === 3 || mw.config.get('wgNamespaceNumber') === 1201 || mw.config.get('wgCanonicalNamespace') === "Thread") {            signature = ' \'\'\'Mamvik  http://vignette4.wikia.nocookie.net/sedali/images/f/fd/Vanguard.png/revision/latest/scale-to-width-down/20?cb=20160826204149 | Вклад  | Время: \'\'\; texw= 'textarea.focus'        } else {            signature = ' \'\'\'Mamvik  http://vignette4.wikia.nocookie.net/sedali/images/f/fd/Vanguard.png/revision/latest/scale-to-width-down/20?cb=20160826204149 | Обсуждение  | Вклад  | Время: \'\'\; }   } else { if (mw.config.get('wgNamespaceNumber') === 3 || mw.config.get('wgNamespaceNumber') === 1201 || mw.config.get('wgCanonicalNamespace') === "Thread") { signature = ' \'\'\'Mamvik http://vignette4.wikia.nocookie.net/sedali/images/f/fd/Vanguard.png/revision/latest/scale-to-width-down/20?cb=20160826204149 | Contribs  | Time: \'\'\'';texw = 'textarea.focus' } else { signature = ' \'\'\'Mamvik http://vignette4.wikia.nocookie.net/sedali/images/f/fd/Vanguard.png/revision/latest/scale-to-width-down/20?cb=20160826204149 | <font color="#9DC6ED">Talk  | <font color="#9DC6ED">Contribs  | Time: \'\'\''; }   }    var texw = texw || 'textarea#wpTextbox1'; $(texw).val($(texw).val.replace(/(\s)~{4}(\s|$)/gm, '$1' + signature + ' \~\~\~\~\~$2')) });

/* done by me. Replacing NullEditButton to whatever I want >:3 */ $(function {   function nulltext {        var nulledit = "Null Edit";        $('#ca-null-edit').text(nulledit);    }    setTimeout(nulltext, 1000); });

/* "You shall not pass!" */ (function {   var img;    if (wgUserLanguage == 'ru') img = 'http://i.imgur.com/HiMVnYC.png';    else img = 'http://i.imgur.com/JtmgNUu.png';    $('.permissions-errors').html('<img src="' + img + '"/>');     if ($('.editpage-intro-wrapper').length) $('img[src="' + img + '"]').width('122px'); });

/* Removing FANDOM Logo when I'm on phone. Made by Ditto Creeper Bot <3 */ $(function {   $.browser.device = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase));    if ($.browser.device === true) {        var setter = setInterval(safernavigation__logo, 1000);        function safernavigation__logo {            if ($('.wds-global-navigation__logo')[0] !== undefined) {                $('.wds-global-navigation__logo').remove;            } else {                return clearInterval(setter);            }        }    } });