User:OttoLannister550/global.js

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:MassEdit/code.js',        'u:dev:MediaWiki:MassCategorization/code.js',        'u:dev:MediaWiki:FindAndReplace/code.js',        'u:dev:MediaWiki:AjaxRename/code.js',        'u:dev:MediaWiki:AjaxEdit.js',        'u:dev:MediaWiki:AjaxRedirect/code.js',        'u:dev:MediaWiki:MassNullEdit/code.js',        'u:dev:MediaWiki:AjaxDelete/code.js',        'u:dev:MediaWiki:AjaxBatchDelete.js',        'u:dev:MediaWiki:AjaxBatchUndelete.js',        'u:dev:MediaWiki:AjaxEditPreview.js',        'u:dev:MediaWiki:WhatLinksHere/code.js',        'u:dev:MediaWiki:TopArticles/code.js',        'u:dev:MediaWiki:MassRename/code.js',        'u:dev:MediaWiki:DisplayTimer/code.js',        'u:dev:MediaWiki:NullEditButton/code.js',        'u:dev:MediaWiki:DisableCode/code.js',        'u:dev:MediaWiki:PageCreator/code2.js',        'u:dev:MediaWiki:ThemeToggler.js', 'u:dev:MediaWiki:DateInserter/code.js', 'u:dev:MediaWiki:QuickPurge.js', 'u:dev:MediaWiki:SkinSwitchFD.js', 'u:dev:MediaWiki:MultiUpload.js', 'u:dev:MediaWiki:ImageMapEdit.js', 'u:dev:MediaWiki:ImageMapEditZoom.js', 'u:dev:MediaWiki:MobilePreview.js', ] });

/* Adding Personal CSS, Personal JS, Wiki CSS, and Wiki JS to the Wiki Tools' Dropdown */ $(function { //Sub Menus Creation Function	function createSubMenus(submenuNames, type, scope) {		var submenuContainer_ul = document.createElement('ul');    	submenuContainer_ul.className = 'wds-list wds-is-linked';    	var i, submenu_a, submenu_li;    	for (i = 0; i < submenuNames.length; i++) {		    submenu_a = document.createElement('a');		    switch (scope) {				case 'Personal':    				submenu_a.href = '/wiki/Special:MyPage/' + submenuNames[i].toLowerCase     								  + '.' + type.toLowerCase;    				break;				case 'Wiki':    				submenu_a.href = '/wiki/MediaWiki:' + submenuNames[i] + '.'     								  + type.toLowerCase;				}    	    submenu_a.id = scope + '_' + submenuNames[i] + '_' + type;    	    submenu_a.innerHTML = submenuNames[i] + ' ' + type;    	    submenu_li = document.createElement('li');         	submenu_li.appendChild(submenu_a);    	    submenuContainer_ul.appendChild(submenu_li); }   	var submenuContainer_div = document.createElement('div'); submenuContainer_div.className = 'wds-is-not-scrollable wds-dropdown-level-2__content'; submenuContainer_div.appendChild(submenuContainer_ul); return submenuContainer_div; } //Creating the Sub Menus var personalCSSName = ['Common', 'Fandomdesktop', 'FandomMobile', 'Oasis']; var personalJSName = ['Common', 'Fandomdesktop', 'FandomMobile', 'Oasis']; var wikiCSSName = ['Common', 'Fandomdesktop', 'Wikia', 'Print', 'Group-autoconfirmed', 'Group-sysop', 'Group-bot']; var wikiJSName = ['Common', 'Fandomdesktop', 'Wikia', 'Group-autoconfirmed', 'Group-sysop', 'Group-bot']; personalCSS_submenuContainer_div = createSubMenus(personalCSSName,'CSS','Personal'); personalJS_submenuContainer_div = createSubMenus(personalJSName,'JS','Personal'); wikiCSS_submenuContainer_div = createSubMenus(wikiCSSName,'CSS','Wiki'); wikiJS_submenuContainer_div = createSubMenus(wikiJSName,'JS','Wiki'); //Creating the Menus var menu_a, menu_li; var menuName = ['Personal CSS', 'Personal JS', 'Wiki CSS', 'Wiki JS']; var menuName_hyphen = ['Personal_CSS', 'Personal_JS', 'Wiki_CSS', 'Wiki_JS']; var menuContent = [personalCSS_submenuContainer_div, personalJS_submenuContainer_div, wikiCSS_submenuContainer_div, wikiJS_submenuContainer_div]; var wikiToolsDropdown = document.querySelectorAll('.wiki-tools .wds-dropdown__content>ul.wds-list'); for (i = 0; i < menuName.length; i++) { menu_a = document.createElement('a'); menu_a.href = '#'; menu_a.id = menuName_hyphen[i]; menu_a.innerHTML = menuName[i]; menu_li = document.createElement('li'); menu_li.className = 'wds-dropdown-level-2 is-calculated css-js_pages_li'; menu_li.appendChild(menu_a); menu_li.appendChild(menuContent[i]); wikiToolsDropdown[0].appendChild(menu_li); wikiToolsDropdown[1].appendChild(menu_li); } //Styling the Menus var cssjsPageMenus_li = document.getElementsByClassName('css-js_pages_li'); var cssjsPageMenus_a = document.querySelectorAll('.wds-dropdown__content .css-js_pages_li>a'); var cssjsPageSubMenus_div = document.querySelectorAll('.css-js_pages_li>div.wds-dropdown-level-2__content'); for (i = 0; i < cssjsPageMenus_li.length; i++) { cssjsPageMenus_li[i].style.marginRight = '9px'; cssjsPageMenus_li[i].style.marginLeft = '0'; cssjsPageMenus_a[i].style.paddingLeft = '19px'; cssjsPageSubMenus_div[i].style.left = 'inherit'; cssjsPageSubMenus_div[i].style.right = '100%'; } });