User:HM100/global.js

/* 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-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 = 'Get CPE Framework Theme'; $('.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						 '--community-background-image:' + getComputedStyle(document.querySelector('html')).getPropertyValue("--theme-body-background-image") + ';\n' +						 '--community-background-image-opacity:' + getComputedStyle(document.querySelector('html')).getPropertyValue("--theme-background-image-opacity")  + ';\n' +						 '--community-header-text-color:' + getComputedStyle(document.querySelector('html')).getPropertyValue("--theme-community-header-color")  + ';\n' +						 '--community-background-color:' + getComputedStyle(document.querySelector('html')).getPropertyValue("--theme-body-background-color")  + ';\n' +						 '--community-background-mode:' + bgmode  + ';\n' +						 '--community-background-horizontal-alignment:' + align2 + ';\n' +						 '--community-background-vertical-alignment:' + align + ';\n' + '--community-background-size:' + size + ';\n' + '--community-background-no-horizontal-tiling:' + tiling + ';\n' + '--community-background-no-vertical-tiling:' + tiling2 + ';\n' + '--anchor-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' + '--sticky-header-background-color:' + getComputedStyle(document.querySelector('html')).getPropertyValue("--theme-sticky-nav-background-color") + ';\n' + '--toolbar-background-color:' + 'auto' + ';\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