User:TRJ-VoRoN/global.js

importArticles({   type: "script",    articles: [        'u:dev:MediaWiki:QuickToolsv2/code.js',        'u:dev:MediaWiki:RecentChangesMultiple/code.2.js',        'u:dev:MediaWiki:GlobalNavButtons.js',        'u:dev:MediaWiki:WantedPagesFilter/code.js',        'u:dev:RevealAnonIP/usercode.js',        'u:dev:MediaWiki:ToggleSideBar/code.js'    ] });

/*Менюшки*/

window.globalNavButtons = [ {   text: 'Моё', url: '', isMain: true, whoIsMain: false, shortName: '0' },     {    text: 'TBOI', url: 'https://bindingofisaac.fandom.com/ru/', isMain: false, whoIsMain: '0', shortName: '' },          {    text: 'Dead Cells', url: 'https://dead-cells.fandom.com/ru/', isMain: false, whoIsMain: '0', shortName: '' },            {    text: 'Indie', url: 'http://ru.indiegames.wikia.com/ru/', isMain: false, whoIsMain: '0', shortName: '' },        {    text: 'Кастла', url: 'https://castlevania.fandom.com/ru/', isMain: false, whoIsMain: '0', shortName: '' },          {    text: 'СМБ', url: 'https://supermeatboy.fandom.com/ru/', isMain: false, whoIsMain: '0', shortName: '' },

{   text: 'Слежка', url: 'https://bindingofisaac.fandom.com/ru/wiki/Участник:TRJ-VoRoN/Правки', isMain: false, whoIsMain: '0', shortName: '' },

{   text: 'Вики', url: '', isMain: true, whoIsMain: false, shortName: '1' },

{   text: 'Forest', url: 'https://the-forest.fandom.com/ru/', isMain: false, whoIsMain: '1', shortName: '' },

{   text: 'HK', url: 'https://hollowknight.fandom.com/ru/', isMain: false, whoIsMain: '1', shortName: '' },

{   text: 'Etg', url: 'https://enter-the-gungeon.fandom.com/ru/', isMain: false, whoIsMain: '1', shortName: '' },             {    text: 'Messenger', url: 'http://ru.the-messenger.wikia.com/ru/', isMain: false, whoIsMain: '1', shortName: '' },

{   text: 'В.С', url: '', isMain: true, whoIsMain: false, shortName: '2' }, {   text: 'Основная', url: 'https://community.fandom.com/ru/', isMain: false, whoIsMain: '2', shortName: '' },  {    text: 'Тех. Обновы', url: 'https://community.fandom.com/ru/wiki/Главная_тема:Технические_обновления_ФЭНДОМА', isMain: false, whoIsMain: '2', shortName: '' },       {    text: 'Викии Вики', url: 'https://wikies.fandom.com/', isMain: false, whoIsMain: '2', shortName: '' },       {    text: 'Правка ссылки изоб.', url: 'http://ru.siegenax.wikia.com/wiki/Участник:Kopcap94/IP', isMain: false, whoIsMain: '2', shortName: '' },

{       text: 'Ссылки', url: '', isMain: true, whoIsMain: false, shortName: '3' },   {    text: 'MediaWiki:ImportJS', url: '', isMain: false, whoIsMain: '3', shortName: '' },   {    text: 'MediaWiki:Communitymessages-notice-msg и MediaWiki:Community-corner', url: '', isMain: false, whoIsMain: '3', shortName: '' },   {    text: 'MediaWiki:Custom-Discord-Module-Settings', url: '', isMain: false, whoIsMain: '3', shortName: '' },       {    text: 'Project:Medals', url: '', isMain: false, whoIsMain: '3', shortName: '' },

{   text: 'MediaWiki:Edittools', url: '', isMain: false, whoIsMain: '3', shortName: '' },       {    text: 'Служебная:MultipleUpload', url: '', isMain: false, whoIsMain: '3', shortName: '' },      {    text: 'MediaWiki:Wiki-navigation?action=edit', url: '', isMain: false, whoIsMain: '3', shortName: '' },

];

/*Менюшки окончены*/

