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


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

    目录

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

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

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

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

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

    • 笙默考试管理系统-MyExamTest

     collapse: function(lines) {

                lines.splice.apply(lines, [lines.length, 0].concat(this.lines));

            },

            insertHeight: function(at, lines, height) {

                this.height += height;

                this.lines.splice.apply(this.lines, [at, 0].concat(lines));

                for (var i = 0, e = lines.length; i < e; ++i) lines[i].parent = this;

            },

            iterN: function(at, n, op) {

                for (var e = at + n; at < e; ++at)

                    if (op(this.lines[at])) return true;

            }

    };

    • 笙默考试管理系统-MyExamTest

        function BranchChunk(children) {

            this.children = children;

            var size = 0, height = 0;

            for (var i = 0, e = children.length; i < e; ++i) {

                var ch = children[i];

                size += ch.chunkSize(); height += ch.height;

                ch.parent = this;

            }

    • 笙默考试管理系统-MyExamTest

            this.size = size;

            this.height = height;

            this.parent = null;

        }

        BranchChunk.prototype = {

            chunkSize: function() { return this.size; },

            remove: function(at, n, callbacks) {

                this.size -= n;

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

                    var child = this.children[i], sz = child.chunkSize();

                    if (at < sz) {

    • 笙默考试管理系统-MyExamTest

                        var rm = Math.min(n, sz - at), oldHeight = child.height;

                        child.remove(at, rm, callbacks);

                        this.height -= oldHeight - child.height;

                        if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }

                        if ((n -= rm) == 0) break;

                        at = 0;

                    } else at -= sz;

                }

                if (this.size - n < 25) {

                    var lines = [];

                    this.collapse(lines);

                    this.children = [new LeafChunk(lines)];

                }

            },

    • 笙默考试管理系统-MyExamTest

            collapse: function(lines) {

                for (var i = 0, e = this.children.length; i < e; ++i) this.children[i].collapse(lines);

            },

            insert: function(at, lines) {

                var height = 0;

                for (var i = 0, e = lines.length; i < e; ++i) height += lines[i].height;

                this.insertHeight(at, lines, height);

            },

  • 相关阅读:
    【面试经典150 | 数组】多数元素
    【华为OD机试】最长广播效应【2023 B卷|200分】
    【RT-Thread】nxp rt10xx 设备驱动框架之--rtc搭建和使用
    无序链表的归并排序 - Java代码纯享版
    2023.11.10联测总结
    金仓数据库 KingbaseES 插件参考手册 (15. dbms_ddl)
    P3~P6函数模板
    java毕业设计某服装店购物网站源码+lw文档+mybatis+系统+mysql数据库+调试
    【无标题】
    Android发展历程
  • 原文地址:https://blog.csdn.net/N201871643/article/details/133880954