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


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

    目录

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

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

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

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

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

    • 笙默考试管理系统-MyExamTest

     insertHeight: function(at, lines, height) {

                this.size += lines.length;

                this.height += height;

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

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

                    if (at <= sz) {

    • 笙默考试管理系统-MyExamTest

                        child.insertHeight(at, lines, height);

                        if (child.lines && child.lines.length > 50) {

                            while (child.lines.length > 50) {

                                var spilled = child.lines.splice(child.lines.length - 25, 25);

                                var newleaf = new LeafChunk(spilled);

                                child.height -= newleaf.height;

                                this.children.splice(i + 1, 0, newleaf);

                                newleaf.parent = this;

                            }

    • 笙默考试管理系统-MyExamTest

                            this.maybeSpill();

                        }

                        break;

                    }

                    at -= sz;

                }

            },

            maybeSpill: function() {

                if (this.children.length <= 10) return;

                var me = this;

                do {

    • 笙默考试管理系统-MyExamTest

                    var spilled = me.children.splice(me.children.length - 5, 5);

                    var sibling = new BranchChunk(spilled);

                    if (!me.parent) { // Become the parent node

                        var copy = new BranchChunk(me.children);

                        copy.parent = me;

                        me.children = [copy, sibling];

                        me = copy;

                    } else {

                        me.size -= sibling.size;

                        me.height -= sibling.height;

                        var myIndex = indexOf(me.parent.children, me);

                        me.parent.children.splice(myIndex + 1, 0, sibling);

                    }

    • 笙默考试管理系统-MyExamTest

                    sibling.parent = me.parent;

                } while (me.children.length > 10);

                me.parent.maybeSpill();

            },

            iter: function(from, to, op) { this.iterN(from, to - from, op); },

            iterN: function(at, n, op) {

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

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

                    if (at < sz) {

                        var used = Math.min(n, sz - at);

                        if (child.iterN(at, used, op)) return true;

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

                        at = 0;

                    } else at -= sz;

                }

            }

        };

        function getLineAt(chunk, n) {

            while (!chunk.lines) {

                for (var i = 0;; ++i) {

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

                    if (n < sz) { chunk = child; break; }

                    n -= sz;

                }

            }

  • 相关阅读:
    PHP黑魔法之md5绕过
    软件测试(功能、工具、接口、性能、自动化、测开)详解
    腾讯云4核8G云服务器租用价格选轻量还是CVM?性能如何?
    SQLServer和Oracle,存储过程区别,常用函数对比
    ManoMano、eMAG等跨境平台如何实现快速出单?测评自养号助你快速突破!
    MnTTS: 开源蒙古语语音合成数据集及其基线模型
    【Java】Java易丢失的基础知识一
    信贷产品额度定价场景下的回归模型效果评估
    Day42-43
    net-java-php-python-小学随班就读管理系统设计计算机毕业设计程序
  • 原文地址:https://blog.csdn.net/N201871643/article/details/133880975