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

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

目录

[一、 笙默考试管理系统-MyExamTest](#一、 笙默考试管理系统-MyExamTest)

[二、 笙默考试管理系统-MyExamTest](#二、 笙默考试管理系统-MyExamTest)

[三、 笙默考试管理系统-MyExamTest](#三、 笙默考试管理系统-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;

}

}

相关推荐
EveryPossible7 分钟前
静态箭头连线
开发语言·javascript·ecmascript
伍哥的传说8 分钟前
QRCode React 完全指南:现代化二维码生成解决方案
前端·javascript·react.js·qrcode.react·react二维码生成·qrcodesvg·qrcodecanvas
IT_陈寒13 分钟前
Vite 5.0 终极优化指南:7个配置技巧让你的构建速度提升200%
前端·人工智能·后端
listhi52017 分钟前
Map对象在JavaScript循环中的使用
开发语言·前端·javascript
安卓开发者24 分钟前
鸿蒙Next Web组件生命周期详解:从加载到销毁的全流程掌控
前端
卓码软件测评3 小时前
第三方软件测试机构【性能测试工具用LoadRunner还是JMeter?】
java·功能测试·测试工具·jmeter·性能优化
我叫汪枫3 小时前
前端物理引擎库推荐 - 让你的网页动起来!
前端
Lionel_SSL6 小时前
《深入理解Java虚拟机》第三章读书笔记:垃圾回收机制与内存管理
java·开发语言·jvm
记得开心一点嘛6 小时前
手搓Springboot
java·spring boot·spring
老华带你飞7 小时前
租房平台|租房管理平台小程序系统|基于java的租房系统 设计与实现(源码+数据库+文档)
java·数据库·小程序·vue·论文·毕设·租房系统管理平台