/*global mw */ $(function {    'use strict';

if ($('#ca-lang-qqx').length) { return; }

var elem = mw.html, qstring = (window.location.search) ? '&' : '?',       $qqx = elem.element('li', {id: 'ca-lang-qqx'}, new elem.Raw( elem.element('a', {                   href: (window.location.href).replace(/#.*/, '') + qstring + 'debug=1',                    title: 'See all system messages on this page ',                }, (window.qqxText || 'Debug')))); if (mw.config.get('skin') === 'oasis') { $(window.WikiaBar.wikiaBarWrapperObj.find('.tools')).append($qqx); } else { $('#p-cactions > .pBody > ul').append($qqx); }

}); //

/*global mw */ $(function {    'use strict';

if ($('#ca-lang-qqx2').length) { return; }

var elem = mw.html, qstring = (window.location.search) ? '&' : '?',       $qqx2 = elem.element('li', {id: 'ca-lang-qqx2'}, new elem.Raw( elem.element('a', {                   href: (window.location.href).replace(/#.*/, '') + qstring + 'action=purge',                    title: 'See all system messages on this page ',                }, (window.qqx2Text || 'Cache')))); if (mw.config.get('skin') === 'oasis') { $(window.WikiaBar.wikiaBarWrapperObj.find('.tools')).append($qqx2); } else { $('#p-cactions > .pBody > ul').append($qqx2); }

}); //

/*Кнопка викификатора рядом с парсером Fngplg */ mw.hook('wikificator.ready').add(function {  !function( mw, $ ) {    if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' )) === -1 ) return;

$( ' ', {       id: 'my-id-for-wikificator',        class: 'wikify',        style: 'float: right; margin-bottom: 5px;',        text: 'WikiF',        type: 'button'    }) .insertAfter( '.wpSummary_canMinorEdit' );

}( mediaWiki, jQuery ); });

/*Парсер */ !function( mw, $ ) { if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' )) === -1 ) return;

$( ' ', {       id: 'linkParser',        style: 'float: right; margin-bottom: 15px;',        text: 'Parse',        type: 'button'    }) .insertAfter( '.wpSummary_canMinorEdit' ) .on( 'click', function {       var text = $( '#wpTextbox1' ).val,            new_text = text;

$.each( text.match( /(%[A-Za-z0-9]{2}){1,}/g ), function( i, v ) {           try {                new_text = new_text.replace( v, decodeURIComponent( v ) );            } catch( e ) {                console.log( 'There was error ( ' + e + ' ) during attempt to parse this: ' + v );            }        });

$( '#wpTextbox1' ).val( new_text ); }); }( mediaWiki, jQuery );

/*fast eidt*/ var trjcode = (function(window) {	'use strict';	if (window === null) {		throw new TypeError('window is not found');	}	var $;	var jQuery;	if (typeof window.jQuery !== 'undefined') {		jQuery = $ = window.jQuery;	} else {		throw new Error('jQuery is undefined');	}	var mw = window.mw || window.mediaWiki;	if (!mw || typeof mw !== 'object') {		throw new Error('mw is not defined');	}

var editToken = mw.user.tokens.get('editToken'); var wgUserName = mw.config.get('wgUserName'); var wgPageName = mw.config.get('wgPageName'); var wgUserGroups = mw.config.get('wgUserGroups'); var wgAction = mw.config.get('wgAction'); var wgCanonicalSpecialPageName = mw.config.get('wgCanonicalSpecialPageName'); var wgTitle = mw.config.get('wgTitle'); var wgIsMainPage = mw.config.get('wgIsMainPage'); var wgScript = mw.config.get('wgScript'); var wgArticlePath = mw.config.get('wgArticlePath'); var wgArticleId = mw.config.get('wgArticleId'); var wgIsArticle = mw.config.get('wgIsArticle'); var wgNamespaceNumber = mw.config.get('wgNamespaceNumber'); var $document = $(document); var $html = $('html'); var $window = $(window); var $body = $(document.body); var $WikiaPage = $('#WikiaPage'); var $mwContentText = $('#mw-content-text'); var $WikiaRail = $('#WikiaRail'); var API = '/ru/api.php'; var INDEX = '/ru/index.php'; var mwtools = { block: function(name, time, callback) { $.post(API, {				action: 'block',				user: name,				expiry: time === Infinity ? 'infinite' : time + ' days',				reblock: true,				autoblock: true,				allowusertalk: true,				nocreate: true,				token: editToken,				format: 'json'			}).success(function(data) {				callback(data);			}); },

};	var This; var FADETIME = 250; return This = { Init: function { !('customToggleClick' in jQuery.fn) && (jQuery.fn.customToggleClick = function {				var functions = Array.prototype.slice.call(arguments).filter($.isFunction);				return this.each(function(_, elem) { var i = 0; $(elem).on('click', function {						if (functions[i].apply(this, arguments) !== false) {							i++;						}						if (i === functions.length) {							i = 0;						}					}); });			});			this.AdmRightsRegExp = /(Часовой|bureaucrat|sysop|threadmoderator|helper|vstf|staff)/g; this.MwContentTextBarrel = { $container: $(' '), isFilled: false };			this.Auto.init; this.AjaxLivePad.init; },		Auto: { appendLIElement: function($LIElement) { this.$railListElement.append($LIElement); },			$railModuleElement: $(' ', {				'class': 'rail-module tools-module',				html: 'Инструменты '			}), personalJSText: 'Локальный JavaScript', globalAutoText: '[ Глобальный ]', personalCSSText: 'Локальный CSS', globalCSSText: 'Глобальный CSS', personalJSFAIcon: 'fab fa-js-square', personalCSSFAIcon: 'fab fa-css3-alt', init: function { var that = this; this.$railListElement = $(''); this.$railModuleElement.append(this.$railListElement); if (wgUserName) { this.appendLIElement($('', { html: ' ' + this.personalJSText + '' + this.globalAutoText + '' }));					this.appendLIElement($('', { html: ' ' + this.personalCSSText + '' + this.globalAutoText + '' }));				}				if ($WikiaRail.hasClass('loaded')) { $WikiaRail.prepend(that.$railModuleElement); } else { $WikiaRail.on('afterLoad.rail', function {						$WikiaRail.prepend(that.$railModuleElement);					}); }				$('#PageHeader .page-header__contribution-buttons .wds-dropdown .wds-list').append('Очистить кеш</a></li>').find('#APurge').on('click', function(event) {					event.preventDefault;					mwtools.purge;				});

}		},

AjaxLivePad: { livePadFAIcon: 'fab fa-html5', $livePadContainer: $(' '), $mwContentTextContainer: $(' '), getHTML: function { return '     '; },			id: null, delay: 500, pagetitle: 'Предпросмотр', sendRequest: function(content, callback) { var that = this; $.post(INDEX, {					action: 'ajax',					rs: 'EditPageLayoutAjax',					title: that.pagetitle,					content: content,					method: 'preview',					page: 'SpecialCustomEditPage',					section: ,					summary: 				}).success(function(data) {					callback(data);				}); },			mwCollaspibleSelector: '[id^="mw-customcollapsible"]', mwTabberSelector: '.tabber', handleHTML: function(data) { var lastIntervals = []; var i;				try { if ($.isPlainObject(data) && data.html) { this.$output.html(data.html); This.Tabbers.init(this.$output); for (i = 0; i < lastIntervals.length; i++) { clearInterval(lastIntervals[i]); }

if (typeof jQuery.fn.makeCollapsible === 'function') { this.$output.find(this.mwCollaspibleSelector).makeCollapsible; }						if (typeof jQuery.fn.tabber === 'function') { this.$output.find(this.mwTabberSelector).tabber; }					}				} catch (ex) { this.$output.html(This.Invoke.getExceptionHTML(ex)); }			},			getChildNodes: function getChildNodes($elem) { return $($elem.prop('childNodes')); },			init: function { var that = this; this.$livePadContainer.append(this.getHTML); this.$input = this.$livePadContainer.find('#AjaxLivePad > textarea'); this.$output = this.$livePadContainer.find('#AjaxLivePad > div:last-child'); this.enableModeFn = function { This.MwContentTextBarrel.isFilled = true; This.MwContentTextBarrel.$container.append(that.getChildNodes($mwContentText)); $mwContentText.append(that.getChildNodes(that.$livePadContainer)); };				this.disableModeFn = function { This.MwContentTextBarrel.isFilled = false; that.$livePadContainer.append(that.getChildNodes($mwContentText)); $mwContentText.append(that.getChildNodes(This.MwContentTextBarrel.$container)); };				This.Auto.appendLIElement(this.$toggleButton = $('<li>', { html: '<span class="' + this.livePadFAIcon + '"> Живой редактор</a>' }));				this.$toggleButtonParent = this.$toggleButton; this.$toggleButton = this.$toggleButton.find('a').customToggleClick(function(event) {					event.preventDefault;

that.enableModeFn; that.$toggleButtonParent.addClass('enabled'); }, function(event) { event.preventDefault; that.disableModeFn; that.$toggleButtonParent.removeClass('enabled'); });				this.$input.on('input', function { if (that.id !== null) { clearTimeout(that.id); }					var content = $(this).val; that.id = setTimeout(function {						that.sendRequest(content, function(data) { that.id = null; that.handleHTML(data); });					}, that.delay); });			}		},	}; })(typeof window !== 'undefined' ? window : null); trjcode.Init;