笙默考试管理系统-MyExamTest----codemirror(42)
目录
一、 笙默考试管理系统-MyExamTest----codemirror
二、 笙默考试管理系统-MyExamTest----codemirror
三、 笙默考试管理系统-MyExamTest----codemirror
四、 笙默考试管理系统-MyExamTest----codemirror
五、 笙默考试管理系统-MyExamTest----codemirror
function Bookmark(pos) {
this.from = pos; this.to = pos; this.line = null;
}
Bookmark.prototype = {
attach: function(line) { this.line = line; },
detach: function(line) { if (this.line == line) this.line = null; },
split: function(pos, lenBefore) {
if (pos < this.from) {
this.from = this.to = (this.from - pos) + lenBefore;
return this;
}
},
isDead: function() { return this.from > this.to; },
clipTo: function(fromOpen, from, toOpen, to, diff) {
if ((fromOpen || from < this.from) && (toOpen || to > this.to)) {
this.from = 0; this.to = -1;
} else if (this.from > from) {
this.from = this.to = Math.max(to, this.from) + diff;
}
},
sameSet: function(x) { return false; },
find: function() {
if (!this.line || !this.line.parent) return null;
return {line: lineNo(this.line), ch: this.from};
},
clear: function() {
if (this.line) {
var found = indexOf(this.line.marked, this);
if (found != -1) this.line.marked.splice(found, 1);
this.line = null;
}
}
}; function Bookmark(pos) {
this.from = pos; this.to = pos; this.line = null;
}
Bookmark.prototype = {
attach: function(line) { this.line = line; },
detach: function(line) { if (this.line == line) this.line = null; },
split: function(pos, lenBefore) {
if (pos < this.from) {
this.from = this.to = (this.from - pos) + lenBefore;
return this;
}
},
isDead: function() { return this.from > this.to; },
clipTo: function(fromOpen, from, toOpen, to, diff) {
if ((fromOpen || from < this.from) && (toOpen || to > this.to)) {
this.from = 0; this.to = -1;
} else if (this.from > from) {
this.from = this.to = Math.max(to, this.from) + diff;
}
},
sameSet: function(x) { return false; },
find: function() {
if (!this.line || !this.line.parent) return null;
return {line: lineNo(this.line), ch: this.from};
},
clear: function() {
if (this.line) {
var found = indexOf(this.line.marked, this);
if (found != -1) this.line.marked.splice(found, 1);
this.line = null;
}
}
};