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


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

    目录

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

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

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

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

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

    • 笙默考试管理系统-MyExamTest

     },

            isDead: function() { return this.from != null && this.to != null && this.from >= this.to; },

            sameSet: function(x) { return this.set == x.set; }

        };

        function Bookmark(pos) {

            this.from = pos; this.to = pos; this.line = null;

    }

    • 笙默考试管理系统-MyExamTest

        Bookmark.prototype = {

            attach: function(line) { this.line = line; },

            detach: function(line) { if (this.line == line) this.line = null; },

            split: function(pos, lenBefore) {

                if (pos < this.from) {

                    this.from = this.to = (this.from - pos) + lenBefore;

                    return this;

                }

            },

            isDead: function() { return this.from > this.to; },

            clipTo: function(fromOpen, from, toOpen, to, diff) {

                if ((fromOpen || from < this.from) && (toOpen || to > this.to)) {

                    this.from = 0; this.to = -1;

                } else if (this.from > from) {

                    this.from = this.to = Math.max(to, this.from) + diff;

                }

            },

            sameSet: function(x) { return false; },

            find: function() {

                if (!this.line || !this.line.parent) return null;

                return {line: lineNo(this.line), ch: this.from};

            },

    • 笙默考试管理系统-MyExamTest

            clear: function() {

                if (this.line) {

                    var found = indexOf(this.line.marked, this);

                    if (found != -1) this.line.marked.splice(found, 1);

                    this.line = null;

                }

            }

        };

    • 笙默考试管理系统-MyExamTest

        // Line objects. These hold state related to a line, including

        // highlighting info (the styles array).

        function Line(text, styles) {

            this.styles = styles || [text, null];

            this.text = text;

            this.height = 1;

            this.marked = this.gutterMarker = this.className = this.handlers = null;

            this.stateAfter = this.parent = this.hidden = null;

        }

        Line.inheritMarks = function(text, orig) {

            var ln = new Line(text), mk = orig && orig.marked;

            if (mk) {

                for (var i = 0; i < mk.length; ++i) {

                    if (mk[i].to == null && mk[i].style) {

                        var newmk = ln.marked || (ln.marked = []), mark = mk[i];

                        var nmark = mark.dup(); newmk.push(nmark); nmark.attach(ln);

                    }

                }

            }

            return ln;

    }

    • 笙默考试管理系统-MyExamTest

        Line.prototype = {

            // Replace a piece of a line, keeping the styles around it intact.

            replace: function(from, to_, text) {

                var st = [], mk = this.marked, to = to_ == null ? this.text.length : to_;

                copyStyles(0, from, this.styles, st);

                if (text) st.push(text, null);

                copyStyles(to, this.text.length, this.styles, st);

                this.styles = st;

                this.text = this.text.slice(0, from) + text + this.text.slice(to);

                this.stateAfter = null;

                if (mk) {

                    var diff = text.length - (to - from);

                    for (var i = 0, mark = mk[i]; i < mk.length; ++i) {

                        mark.clipTo(from == null, from || 0, to_ == null, to, diff);

                        if (mark.isDead()) {mark.detach(this); mk.splice(i--, 1);}

                    }

  • 相关阅读:
    WPF ListCollectionView排序、过滤和分组
    java成员等讲解
    大学生个人网页模板 简单网页制作作业成品 极简风格个人介绍HTML网页设计(舞蹈培训网页)
    python+vue+elementui实验室课程在线答疑系统php_java
    [python]basemap后安装后hello world代码
    C# Unity FSM 状态机
    超详细全面 spring 复习总结笔记
    java----IO流:字符流
    企业公司项目开发好一部分基础功能,重要的事保存到线上第一a
    小程序 语音搜索功能,语音识别翻译成文本进行搜索
  • 原文地址:https://blog.csdn.net/N201871643/article/details/133880749