Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// This is a modified version of User:ErrantX/defaultsummaries.js and User:MC10/defaultsummaries.js.// // This version displays a single menu of custom edit summaries across all namespaces. //// See [[User:Equazcion/CustomSummaryPresets]] for full instructions.// // Define custom edit summary presets by adding this after the importScript line: // var customsum1 = "My first custom edit summary";// var customsum2 = "My second custom edit summary";//// Up to 20 custom summaries can be defined this way.vareditsummOriginalSummary="";functioneditsummAddOptionToDropdown(dropdown,optionText){varoption=document.createElement("option");varoptionTextNode=document.createTextNode(optionText);option.appendChild(optionTextNode);dropdown.appendChild(option);}functioneditsummAddCatToDropdown(dropdown,catText){varoption=document.createElement("option");option.disabled=true;option.selected=true;varoptionTextNode=document.createTextNode(catText);option.appendChild(optionTextNode);dropdown.appendChild(option);}functioneditsummOnCannedSummarySelected(){// Save the original value of the edit summary fieldeditsummOriginalSummary=document.getElementById("wpSummary");if(editsummOriginalSummary){editsummOriginalSummary=editsummOriginalSummary.value;}else{editsummOriginalSummary="";}varidx=this.selectedIndex;varcanned=this.options[idx].text;varnewSummary=editsummOriginalSummary;// Append old edit summary with space, if exists,// and last character != spaceif(newSummary.length!==0&&newSummary.charAt(newSummary.length-1)!==" "){newSummary+=" ";}newSummary+=canned;document.getElementById("wpSummary").value=newSummary;}$(function(){varinsertBeforeThis=document.getElementById("wpSummary");// Loop through siblings, looking for editCheckboxes classwhile(insertBeforeThis){if(insertBeforeThis.className==="editCheckboxes"){break;}insertBeforeThis=insertBeforeThis.nextSibling;}// If we failed to find the editCheckboxes class, or insertBeforeThis is nullif(!insertBeforeThis||insertBeforeThis.className!=="editCheckboxes"){return;}editsummOriginalSummary=editsummOriginalSummary.value;// For convenience, add a dropdown box with some canned edit// summaries to the form.vardropdown=document.createElement("select");dropdown.style.width="38%";dropdown.style.margin="0 4px 0 0";dropdown.onchange=editsummOnCannedSummarySelected;editsummAddCatToDropdown(dropdown,"Custom edit summary presets");if(typeofcustomsum1!="undefined")editsummAddOptionToDropdown(dropdown,customsum1);if(typeofcustomsum2!="undefined")editsummAddOptionToDropdown(dropdown,customsum2);if(typeofcustomsum3!="undefined")editsummAddOptionToDropdown(dropdown,customsum3);if(typeofcustomsum4!="undefined")editsummAddOptionToDropdown(dropdown,customsum4);if(typeofcustomsum5!="undefined")editsummAddOptionToDropdown(dropdown,customsum5);if(typeofcustomsum6!="undefined")editsummAddOptionToDropdown(dropdown,customsum6);if(typeofcustomsum7!="undefined")editsummAddOptionToDropdown(dropdown,customsum7);if(typeofcustomsum8!="undefined")editsummAddOptionToDropdown(dropdown,customsum8);if(typeofcustomsum9!="undefined")editsummAddOptionToDropdown(dropdown,customsum9);if(typeofcustomsum10!="undefined")editsummAddOptionToDropdown(dropdown,customsum10);if(typeofcustomsum11!="undefined")editsummAddOptionToDropdown(dropdown,customsum11);if(typeofcustomsum12!="undefined")editsummAddOptionToDropdown(dropdown,customsum12);if(typeofcustomsum13!="undefined")editsummAddOptionToDropdown(dropdown,customsum13);if(typeofcustomsum14!="undefined")editsummAddOptionToDropdown(dropdown,customsum14);if(typeofcustomsum15!="undefined")editsummAddOptionToDropdown(dropdown,customsum15);if(typeofcustomsum16!="undefined")editsummAddOptionToDropdown(dropdown,customsum16);if(typeofcustomsum17!="undefined")editsummAddOptionToDropdown(dropdown,customsum17);if(typeofcustomsum18!="undefined")editsummAddOptionToDropdown(dropdown,customsum18);if(typeofcustomsum19!="undefined")editsummAddOptionToDropdown(dropdown,customsum19);if(typeofcustomsum20!="undefined")editsummAddOptionToDropdown(dropdown,customsum20);vartheParent=insertBeforeThis.parentNode;theParent.insertBefore(dropdown,insertBeforeThis);theParent.insertBefore(document.createElement("br"),dropdown);});