Difference between revisions of "User:KamranMackey/common.js"

From Industrial-Craft-Wiki
Jump to navigation Jump to search
(Added some new JS which makes the infoboxes collapsible.)
(Deleted the tooltip code from my common JS since it's been moved over to the main JS.)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Counts all your edits and saves them to a page ( http://en.wikipedia.org/wiki/User:Kanegasi/editcounter ) */
if (mw.config.get('wgTitle') === mw.config.get('wgUserName') && mw.config.get('wgNamespaceNumber') === 2) {
/* begin options */
   
   
/** Infobox collapsing script **/
/* end options */
$(".infoboxBlockImage img").each(function(){
    mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Kanegasi/editcounter.js&action=raw&ctype=text/javascript');
width = parseInt($(this).attr("width"), 10);
}
if(width > 240){
$(this).attr("height","");
$(this).attr("width","240");
}
});

Latest revision as of 06:03, 23 February 2015

/* Counts all your edits and saves them to a page ( http://en.wikipedia.org/wiki/User:Kanegasi/editcounter ) */
if (mw.config.get('wgTitle') === mw.config.get('wgUserName') && mw.config.get('wgNamespaceNumber') === 2) {
/* begin options */
 
/* end options */
    mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:Kanegasi/editcounter.js&action=raw&ctype=text/javascript');
}