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.
/* Transform "Upload log" page in a Gallery Usefull to filter images by tag (For example for hide uploads from flickr using the tag uploadwizard) "Upload log" page: https://commons.wikimedia.org/w/index.php?title=Special:Log/upload&user={{YOUR USERNAME}}*/$(function(){'use strict';mw.util.addPortletLink('p-tb','/w/index.php?title=Special:Log&offset=&limit=350&type=upload&user='+wgUserName+'&page=&tagfilter=uploadwizard&subtype=upload','Gallery log');mw.util.addPortletLink('p-personal','/w/index.php?title=Special:Log&offset=&limit=350&type=upload&user='+wgUserName+'&page=&tagfilter=uploadwizard&subtype=upload','Gallery log');constuploadLogPage='Log';constuploadListContainer=".mw-logline-upload";constresultContent="#mw-content-text";constgroupSize=5;function_getPageName(){returnmw.config.get('wgCanonicalSpecialPageName');}function_getImageName(aElement){varimageName=null;constimageNode=$(aElement).find("a").last().attr('href').split(":");if(imageNode.length>0){if(imageNode[1].indexOf(".")!==-1){imageName=imageNode[1];}}returnimageName;}function_getMultiple(valor,multiple){varresto=valor%multiple;return(resto===0);}function_arrayListToGroup(arrayList){vargroupList=[];vartempImageList=[];variSize=0;jQuery.each(arrayList,function(i,val){tempImageList.push(val);iSize++;if(iSize==50){groupList.push(tempImageList);tempImageList=[];iSize=0;}});if(tempImageList.length>0)groupList.push(tempImageList);returngroupList;}function_getImageList(){varimageList=[];varimageName=null;$(uploadListContainer).each(function(){imageName=_getImageName(this);if(imageName!==null){imageList.push(imageName);}$(this).remove();});returnimageList;}function_addGallery(htmlText){$(resultContent).find("ul").append(htmlText);}function_wikiToHTML(){constimageGroupList=_arrayListToGroup(_getImageList());varwikiHTML=[];jQuery.each(imageGroupList,function(i,imageList){wikiHTML.push(jQuery.getJSON(mw.util.wikiScript('api'),{'format':'json','action':'parse','contentmodel':'wikitext','text':_imageListToWikiText(imageList)},function(data){//_addGallery(data.parse.text["*"]);return(data.parse.text["*"]);}));});$.when.apply($,wikiHTML).done(function(){varwikiText=[];for(vari=0;i<arguments.length;i++){console.log(arguments[i]);if(typeofarguments.parse!=='undefined'){wikiText.push(arguments.parse.text["*"]);}elseif((typeofarguments[i]!=='undefined')&&(typeofarguments[i].parse!=='undefined')){wikiText.push(arguments[i].parse.text["*"]);}elseif((typeofarguments[i][0]!=='undefined')&&(typeofarguments[i][0].parse!=='undefined')){wikiText.push(arguments[i][0].parse.text["*"]);}}varnewUnique=[];$.each(wikiText,function(i,el){if($.inArray(el,newUnique)===-1){newUnique.push(el);}else{varindex=newUnique.indexOf(el);if(index>-1){newUnique.splice(index,1);}}});_addGallery(newUnique.join(""));});}function_imageListToWikiText(imageList){return"<gallery>\nFile:"+imageList.join("\nFile:")+"\n</gallery>";}if(uploadLogPage===_getPageName()){_wikiToHTML();}});