笙默考试管理系统-MyExamTest----codemirror(59)
目录
一、 笙默考试管理系统-MyExamTest----codemirror
二、 笙默考试管理系统-MyExamTest----codemirror
三、 笙默考试管理系统-MyExamTest----codemirror
四、 笙默考试管理系统-MyExamTest----codemirror
五、 笙默考试管理系统-MyExamTest----codemirror
var escapeElement = document.createElement("pre");
function htmlEscape(str) {
escapeElement.textContent = str;
return escapeElement.innerHTML;
}
// Recent (late 2011) Opera betas insert bogus newlines at the start
// of the textContent, so we strip those.
if (htmlEscape("a") == "\na")
htmlEscape = function(str) {
escapeElement.textContent = str;
return escapeElement.innerHTML.slice(1);
};
// Some IEs don't preserve tabs through innerHTML
else if (htmlEscape("\t") != "\t")
htmlEscape = function(str) {
escapeElement.innerHTML = "";
escapeElement.appendChild(document.createTextNode(str));
return escapeElement.innerHTML;
};
CodeMirror.htmlEscape = htmlEscape;
// Used to position the cursor after an undo/redo by finding the
// last edited character.
function editEnd(from, to) {
if (!to) return from ? from.length : 0;
if (!from) return to.length;
for (var i = from.length, j = to.length; i >= 0 && j >= 0; --i, --j)
if (from.charAt(i) != to.charAt(j)) break;
return j + 1;
}
function indexOf(collection, elt) {
if (collection.indexOf) return collection.indexOf(elt);
for (var i = 0, e = collection.length; i < e; ++i)
if (collection[i] == elt) return i;
return -1;
}
function isWordChar(ch) {
return /\w/.test(ch) || ch.toUpperCase() != ch.toLowerCase();
}
// See if "".split is the broken IE version, if so, provide an
// alternative way to split lines.
var splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) {
var pos = 0, nl, result = [];
while ((nl = string.indexOf("\n", pos)) > -1) {
result.push(string.slice(pos, string.charAt(nl-1) == "\r" ? nl - 1 : nl));
pos = nl + 1;