User:ErrantX/defaultsummaries.js: Difference between revisions

Content deleted Content added
rm some code, adding cats
m Maintenance: Replacing addOnloadHook with native jQuery (mw:ResourceLoader/Migration_guide_(users)#addOnloadHook - phab:T130879)
 
(22 intermediate revisions by 2 users not shown)
Line 12:
{
return;
}
 
var insertBeforeThis = document.getElementById("wpSummary").nextSibling;
if(insertBeforeThis.className != "editCheckboxes")
{
return;
}
 
Line 19 ⟶ 25:
 
var dropdown = document.createElement("select");
dropdown.style.width = "38%";
dropdown.style.margin = "0px 4px 0px 0px";
dropdown.onchange = new Function("editsummOnCannedSummarySelected()");
 
var minorDropdown = document.createElement("select");
editsummAddCatToDropdown(dropdown,"Choose a Default Edit Summary");
minorDropdown.style.width = "38%";
editsummAddCatToDropdown(dropdown,"Article");
minorDropdown.onchange = new Function("editsummOnCannedSummarySelected()");
editsummAddOptionToDropdown(dropdown,"add categories");
 
editsummAddOptionToDropdown(dropdown,"add category");
editsummAddCatToDropdown(dropdownminorDropdown,"ChooseCommon aminor Defaultedit Editsummaries Summary- click to use");
editsummAddOptionToDropdown(dropdown,"add citation");
editsummAddOptionToDropdowneditsummAddCatToDropdown(dropdown,"addCommon externaledit linksummaries - click to use");
editsummAddOptionToDropdown(dropdown,"add internal link");
editsummAddOptionToDropdown(dropdownminorDropdown,"addSpelling/grammar quotationcorrection");
editsummAddOptionToDropdown(dropdownminorDropdown,"addFixing refstyle/layout errors");
editsummAddOptionToDropdown(dropdownminorDropdown,"add[[Help:Reverting|Reverting]] section[[Wikipedia:Vandalism|Vandalism]] or test edit");
editsummAddOptionToDropdown(dropdownminorDropdown,"create[[Help:Reverting|Reverting]] redirectunexplained pagecontent removal");
editsummAddOptionToDropdown(dropdownminorDropdown,"createCopyedit stub article(minor)");
editsummAddOptionToDropdown(dropdown,"delete external link");
if (mw.config.get('wgNamespaceNumber') == 0)
editsummAddOptionToDropdown(dropdown,"delete internal link");
{
editsummAddOptionToDropdown(dropdown,"delete section");
editsummAddOptionToDropdown(dropdown,"fixExpanding broken linkarticle");
editsummAddOptionToDropdown(dropdown,"fixAdding/improving casereference(s)");
editsummAddOptionToDropdown(dropdown,"fixAdding/removing grammarcategory/ies");
editsummAddOptionToDropdown(dropdown,"fixAdding/removing punctuationexternal link(s)");
editsummAddOptionToDropdown(dropdown,"fixAdding/removing quote markswikilink(s)");
editsummAddOptionToDropdown(dropdown,"fixRemoving spellingunsourced content");
editsummAddOptionToDropdown(dropdown,"indentClean up");
editsummAddOptionToDropdown(dropdown,"make existing text into linkCopyedit (wikifymajor)");
} else
editsummAddOptionToDropdown(dropdown,"make link into plain text (dewikify)");
{
editsummAddOptionToDropdown(dropdown,"move section");
editsummAddOptionToDropdown(dropdown,"move unrefd material to talk pageReply");
editsummAddOptionToDropdown(dropdown,"new articleComment");
if ((mw.config.get('wgNamespaceNumber') % 2 != 0) & (mw.config.get('wgNamespaceNumber') != 3))
editsummAddOptionToDropdown(dropdown,"remove repetition");
{
editsummAddOptionToDropdown(dropdown,"reorder links");
editsummAddOptionToDropdown(dropdown,"sectioning[[Wikipedia:WikiProject|WikiProject]] tagging");
editsummAddOptionToDropdown(dropdown,"start[[Wikipedia:WikiProject|WikiProject]] articleassessment");
}
}
 
var insertBeforeThis = document.getElementById("wpSummary").nextSibling;
var theParent = insertBeforeThis.parentNode;
theParent.insertBefore(dropdown,insertBeforeThis);
theParent.insertBefore(minorDropdown,insertBeforeThis);
theParent.insertBefore(document.createElement("br"),dropdown);
 
Line 74 ⟶ 84:
var option = document.createElement("option");
option.disabled = "disabled"
var optionTextNode = document.createTextNode(optionTextcatText);
option.appendChild(optionTextNode);
dropdown.appendChild(option);
Line 94 ⟶ 104:
}
 
addOnloadHook$(function (){
editsummInitialize ();