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

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

目录

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

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

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

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

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

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

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

 }

            var hlEnd = from.line + Math.min(newText.length, 500);

            highlightLines(from.line, hlEnd);

            newWork.push(hlEnd);

            work = newWork;

            startWorker(100);

            // Remember that these lines changed, for updating the display

            changes.push({from: from.line, to: to.line + 1, diff: lendiff});

            var changeObj = {from: from, to: to, text: newText};

            if (textChanged) {

                for (var cur = textChanged; cur.next; cur = cur.next) {}

                cur.next = changeObj;

            } else textChanged = changeObj;

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

            // Update the selection

            function updateLine(n) {return n <= Math.min(to.line, to.line + lendiff) ? n : n + lendiff;}

            setSelection(selFrom, selTo, updateLine(sel.from.line), updateLine(sel.to.line));

            // Make sure the scroll-size div has the correct height.

            code.style.height = (doc.height * textHeight() + 2 * paddingTop()) + "px";

        }

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

        function replaceRange(code, from, to) {

            from = clipPos(from);

            if (!to) to = from; else to = clipPos(to);

            code = splitLines(code);

            function adjustPos(pos) {

                if (posLess(pos, from)) return pos;

                if (!posLess(to, pos)) return end;

                var line = pos.line + code.length - (to.line - from.line) - 1;

                var ch = pos.ch;

                if (pos.line == to.line)

                    ch += code[code.length-1].length - (to.ch - (to.line == from.line ? from.ch : 0));

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

                return {line: line, ch: ch};

            }

            var end;

            replaceRange1(code, from, to, function(end1) {

                end = end1;

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

                return {from: adjustPos(sel.from), to: adjustPos(sel.to)};

            });

            return end;

        }

你可能感兴趣的:(笙默考试管理系统,javascript,前端,开发语言)