User:Nekky-chan/global.js

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

// DarkBarbarian imports mw.loader.load('//clashofclans.fandom.com/de/index.php?title=User:DarkBarbarian/BlockRollback.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:DiscussionTemplates.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:PreviewRail2.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',    ] });

//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' }			]);		});	}); });

//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('mw: '+mw.config.get('wgVersion')+' | 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 '); }	}); });

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 };

// Remove ?so=search from URL mw.loader.using('mediawiki.util').then(function {	if (mw.util.getParamValue('so')) {		window.history.replaceState({}, , window.location.href.replace('?so=search', ));	} });

if (mw.config.get('wgDBname') === 'wikia') { console.log("Go away!") } else { $(function {       $('.global-navigation__logo  > svg.wds-icon').remove; // only remove the logo.        $('.global-navigation__logo').prepend( $(' ', {               src: 'https://static.wikia.nocookie.net/central/images/9/99/Fandom_Pride.png/revision/latest/scale-to-width-down/33',                style: 'margin-bottom: 6px'            }) );   }); }