Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
// Show an upload's aspect ratio in the file historyfunctiongetRatio(){// If we're not reading an article, do nothingif(!(mw.config.get("wgAction")==="view"&&mw.config.get("wgIsArticle")&&mw.config.get("wgPageName")!=="Main_Page")){return;}$(".filehistory td:nth-child(4)").each(function(){varcontent=$(this).html();vardimensions=content.match(/([0-9,]+) × ([0-9,]+)/);if(dimensions){varwidth=parseInt(dimensions[1].replace(/,/,""));varheight=parseInt(dimensions[2].replace(/,/,""));varratio=(width/height).toFixed(2);$(this).html(content+" ["+ratio+"]");}else{returnfalse;}});}getRatio();