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

}

}

相关推荐
Bat U10 分钟前
JavaEE|多线程初阶(七)
java·开发语言
里欧跑得慢1 小时前
17. Flutter Hero动画实现:让界面过渡更加优雅
前端·css·flutter·web
IT_陈寒2 小时前
Vue的这个响应式陷阱,我debug了一整天才爬出来
前端·人工智能·后端
cn_mengbei2 小时前
用React Native开发OpenHarmony应用:Reanimated共享元素过渡
javascript·react native·react.js
kyriewen2 小时前
前端测试:别为了100%覆盖率而写测试,那是自欺欺人
前端·javascript·单元测试
去伪存真2 小时前
我自己写的第一个skills--project-core-standards
前端·agent
Data_Journal3 小时前
如何使用cURL更改User Agent
大数据·服务器·前端·javascript·数据库
掌心向暖RPA自动化3 小时前
如何获取网页某个元素在屏幕可见部分的中心坐标影刀RPA懒加载坐标定位技巧
java·javascript·自动化·rpa·影刀rpa
日取其半万世不竭3 小时前
Minecraft Java版社区服务器搭建教程(Linux,适合新手)
java·linux·服务器
竹林8183 小时前
wagmi v2 多链钱包切换:一个 Uniswap 仿盘项目让我踩了三天坑
前端·javascript