笙默考试管理系统-MyExamTest----codemirror(54)
目录
一、 笙默考试管理系统-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;
????????}
????????this.size = size;
????????this.height = height;
????????this.parent = null;
????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) {
????????????????????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;
????????????}
????????????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);