User:Nekky-chan/global.js

// reset editor preferences to source editor from bitomic $(function {   mw.hook('dev.banners').add(function(BannerNotification) { mw.hook('dev.ct').add(function(addButtons) {     addButtons([ {         click: function { var api = new mw.Api; api.postWithToken('csrf', { action: 'options', optionname: 'editortype', optionvalue: 4 }) .then(function {               new BannerNotification( 'Your editor preferences have been changed successfully.' ).show              }) },         icon: 'gear', placement: 'page-tools-left', position: -1, text: 'Set source editor in your preferences' }     ]);    });  }); });

//Copied from bitomic $(function {	mw.hook('dev.banners').add(function(BannerNotification) { mw.hook('dev.ct').add(function(addButtons) {			addButtons([ {					click: function { var title = mw.config.get('wgPageName'); navigator.clipboard.writeText(title); new BannerNotification('This page\'s title has been copied to your clipboard:\n' + title, 'confirm').show; },					icon: 'pages', placement: 'page-tools-left', position: -1, text: 'Copy title' },				{					click: function { navigator.clipboard.writeText(window.location.href); new BannerNotification('This page\'s full URL has been copied to your clipboard:\n' + window.location.href, 'confirm').show; },					icon: 'link', placement: 'page-tools-left', position: -1, text: 'Copy full link' }			]);		});	}); });

// DarkBarbarian's notification-hover-script $(function {   //Notifcations open on hover    $('.wds-dropdown__toggle.notifications__toggle').mouseover(function(e) { this.click; setTimeout(function {           $('.notifications > .wds-dropdown').mouseenter(function { $('.notifications > .wds-dropdown').addClass('wds-is-active'); }).mouseleave(function { $('.notifications > .wds-dropdown').removeClass('wds-is-active'); });       }, 1000);    }); }); //writeonly $(function { var qstring = (window.location.search) ? '&' : '?',    li3 = mw.html.element('li', {id: 'mca'}, new mw.html.Raw(mw.html.element('a', {href: (window.location.href).replace(/#.*/, '') + qstring + 'mcache=writeonly',}, ('writeonly'))));    $('.tools').append(li3); });

//internal stats $('.tools').append( $('').text('Id: '+mw.config.get('wgArticleId')+' | env: '+mw.config.get('wgWikiaEnvironment')+' | NS: '+mw.config.get('wgNamespaceNumber')+' | lang: '+mw.config.get('wgContentLanguage')+' | CityID : '+mw.config.get('wgCityId')+' | db: '+mw.config.get('wgDBname')) );

// LookupUser fixes $(function {	if (mw.config.get('wgCanonicalSpecialPageName') !== 'LookupUser') return;	var prom = [];	$('div.lookup-user__table-wrapper > table > tbody > tr > td:nth-child(2) > a:first-child').each(function{ var baseUrl = $(this).text.trim; prom.push($.getJSON(baseUrl+'api.php?action=query&meta=siteinfo&sipropr=variables&format=json&callback=?')); });	Promise.allSettled(prom).then(function(res) { for (var i in res) { if (res[i].status !== 'rejected') continue; // just assume if we have an error the wiki is closed. // does not consider further in the event the wiki is *otherwise* unreachable, // possible exceptions: behind the VPN, some error state in the API, server error, etc.			$('div.lookup-user__table-wrapper > table > tbody > tr:eq('+i+') > td:nth-child(1)').wrapInner(' ').append(' Closed '); }	}); });

// soap imports mw.loader.load('//internal-soap.fandom.com/index.php?title=User:Nekky-chan/scripts-ucp.js&action=raw&ctype=text/javascript'); // GlobalNavButtons imports mw.loader.load('//dev.fandom.com/index.php?title=User:Nekky-chan/GlobalNavButtonsConf.js&action=raw&ctype=text/javascript');

importArticles({   type: 'script',    articles: [    	'u:dev:MediaWiki:BannerNotification.js',        'u:dev:MediaWiki:Bang.js',        'u:dev:MediaWiki:CustomTools.js',        'u:dev:MediaWiki:ChromeToolbarColor.js',        'u:dev:MediaWiki:MobilePreview.js',        'u:dev:MediaWiki:ModulesLinkToModules.js',        'u:dev:MediaWiki:OriginalImages.js',        'u:dev:MediaWiki:PortableCSSPad/code.js',        'u:dev:MediaWiki:QuickDiff/code.js',        'u:dev:MediaWiki:QuickBarPageTools.js',        'u:dev:MediaWiki:QuickPurge.js',        'u:dev:MediaWiki:ThemeToggler.js',        'u:dev:MediaWiki:VEButton.js',        'u:dev:MediaWiki:View_Source/code.js',        'u:dev:MediaWiki:WHAM/code.2.js',        'u:dev:MediaWiki:PageReport.js',    ] }); var wikis = ['denekkyapi', 'de']; if (mw.config.get('wgContentLanguage') === 'de' &&! wikis.includes(mw.config.get('wgDBname')) ) { importArticle({       type: 'style',        article: 'u:dev:MediaWiki:AutoCreateUserPages.js'    }); console.log("AutoCreateUserPages loaded!"); }   else { console.log("AutoCreateUserPages was not loaded!"); } window.AutoCreateUserPagesConfig = { content: { 2: '',   },    summary: 'Skript: Benutzerseite wird automatisch erstellt', notify: false };