User:PleaseStand/segregate-refs-dev.js: Difference between revisions

Content deleted Content added
m spaces-to-tabs conversion using `unexpand --first-only -t4`
m window.document is silly. We should be able to assume a sane browser environment.
Line 105:
// since MediaWiki/PHP supports many different HTML entities.
// (Note: innerHTML is not W3C-standard)
var d = window.document.createElement("div");
d.innerHTML = "<input value=" + t + "></input>";
return d.firstChild.value;
Line 515:
// Inline refs header
refsH2 = window.document.createElement("h2");
refsH2.appendChild(window.document.createTextNode(messages.refsHeader));
refsH2.style.borderColor = "silver";
Line 529:
// Inline refs textbox
refsTextbox = window.document.createElement("textarea");
refsTextbox.id = "PsRefsTextbox";
if(!complete) {
Line 599:
// Inline refs header
refsH2 = window.document.createElement("h2");
refsH2.appendChild(window.document.createTextNode(messages.convertHeader));
refsH2.style.borderColor = "silver";
Line 615:
if(!refsTextbox) {
// Does not exist; creating
refsTextbox = window.document.createElement("textarea");
refsTextbox.id = "PsRefsTextbox";
refsTextbox.value = messages.refsCommentComplete +
Line 638:
// Set a default edit summary.
window.document.getElementById("wpSummary").value = messages.convertSummary;
// Show the further instructions.
Line 678:
// Only activate on edit pages (that are not section edit pages)
if(!window.document.getElementById("editform") ||
window.document.getElementById("editform").wpSection.value.length) {
return;
}
// Get the edit form
editForm = window.document.getElementById("editform");
// Get the edit box
mainTextbox = window.document.getElementById("wpTextbox1");
// Make the "segregate" button
refsButton = window.document.createElement("input");
refsButton.type = "button";
refsButton.value = messages.buttonText;
Line 696:
// Make the "convert" button
convertButton = window.document.createElement("input");
convertButton.type = "button";
convertButton.value = messages.buttonConvertText;
Line 708:
// Add the refs div
refsDiv = window.document.createElement("div");
refsDiv.appendChild(refsButton);
refsDiv.appendChild(convertButton);