笙默考试管理系统-MyExamTest----codemirror(59)

2024-01-02 22:57:12

笙默考试管理系统-MyExamTest----codemirror(59

??

目录

一、 笙默考试管理系统-MyExamTest----codemirror

二、 笙默考试管理系统-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

  • 笙默考试管理系统-MyExamTest----codemirror

????// of the textContent, so we strip those.

????if (htmlEscape("a") == "\na")

????????htmlEscape = function(str) {

????????????escapeElement.textContent = str;

????????????return escapeElement.innerHTML.slice(1);

????????};

  • 笙默考试管理系统-MyExamTest----codemirror

????// 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;

????????};

  • 笙默考试管理系统-MyExamTest----codemirror

????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)

  • 笙默考试管理系统-MyExamTest----codemirror

????????????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;

文章来源:https://blog.csdn.net/N201871643/article/details/135350753
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。