笙默考试管理系统-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.childreni, 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.childreni, 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.childreni, sz = child.chunkSize();

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

n -= sz;

}

}

相关推荐
掘金挖土14 分钟前
前端手摸手跑路之 AI 应用开发(二)
前端·后端
兜里只有三分钱~22 分钟前
翻卡_3D 的仪式感,和三个让它穿帮的写法
javascript·css·3d
Wang's Blog36 分钟前
Java框架快速入门: Spring Security+OAuth2之过滤器与过滤器链
java·开发语言·spring
mayaairi1 小时前
Vue2 组件通讯(四):v-model、scoped样式、mixins与plugins
前端·javascript·vue.js
谢尔登1 小时前
01_Java基础速通
java·开发语言
梦曦i1 小时前
@meng-xi/uni-router 未来展望:夯实基础、深化体验、探索前沿
前端·uni-app
前端炒粉1 小时前
DOM 常用 API 速查表
开发语言·javascript·ecmascript
Yeyu1 小时前
AAOS AppCard 实践:怎么把自己的 App 塞进别人的卡片里
前端
星云API技术支持1 小时前
企业微信二次开发:如何建立统一的错误处理、日志与请求追踪机制
javascript·企业微信·ruby
lemon_sjdk2 小时前
javafx-Image图像(2)
java·javafx