Content deleted Content added
PleaseStand (talk | contribs) bug fix - don't break "forward/back button compatibility" |
PleaseStand (talk | contribs) Undid revision 356075499 by PleaseStand (talk) - breaks the script |
||
Line 87:
// Semi-global variables (private to this script)
var editForm, refsDiv, refsH2, mainTextbox, refsTextbox, randPrefix, messages,
refsButton, convertButton, complete
// Extend the string object with new methods
Line 424:
}
function
// Local variables
var result, refName, unusedRefNamesQuoted = [];
if(typeof wikEdUseWikEd != "undefined" && wikEdUseWikEd) {▼
}▼
// Do the actual integration work
result = integrateRefs(mainTextbox.value, refsTextbox.value,
randPrefix, complete);
// Find all unused ref names
Line 449 ⟶ 443:
unusedRefNamesQuoted.join(", "))) {
// Don't submit form
return false;
}
Line 456 ⟶ 449:
// Otherwise, update the textbox.
mainTextbox.value = result.wikiText;
// We can delete the header and refs textbox now
Line 470 ⟶ 454:
refsDiv.removeChild(refsTextbox);
// Deactivate this submit handler and run any previously registered handler
editForm.onsubmit = null;
if(typeof editForm.PsOnsubmit == "function") {
editForm.onsubmit = editForm.PsOnsubmit;
editForm.onsubmit.apply(this, arguments);
▲ }
return true;
}
Line 534 ⟶ 524:
// Set up the submit handler (to integrate refs when done editing)
editForm.PsOnsubmit = editForm.onsubmit;
▲ }
editForm.onsubmit = submitHandler;
// Don't submit form
Line 614 ⟶ 606:
function getEditboxContents() { // ajaxPreview compatibility
if(
return integrateRefs(mainTextbox.value, refsTextbox.value,
randPrefix, complete).wikiText;
|