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

发布时间:2023年12月25日

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

目录

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

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

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

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

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

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

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----codemirror

????????this.size = size;

????????this.height = height;

????????this.parent = null;

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

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

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

????????????}

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

????????????if (this.size - n < 25) {

????????????????var lines = [];

????????????????this.collapse(lines);

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

????????????}

????????},

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

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