MediaWiki:Pagecss.js

//Perpage CSS and JS script by TheFearow // Includes MediaWiki:common.css/PAGENAME and MediaWiki:common.js/PAGENAME as well as a skin dependent one. // Since it's in MediaWiki space, its fully protected. Code here is only loaded for the respective page, so stops excess bloating of the global common.js/css and the skin ones.

// Config // Uncomment the below line (remove the //) and comment the line below it (add // at the start) to make it use the admin only version (done) var pagecss_base = "MediaWiki:"; //var pagecss_base = "User:TheFearow/pagecss/"; // End Config

//Common mw.loader.load( '/w/index.php?title=' + pagecss_base + "common.css/" + mw.config.get('wgPageName') + '&action=raw&ctype=text/css', 'text/css' ); mw.loader.load( '/w/index.php?title=' + pagecss_base + "common.js/" + mw.config.get('wgPageName') + '&action=raw&ctype=text/javascript' ); //Per skin /* I'm removing the per skin as the js can be dectected via skin variable, and no one has ever used to perskin css/js. feel free to revert - bawolff mw.loader.load( '/w/index.php?title=' + pagecss_base + mw.config.get('skin') + ".css/" + mw.config.get('wgPageName') + '&action=raw&ctype=text/css', 'text/css' ); mw.loader.load( '/w/index.php?title=' + pagecss_base + mw.config.get('skin') + ".js/" + mw.config.get('wgPageName') + '&action=raw&ctype=text/javascript' ); //End perpage CSS and JS script