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.
// Tool to easily add the Populate category template to categories.// <pre>// Configuration// Should the edits be saved automatically?if(window.pc_autosave==false){}elseif(window.pc_autosave){}else{pc_autosave=true;}// String constantspc_text="Populate category";pc_tooltip="Populate this category from a gallery";pc_prompt="Please enter a gallery hint or leave emtpy if the gallery name is the same:";functionpc_nomPopulateCategory(){vargalleryhint=prompt(pc_prompt,'');if(galleryhint==null)return;vareditlk=document.getElementById('ca-edit').getElementsByTagName('a')[0].href;document.location=editlk+'&fakeaction=pc_add&galleryhint='+encodeURIComponent(galleryhint);}functionpc_addPopulateCategoryTemplate(galleryhint){if(galleryhint==''){vartxt='{{Populate category}}';}else{vartxt='{{Populate category|gallery='+galleryhint+'}}';}document.editform.wpTextbox1.value=txt+document.editform.wpTextbox1.value;document.editform.wpSummary.value='Adding '+txt+' using [[MediaWiki:Populate-category.js|Populate-category.js]]';if(nfd_autosave)document.editform.wpSave.click();}functionpc_onload(){if(mw.config.get('wgNamespaceNumber')==14){//NS_CATEGORYaddLink('p-tb','javascript:pc_nomPopulateCategory()',pc_text,'pop-cat',pc_tooltip);}varfakeaction=getParamValue('fakeaction');if(fakeaction=='pc_add')pc_addPopulateCategoryTemplate(decodeURIComponent(getParamValue('galleryhint')));}$(document).ready(pc_onload);// </pre>