当前位置: 首页 > news >正文

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

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

目录

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

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

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

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

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

  • 笙默考试管理系统-MyExamTest

  return {start: stream.start,

                end: stream.pos,

                string: stream.current(),

                className: style || null,

                state: state};

        },

        indentation: function(tabSize) {return countColumn(this.text, null, tabSize);},

        // Produces an HTML fragment for the line, taking selection,

        // marking, and highlighting into account.

        getHTML: function(sfrom, sto, includePre, tabText, endAt) {

            var html = [], first = true;

            if (includePre)

  • 笙默考试管理系统-MyExamTest

                html.push(this.className ? '<pre class="' + this.className + '">': "<pre>");

            function span(text, style) {

                if (!text) return;

                // Work around a bug where, in some compat modes, IE ignores leading spaces

                if (first && ie && text.charAt(0) == " ") text = "\u00a0" + text.slice(1);

                first = false;

                if (style) html.push('<span class="', style, '">', htmlEscape(text).replace(/\t/g, tabText), "</span>");

                else html.push(htmlEscape(text).replace(/\t/g, tabText));

            }

  • 笙默考试管理系统-MyExamTest

            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);

  • 笙默考试管理系统-MyExamTest

            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);

                }

            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

                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);

                        }

                    }

                    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);

                        }

                    }

http://www.lryc.cn/news/197800.html

相关文章:

  • MMKV(2)
  • Spring Boot项目中使用 TrueLicense 生成和验证License(附源码)
  • ES6 Iterator 和 for...of 循环
  • ubuntu20.04 nvidia显卡驱动掉了,变成开源驱动,在软件与更新里选择专有驱动,下载出错,调整ubuntu镜像源之后成功修复
  • 华为FAT模式无线AP配置实例
  • nodejs基于vue 学生论坛设计与实现
  • 017 基于Spring Boot的食堂管理系统
  • 常用的二十种设计模式(下)-C++
  • C#桶排序算法
  • 快速了解服务器单CPU与双CPU
  • c# Dictionary、ConcurrentDictionary的使用
  • 大数据中间件——Kafka
  • HarmonyOS/OpenHarmony原生应用-ArkTS万能卡片组件Slider
  • SpringCloud: sentinel链路限流
  • UML 中的关系
  • ChatGPT技术或加剧钓鱼邮件攻击
  • 哨兵1号后向散射系数土壤水分反演
  • day3:Node.js 基础知识
  • 【RDMA】librdmacm库和连接建立过程
  • 如何使用Python抓取PDF文件并自动下载到本地
  • 人脸写真FaceChain的简单部署记录(一)
  • linux虚机新增加磁盘后在系统中查不到
  • js中隐式类型转换与toPrimitive
  • 家政系统预约小程序具备哪些功能?
  • 【LeetCode】46. 全排列
  • 宏电股份RedCap产品亮相迪拜华为MBBF,并参与RedCap全球商用阶段性成果发布
  • Harris图像角点检测
  • 互联网Java工程师面试题·Java 总结篇·第七弹
  • UVa658 It’s not a Bug, it’s a Feature!(Dijkstra)
  • Object 类常用方法