User:HM100/global.js

if ($("body.page-Fandom_Variable_Test").length) { $("#mw-content-text").empty.append( 'Here\'s a list of all Fandom Variables (Except the dynamic and RGB ones) being workable on CPE-language Projects:' + ' ' +

' ' + ' ' + '--theme-body-background-color ' + ' ' +

' ' + ' ' + '--theme-body-text-color ' + ' ' +

' ' + ' ' + '--theme-body-text-color--hover ' + ' ' +

' ' + ' ' + '--theme-sticky-nav-background-color ' + ' ' +

' ' + ' ' + '--theme-sticky-nav-text-color ' + ' ' +

' ' + ' ' + '--theme-sticky-nav-text-color--hover ' + ' ' +

' ' + ' ' + '--theme-page-background-color ' + ' ' +

' ' + ' ' + '--theme-page-background-color--secondary ' + ' ' +

' ' + ' ' + '--theme-page-text-color ' + ' ' +

' ' + ' ' + '--theme-page-text-color--hover ' + ' ' +

' ' + ' ' + '--theme-page-text-mix-color ' + ' ' +

' ' + ' ' + '--theme-page-text-mix-color-95 ' + ' ' +

' ' + ' ' + '--theme-page-accent-mix-color ' + ' ' +

' ' + ' ' + '--theme-link-color ' + ' ' +

' ' + ' ' + '--theme-link-color--hover ' + ' ' +

' ' + ' ' + '--theme-link-label-color ' + ' ' +

' ' + ' ' + '<small style="display:block; text-align:center;">--theme-accent-color ' + ' ' +

' ' + ' ' + '<small style="display:block; text-align:center;">--theme-accent-color--hover ' + ' ' +

' ' + ' ' + '<small style="display:block; text-align:center;">--theme-accent-label-color ' + ' ' +

' ' + ' ' + '<small style="display:block; text-align:center;">--theme-alert-color ' + ' ' +

' ' + ' ' + '<small style="display:block; text-align:center;">--theme-alert-color--hover ' + ' ' +

' ' + ' ' + '<small style="display:block; text-align:center;">--theme-alert-label ' + ' ' +

' ' + ' ' + '<small style="display:block; text-align:center;">--theme-warning-color ' + ' ' +

' ' + ' ' + '<small style="display:block; text-align:center;">--theme-warning-label ' + ' ' +

' ' + ' ' + '<small style="display:block; text-align:center;">--theme-success-color ' + ' ' +

' ' + ' ' + '<small style="display:block; text-align:center;">--theme-success-label ' + ' ' +

' ' + ' ' + '<small style="display:block; text-align:center;">--theme-message-color ' + ' ' +

' ' + ' ' + '<small style="display:block; text-align:center;">--theme-message-label ' + ' ' +

' ' + ' ' + '<small style="display:block; text-align:center;">--theme-community-header-color ' + ' ' +

' ' + ' ' + '<small style="display:block; text-align:center;">--theme-community-header-color--hover ' + ' ' +

' '

); }

