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.
// User interface for marking dustspots to be processed by [[Commons:Deduster]]$(function(){varspots=[],aButton,zoom=null,px=0,py=0,dx,dy;functionstartMark(){if(!zoom){varlink=$('#file').find('a').eq(0);zoom=zoom=$('<img/>').attr('src',link.attr('href')).mousedown(function(e){dx=e.pageX;dy=e.pageY;// check target$(document).on('mousemove.deduster',function(e){//console.log('-'+px+'px -'+py+'px');}).on('mouseup.deduster',function(){$(document).off('mousemove.deduster').off('mouseup.deduster');});});link.replaceWith($('<div></div>').css({width:'100%',height:'600px',overflow:'scroll',}).append(zoom));px=0;py=0;}}functionaddUI(){aButton=$('<button>Mark dust spots</button>').click(startMark).insertAfter($('#file'));}if(mw.config.get('wgNamespaceNumber')==6){if(mw.config.get('wgAction')=='view')addUI();if(mw.config.get('wgAction')=='edit'){vardata=mw.util.getParamValue('dedusteradd');if(data){// validate data // add to text area// submit}}}});