User:Americhino/global.js

if (wgCityId == '177') {importStylesheetPage('MediaWiki:FANSUN.css', 'dev');} if (wgCityId == '7931') {importStylesheetPage('MediaWiki:FANSUN.css', 'dev');}

var qtUserPageTemplate = ''; var qtMessageWallGreetingTemplate = ''; // thank you fngplg window.gnWikiLinks = ['//dev.wikia.com|Dev', '//elenaofavalor.wikia.com|Elena of Avalor', '//paladins.wikia.com|Paladins', '//calvinandhobbes.wikia.com|Calvin and Hobbes']; $(function {    var $menu = $('.wds-global-navigation__link-group .wds-list'),        links = window.gnWikiLinks || [];    if (!$menu.length || !links.length) return;    links.forEach(function (v) { var link = v.replace(/\[|\]/g, ''), $a = $('', {               href: (/(.*?)\||$/.exec(link) || {})[1] || link,                text: (/\|(.*)/.exec(link) || {})[1] || link,                title: link            }); $menu.prepend($('').append($a)); }); }); // Adding code links to global nav user menu; borrowing code from Fandyllic var code_links_globalnote = 'Global'; var code_links_localnote = 'Local'; var code_links_global_js = { global: 'Global.js', }; var code_links_global_css = { global: 'Global.css', }; var code_links_local_js = { common: 'Common.js', wikia: 'Wikia.js', chat: 'Chat.js', }; var code_links_local_css = { common: 'Common.css', wikia: 'Wikia.css', chat: 'Chat.css', }; $(function {	'use strict';    $('.wds-global-navigation__user-menu .wds-dropdown__content').addClass('wds-is-not-scrollable');    /* Start adding menu */	if (!window.code_links_global_js || $('#CodeLinks').length) {		return;	}	var $codeLinksList = $('').addClass('wds-list wds-is-linked');	var $codeLinks = $('')		.addClass('wds-dropdown-level-2')		.append( $('') .attr('href', '#') .addClass('wds-dropdown-level-2__toggle') .attr('data-tracking', 'custom-level-2') .append(					$(' ').text('Code Links'),					$(' ')				), $(' ')				.addClass('wds-is-not-scrollable wds-dropdown-level-2__content') .append($codeLinksList) );	// Add note at top for global code   $codeLinksList.append( $('') .text(code_links_globalnote) .css('font-weight', 'bold') .addClass('codelinks global') );    // Add links from global js list	Object.keys(window.code_links_global_js).forEach(function (key) { /* Change if (true) to else if special case needs to be added before again */ if (true) { // Use key for URL as normal $codeLinksList.append(               $('').append( $('') .attr('href', '//community.wikia.com/wiki/User:' + wgUserName + '/' + key + '.js') .attr('target', '_blank') .text(window.code_links_global_js[key]) )               );        }     // Add links from global css list Object.keys(window.code_links_global_css).forEach(function (key) {       /* Change if (true) to else if special case needs to be added before again */        if (true) { // Use key for URL as normal            $codeLinksList.append( $('').append(                       $('')                        .attr('href', '//community.wikia.com/wiki/User:' + wgUserName + '/' + key + '.css')                        .attr('target', '_blank')                        .text(window.code_links_global_css[key])                    ) );       }    });	// Add note for local code $codeLinksList.append(		$('')			.text(code_links_localnote)			.css('font-weight', 'bold')			.addClass('codelinks local')	); // Add links from local js list Object.keys(window.code_links_local_js).forEach(function (key) {		$codeLinksList.append( $('').append(				$('')					.attr('href', '/wiki/User:' + wgUserName + '/' + key + '.js')					.attr('target', '_blank')					.text(window.code_links_local_js[key])			) );	});   // Add links from local css list Object.keys(window.code_links_local_css).forEach(function (key) {       /* Change if (true) to else if special case needs to be added before again */        if (true) { // Use key for URL as normal            $codeLinksList.append( $('').append(                       $('<a>')                        .attr('href', '/wiki/User:' + wgUserName + '/' + key + '.css')                        .attr('target', '_blank')                        .text(window.code_links_local_css[key])                    ) );       }    });	$('div.wds-global-navigation__user-menu > div.wds-dropdown__content > ul.wds-list > li:nth-child(3)') .before($codeLinks); }); }); /* here goes nothing! */ importArticles({   type: 'script',    articles: [        'u:dev:QuickCreateUserPage/code.js',        'u:dev:UserAccountAge/code.js',        'u:dev:MastheadGender/code.js',        'u:dev:GlobalEditcount/code.js',        'u:dev:LastEdited/code.js',        'u:dev:RevealAnonIP/usercode.js',        'u:dev:MediaWiki:WorkingMoreUsersCount.js',        'u:dev:EditBio/code.js',        'u:americhino:MediaWiki:QuickCreateMessageWallGreetingShort.js',        'u:dev:MediaWiki:ContribsLink/code.js',        'u:dev:MediaWiki:VSTFReport.js',        'u:americhino:MediaWiki:ModernPortableCSSPad/code.js',        'u:dev:MediaWiki:ModernBackToTopButton/code.js',        'u:dev:MediaWiki:UnsafeScripts/code.js',        'u:dev:MediaWiki:EditBio/code.js',        'u:americhino:MediaWiki:CustomWikis.js',    ] });