/* Quick Revert Spam and Vandalism */ mw.loader.using(['site', 'mediawiki.util']).then(function {	massBlockDelay = 440;	massProtectDelay =720;	massUserRightsDelay = 1000;	batchDeleteDelay = 768;	WHAMDelay = 480;	WHAMBotMe = true;

window.fdButtons = []; window.fdButtons.push(	   {	        summary: 'Housekeeping',	        label: 'HK'	    },	    {	        summary: 'Vandalism',	        label: 'V'	    },	    {	        summary: 'Spam',	        label: 'S'	    },	    {	        summary: 'Terms of Use violation',	        label: 'ToU'	    },	     {	        summary: 'Unused File/Video',	        label: 'UF'	    },	    {	            summary: 'Broken Redirect',	        label: 'BR'	    }	); // our config is stored in an array window.lessOpts = window.lessOpts || []; // each target page needs separate configuration window.lessOpts.push( {	   // this is the page that has the compiled CSS	    target: 'MediaWiki:Common.css',	    // this is the page that lists the LESS files to compile	    source: 'MediaWiki:Custom-common.less',	    // these are the pages that you want to be able to update the target page from	    // note, you should not have more than one update button per page	    load: [	        'MediaWiki:Common.css',	        'MediaWiki:Custom-common.less'	    ],	    // this is the page that contains the comment header for the target page	    // all other comments are stripped during compilation	    header: 'MediaWiki:Custom-css-header/common'	},	{	    // this is the page that has the compiled CSS	    target: 'MediaWiki:Wikia.css',	    // this is the page that lists the LESS files to compile	    source: 'MediaWiki:Custom-wikia.less',	    // these are the pages that you want to be able to update the target page from // note, you should not have more than one update button per page load: [ 'MediaWiki:Wikia.css', 'MediaWiki:Custom-wikia.less' ],	   // this is the page that contains the comment header for the target page // all other comments are stripped during compilation header: 'MediaWiki:Custom-css-header/wikia' },	{	   // this is the page that has the compiled CSS target: 'User:HM100/navbar-customization.css', // this is the page that lists the LESS files to compile source: 'User:HM100/navbar-customization.less', // these are the pages that you want to be able to update the target page from // note, you should not have more than one update button per page load: [ 'User:HM100/navbar-customization.css', 'User:HM100/navbar-customization.less' ],	   // this is the page that contains the comment header for the target page // all other comments are stripped during compilation header: 'User:HM100/navbar-customization' });	window.lessConfig = {	   // reloads the page after the target page has successfully been updated	    // defaults to true	    reload: true,	    // wraps the parsed CSS in pre tags to prevent any unwanted links to templates, pages or files	    // defaults to true	    wrap: true,	    // for adding non-standard user groups that can edit the mediawiki namespace	    // normally this is limited to staff, vstf, helpers and sysops/admins	    // but if there are other groups that can edit the namespace on your wiki	    // add them to the array here for the script to load for them	    allowed: ['user']	};

importArticles( {	   type: 'script',	    articles: [            'u:dev:MediaWiki:FD-CSS-VList.js',	        'u:dev:MediaWiki:FD-CSS-VTable.js',	        'u:dev:MediaWiki:Rollback/code.js',	        'u:dev:MediaWiki:MassBlock/code.js',	        'u:dev:MediaWiki:MassProtect/code.js',	        'u:dev:MediaWiki:MassRename/code.js',	        'u:dev:MediaWiki:MassUserRights/code.js',	        'u:dev:MediaWiki:WHAM/code.2.js',	        'u:dev:MediaWiki:UTCClock/code.js',// Removed because I'm using Κλωκάκι, a clone of UTCClock and DisplayTimer	        'u:dev:MediaWiki:Wikimarks/code.js',	        'u:dev:MediaWiki:FastDelete/code.js',	        "u:dev:MediaWiki:AjaxBatchDelete/code.2.js",	       // 'u:dev:MediaWiki:GlobalEditcount/code.js',	        'u:dev:MediaWiki:ViewInContentLang/code.js',	        //'u:dev:MediaWiki:LastEdited/code.js',	       // 'u:dev:MediaWiki:SeeMoreActivityButton/code.js',	        "u:dev:MediaWiki:AnchoredRollback/code.js", 'u:dev:MediaWiki:RedirectManagement/code.js', 'u:dev:MediaWiki:Colors/code.js', 'u:dev:MediaWiki:ThemeToggler.js' //'u:dev:MediaWiki:ModernButtons/code.js', // 'u:dev:MediaWiki:Less/code.2.js', // 'u:dev:MediaWiki:MessageBlock/code.js', //'u:el.alpha-styles:Κλωκάκι/script.js', ]	} ); });

/* Theme Porting */ var config = mw.config.get([       'skin',    ]);

var $link = '<li><a id="ThemeDownload" href="#" title="Get the equivalent theme in CPE Framwork style" style="cursor:pointer;">Get CPE Framework Theme</a></li>'; $('.toolbar ul.tools').append($link); if($(".fandom-community-header__background.fullScreen").length) { // Full Screen Backgrounds var bgmode = 'full'; } else { // Header Backgrounds var bgmode = 'standard'; }      if($(".fandom-community-header__background.fitTopLeft, .fandom-community-header__background.fitTopRight, .fandom-community-header__background.fitCenter").length) { // Fit var size = 'contain'; var tiling = 'true'; var tiling2 = 'true'; if($(".fandom-community-header__background.fitTopLeft").length) { var align = 'top'; var align2 = 'left'; } else if($(".fandom-community-header__background.fitTopRight").length) { var align = 'top'; var align2 = 'right'; } else { var align = 'center'; var align2 = 'center'; }      } else if($(".fandom-community-header__background.tileHorizontally, .fandom-community-header__background.tileVertically, .fandom-community-header__background.tileBoth").length) { // Tiled var size = 'full'; if($(".fandom-community-header__background.tileHorizontally, .fandom-community-header__background.tileBoth").length) { var tiling = 'false'; } else { var tiling = 'true'; }		if($(".fandom-community-header__background.tileVertically, .fandom-community-header__background.tileBoth").length) { var tiling2 = 'false'; } else { var tiling2 = 'true'; }      	var align = 'top'; var align2 = 'left'; } else { // Regular var size = 'cover'; var tiling = 'false'; var tiling2 = 'false'; var align = 'center'; var align2 = 'center'; }      // Onclick $('ul.tools #ThemeDownload') .click(function {				result = '[theme="A"][visualcolors="standard"] {\n' + // Beginning						 '--body-background-image:' + getComputedStyle(document.querySelector('html')).getPropertyValue("--theme-body-background-image") + ';\n' +						 '--body-background-image-opacity:' + getComputedStyle(document.querySelector('html')).getPropertyValue("--theme-background-image-opacity")  + ';\n' +						 '--body-background-color:' + getComputedStyle(document.querySelector('html')).getPropertyValue("--theme-body-background-color")  + ';\n' +						 '--superbar-text-background-color:' + getComputedStyle(document.querySelector('html')).getPropertyValue("--theme-community-header-color")  + ';\n' +						 '--body-background-mode:' + bgmode  + ';\n' +						 '--body-background-horizontal-alignment:' + align2 + ';\n' +						 '--body-background-vertical-alignment:' + align + ';\n' +						 '--body-background-size:' + size  + ';\n' + '--body-background-no-horizontal-tiling:' + tiling + ';\n' + '--body-background-no-vertical-tiling:' + tiling2 + ';\n' + '--secondary-accent-background-color:' + getComputedStyle(document.querySelector('html')).getPropertyValue("--theme-link-color") + ';\n' + '--page-background-color:' + getComputedStyle(document.querySelector('html')).getPropertyValue("--theme-page-background-color") + ';\n' + '--page-border-background-color:' + 'auto' + ';\n' + '--page-text-background-color:' + 'auto' + ';\n' + '--accent-background-color:' + getComputedStyle(document.querySelector('html')).getPropertyValue("--theme-accent-color") + ';\n' + '--caret-background-color:' + getComputedStyle(document.querySelector('html')).getPropertyValue("--theme-sticky-nav-background-color") + ';\n' + '--custom-secondary-font:' + getComputedStyle(document.querySelector('html')).getPropertyValue("--theme-page-headings-font") + ';\n' + '}'; // Ending navigator.clipboard.writeText(result); alert('Successfully copied CPE Framework theme to Clipboard'); });		// Onclick end