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

Content deleted Content added
remove getEditboxContents function; all Global Search results are copies of this script
add refsDiv directly under #editform, not within .wikiEditor-ui (fixes overlap issue)
 
Line 609:
refsDiv.appendChild(refsButton);
refsDiv.appendChild(convertButton);
// Find position within the edit form to insert it at
mainTextbox.parentNode.insertBefore(refsDiv, mainTextbox.nextSibling);
var refsDivPos = mainTextbox, refsDivPosParent = refsDivPos.parentNode;
while (refsDivPosParent !== editForm) {
refsDivPos = refsDivPosParent;
refsDivPosParent = refsDivPos.parentNode;
if (!refsDivPosParent) {
refsDivPos = mainTextbox;
refsDivPosParent = refsDivPos.parentNode;
break;
}
}
refsDivPos = refsDivPos.nextSibling;
if (refsDivPos && refsDivPos.classList.contains("wikiEditor-ui-clear")) {
refsDivPos = refsDivPos.nextSibling;
}
refsDivPosParent.insertBefore(refsDiv, refsDivPos);
} catch(e) {
}