笙默考试管理系统-MyExamTest----codemirror(18)
目录
一、 笙默考试管理系统-MyExamTest----codemirror
二、 笙默考试管理系统-MyExamTest----codemirror
三、 笙默考试管理系统-MyExamTest----codemirror
四、 笙默考试管理系统-MyExamTest----codemirror
五、 笙默考试管理系统-MyExamTest----codemirror
intact = intact2;
}
return intact;
}
function patchDisplay(from, to, intact) {
// The first pass removes the DOM nodes that aren't intact.
if (!intact.length) lineDiv.innerHTML = "";
else {
function killNode(node) {
var tmp = node.nextSibling;
node.parentNode.removeChild(node);
return tmp;
}
var domPos = 0, curNode = lineDiv.firstChild, n;
for (var i = 0; i < intact.length; ++i) {
var cur = intact[i];
while (cur.domStart > domPos) {curNode = killNode(curNode); domPos++;}
for (var j = 0, e = cur.to - cur.from; j < e; ++j) {curNode = curNode.nextSibling; domPos++;}
}
while (curNode) curNode = killNode(curNode);
}
// This pass fills in the lines that actually changed.
var nextIntact = intact.shift(), curNode = lineDiv.firstChild, j = from;
var sfrom = sel.from.line, sto = sel.to.line, inSel = sfrom < from && sto >= from;
var scratch = targetDocument.createElement("div"), newElt;
doc.iter(from, to, function(line) {
var ch1 = null, ch2 = null;
if (inSel) {
ch1 = 0;
if (sto == j) {inSel = false; ch2 = sel.to.ch;}
} else if (sfrom == j) {
if (sto == j) {ch1 = sel.from.ch; ch2 = sel.to.ch;}
else {inSel = true; ch1 = sel.from.ch;}
}
if (nextIntact && nextIntact.to == j) nextIntact = intact.shift();
if (!nextIntact || nextIntact.from > j) {
if (line.hidden) scratch.innerHTML = "";
else scratch.innerHTML = line.getHTML(ch1, ch2, true, tabText);
lineDiv.insertBefore(scratch.firstChild, curNode);
} else {
curNode = curNode.nextSibling;
}