笙默考试管理系统-MyExamTest----codemirror(45)

笙默考试管理系统-MyExamTest----codemirror(44)

目录

笙默考试管理系统-MyExamTest----codemirror(44)

[一、 笙默考试管理系统-MyExamTest----codemirror](#一、 笙默考试管理系统-MyExamTest----codemirror)

[二、 笙默考试管理系统-MyExamTest----codemirror](#二、 笙默考试管理系统-MyExamTest----codemirror)

[三、 笙默考试管理系统-MyExamTest----codemirror](#三、 笙默考试管理系统-MyExamTest----codemirror)

[四、 笙默考试管理系统-MyExamTest----codemirror](#四、 笙默考试管理系统-MyExamTest----codemirror)

[五、 笙默考试管理系统-MyExamTest----codemirror](#五、 笙默考试管理系统-MyExamTest----codemirror)

  • 笙默考试管理系统-MyExamTest----codemirror

}

Line.inheritMarks = function(text, orig) {

var ln = new Line(text), mk = orig && orig.marked;

if (mk) {

for (var i = 0; i < mk.length; ++i) {

if (mk[i].to == null && mk[i].style) {

var newmk = ln.marked || (ln.marked = []), mark = mk[i];

var nmark = mark.dup(); newmk.push(nmark); nmark.attach(ln);

}

}

}

return ln;

}

  • 笙默考试管理系统-MyExamTest----codemirror

Line.prototype = {

// Replace a piece of a line, keeping the styles around it intact.

replace: function(from, to_, text) {

var st = [], mk = this.marked, to = to_ == null ? this.text.length : to_;

copyStyles(0, from, this.styles, st);

if (text) st.push(text, null);

copyStyles(to, this.text.length, this.styles, st);

this.styles = st;

this.text = this.text.slice(0, from) + text + this.text.slice(to);

this.stateAfter = null;

if (mk) {

  • 笙默考试管理系统-MyExamTest----codemirror

var diff = text.length - (to - from);

for (var i = 0, mark = mk[i]; i < mk.length; ++i) {

mark.clipTo(from == null, from || 0, to_ == null, to, diff);

if (mark.isDead()) {mark.detach(this); mk.splice(i--, 1);}

}

}

},

// Split a part off a line, keeping styles and markers intact.

split: function(pos, textBefore) {

var st = [textBefore, null], mk = this.marked;

copyStyles(pos, this.text.length, this.styles, st);

var taken = new Line(textBefore + this.text.slice(pos), st);

if (mk) {

  • 笙默考试管理系统-MyExamTest----codemirror

for (var i = 0; i < mk.length; ++i) {

var mark = mk[i];

var newmark = mark.split(pos, textBefore.length);

if (newmark) {

if (!taken.marked) taken.marked = [];

taken.marked.push(newmark); newmark.attach(taken);

}

}

}

return taken;

},

  • 笙默考试管理系统-MyExamTest----codemirror

append: function(line) {

var mylen = this.text.length, mk = line.marked, mymk = this.marked;

this.text += line.text;

copyStyles(0, line.text.length, line.styles, this.styles);

if (mymk) {

for (var i = 0; i < mymk.length; ++i)

if (mymk[i].to == null) mymk[i].to = mylen;

相关推荐
子午1 天前
Python的uv包管理工具使用
开发语言·python·uv
Aotman_1 天前
el-input textarea 禁止输入中文字符,@input特殊字符实时替换,光标位置保持不变
前端·javascript·vue.js·前端框架·es6
Nan_Shu_6141 天前
Web前端面试题(1)
前端·面试·职场和发展
EveryPossible1 天前
选择数据展示
javascript
lypzcgf1 天前
Coze源码分析-资源库-创建知识库-前端源码-核心组件
前端·typescript·react·coze·coze源码分析·ai应用平台·agent开发平台
HMBBLOVEPDX1 天前
C++(静态函数)
开发语言·c++
百思可瑞教育1 天前
在Vue项目中Axios发起请求时的小知识
前端·javascript·vue.js·北京百思教育
dpxiaolong1 天前
RK3588 Android12默认移除导航栏
开发语言·python
患得患失9491 天前
【个人项目】【前端实用工具】OpenAPI to TypeScript 转换器
前端·javascript·typescript
大前端helloworld1 天前
前端梳理体系从常问问题去完善-基础篇(html,css,js,ts)
前端·javascript·面试