Content deleted Content added
fix |
m Maintenance: Replacing addOnloadHook with native jQuery (mw:ResourceLoader/Migration_guide_(users)#addOnloadHook - phab:T130879) |
||
(26 intermediate revisions by 2 users not shown) | |||
Line 1:
// The original value of the edit summary field is stored here
var editsummOriginalSummary = new String();
Line 9 ⟶ 8:
{
// Save the original value of the edit summary field
editsummOriginalSummary = document.getElementById("wpSummary")
if(editsummOriginalSummary == null)
{▼
}▼
var insertBeforeThis = document.getElementById("wpSummary").nextSibling;▼
if(insertBeforeThis.className != "editCheckboxes")
}
editsummOriginalSummary = editsummOriginalSummary.value
// For convenience, add a dropdown box with some canned edit
// summaries to the form.
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");
editsummAddOptionToDropdown(dropdown,"Choose a Default Edit Summary");▼
minorDropdown.style.width = "38%";
minorDropdown.onchange = new Function("editsummOnCannedSummarySelected()");
editsummAddCatToDropdown(minorDropdown,"Common minor edit summaries - click to use");
editsummAddOptionToDropdown(
editsummAddOptionToDropdown(
editsummAddOptionToDropdown(
editsummAddOptionToDropdown(
editsummAddOptionToDropdown(
if (mw.config.get('wgNamespaceNumber') == 0)
{
editsummAddOptionToDropdown(dropdown,"
editsummAddOptionToDropdown(dropdown,"
editsummAddOptionToDropdown(dropdown,"
editsummAddOptionToDropdown(dropdown,"
editsummAddOptionToDropdown(dropdown,"
editsummAddOptionToDropdown(dropdown,"
editsummAddOptionToDropdown(dropdown,"
editsummAddOptionToDropdown(dropdown,"
} else
{▼
editsummAddOptionToDropdown(dropdown,"
editsummAddOptionToDropdown(dropdown,"
if ((mw.config.get('wgNamespaceNumber') % 2 != 0) & (mw.config.get('wgNamespaceNumber') != 3))
{
editsummAddOptionToDropdown(dropdown,"
▲ editsummAddOptionToDropdown(dropdown,"
}▼
}
▲ var insertBeforeThis = document.getElementById("wpSummary").nextSibling;
var theParent = insertBeforeThis.parentNode;
theParent.insertBefore(dropdown,insertBeforeThis);
theParent.insertBefore(
theParent.insertBefore(document.createElement("br"),dropdown);
// Store a global ref to it
Line 61 ⟶ 76:
var option = document.createElement("option");
var optionTextNode = document.createTextNode(optionText);
option.appendChild(optionTextNode);
dropdown.appendChild(option);
}
function editsummAddCatToDropdown(dropdown,catText)
{
var option = document.createElement("option");
option.disabled = "disabled"
var optionTextNode = document.createTextNode(catText);
option.appendChild(optionTextNode);
dropdown.appendChild(option);
Line 80 ⟶ 104:
}
▲{
▲ {
▲ {
▲ {
▲ }
▲ }
▲}
▲addOnloadHook(function (){
editsummInitialize ();
|