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

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

目录

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

一、 笙默考试管理系统-MyExamTest----codemirror

二、 笙默考试管理系统-MyExamTest----codemirror

三、 笙默考试管理系统-MyExamTest----codemirror

四、 笙默考试管理系统-MyExamTest----codemirror

五、 笙默考试管理系统-MyExamTest----codemirror

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

  var st = this.styles, allText = this.text, marked = this.marked;

            if (sfrom == sto) sfrom = null;

            var len = allText.length;

            if (endAt != null) len = Math.min(endAt, len);

            if (!allText && endAt == null)

                span(" ", sfrom != null && sto == null ? "CodeMirror-selected" : null);

            else if (!marked && sfrom == null)

                for (var i = 0, ch = 0; ch < len; i+=2) {

                    var str = st[i], style = st[i+1], l = str.length;

                    if (ch + l > len) str = str.slice(0, len - ch);

                    ch += l;

                    span(str, style && "cm-" + style);

                }

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

            else {

                var pos = 0, i = 0, text = "", style, sg = 0;

                var markpos = -1, mark = null;

                function nextMark() {

                    if (marked) {

                        markpos += 1;

                        mark = (markpos < marked.length) ? marked[markpos] : null;

                    }

                }

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

                nextMark();

                while (pos < len) {

                    var upto = len;

                    var extraStyle = "";

                    if (sfrom != null) {

                        if (sfrom > pos) upto = sfrom;

                        else if (sto == null || sto > pos) {

                            extraStyle = " CodeMirror-selected";

                            if (sto != null) upto = Math.min(upto, sto);

                        }

                    }

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

                    while (mark && mark.to != null && mark.to <= pos) nextMark();

                    if (mark) {

                        if (mark.from > pos) upto = Math.min(upto, mark.from);

                        else {

                            extraStyle += " " + mark.style;

                            if (mark.to != null) upto = Math.min(upto, mark.to);

                        }

                    }

                    for (;;) {

                        var end = pos + text.length;

                        var appliedStyle = style;

                        if (extraStyle) appliedStyle = style ? style + extraStyle : extraStyle;

                        span(end > upto ? text.slice(0, upto - pos) : text, appliedStyle);

                        if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}

                        pos = end;

                        text = st[i++]; style = "cm-" + st[i++];

                    }

                }

                if (sfrom != null && sto == null) span(" ", "CodeMirror-selected");

            }

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

            if (includePre) html.push("</pre>");

            return html.join("");

        },

        cleanUp: function() {

            this.parent = null;

            if (this.marked)

                for (var i = 0, e = this.marked.length; i < e; ++i) this.marked[i].detach(this);

        }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

N201871643

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值