笙默考试管理系统-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;

}

}

相关推荐
声声codeGrandMaster19 分钟前
Django框架的前端部分使用Ajax请求一
前端·后端·python·ajax·django
sunbyte27 分钟前
50天50个小项目 (Vue3 + Tailwindcss V4) ✨ | Expanding Cards (展开式卡片)
javascript·vue.js·ecmascript
肠胃炎30 分钟前
React Contxt详解
javascript·react.js·ecmascript
会飞的架狗师34 分钟前
【Spring Cloud Gateway】Nacos整合遇坑记:503 Service Unavailable
java·开发语言
xx240641 分钟前
React Native简介
javascript·react native·react.js
重生之后端学习2 小时前
02-前端Web开发(JS+Vue+Ajax)
java·开发语言·前端·javascript·vue.js
布鲁斯的快乐小屋2 小时前
axios的基本使用
javascript·ajax
繁依Fanyi3 小时前
用 CodeBuddy 实现「IdeaSpark 每日灵感卡」:一场 UI 与灵感的极简之旅
开发语言·前端·游戏·ui·编辑器·codebuddy首席试玩官
来自星星的坤5 小时前
【Vue 3 + Vue Router 4】如何正确重置路由实例(resetRouter)——避免“VueRouter is not defined”错误
前端·javascript·vue.js
字节源流8 小时前
关于maven的依赖下不下来的问题
java·maven