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


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

    目录

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

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

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

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

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

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

    • 笙默考试管理系统-MyExamTest

     function setBookmark(pos) {

                pos = clipPos(pos);

                var bm = new Bookmark(pos.ch);

                getLine(pos.line).addMark(bm);

                return bm;

            }

            function addGutterMarker(line, text, className) {

                if (typeof line == "number") line = getLine(clipLine(line));

                line.gutterMarker = {text: text, style: className};

                gutterDirty = true;

                return line;

            }

    • 笙默考试管理系统-MyExamTest

            function removeGutterMarker(line) {

                if (typeof line == "number") line = getLine(clipLine(line));

                line.gutterMarker = null;

                gutterDirty = true;

            }

            function changeLine(handle, op) {

                var no = handle, line = handle;

                if (typeof handle == "number") line = getLine(clipLine(handle));

                else no = lineNo(handle);

                if (no == null) return null;

                if (op(line, no)) changes.push({from: no, to: no + 1});

                else return null;

                return line;

            }

    • 笙默考试管理系统-MyExamTest

            function setLineClass(handle, className) {

                return changeLine(handle, function(line) {

                    if (line.className != className) {

                        line.className = className;

                        return true;

                    }

                });

            }

    • 笙默考试管理系统-MyExamTest

            function setLineHidden(handle, hidden) {

                return changeLine(handle, function(line, no) {

                    if (line.hidden != hidden) {

                        line.hidden = hidden;

                        updateLineHeight(line, hidden ? 0 : 1);

                        if (hidden && (sel.from.line == no || sel.to.line == no))

                            setSelection(skipHidden(sel.from, sel.from.line, sel.from.ch),

                                skipHidden(sel.to, sel.to.line, sel.to.ch));

                        return (gutterDirty = true);

                    }

                });

            }

            function lineInfo(line) {

                if (typeof line == "number") {

                    if (!isLine(line)) return null;

                    var n = line;

                    line = getLine(line);

                    if (!line) return null;

                }

    • 笙默考试管理系统-MyExamTest

                else {

                    var n = lineNo(line);

                    if (n == null) return null;

                }

                var marker = line.gutterMarker;

                return {line: n, handle: line, text: line.text, markerText: marker && marker.text,

                    markerClass: marker && marker.style, lineClass: line.className};

            }

            function stringWidth(str) {

                measure.innerHTML = "

    x
    ";

                measure.firstChild.firstChild.firstChild.nodeValue = str;

                return measure.firstChild.firstChild.offsetWidth || 10;

            }

            // These are used to go from pixel positions to character

            // positions, taking varying character widths into account.

            function charFromX(line, x) {

                if (x <= 0) return 0;

                var lineObj = getLine(line), text = lineObj.text;

                function getX(len) {

                    measure.innerHTML = "

    " + lineObj.getHTML(null, null, false, tabText, len) + "
    ";

                    return measure.firstChild.firstChild.offsetWidth;

                }

                var from = 0, fromX = 0, to = text.length, toX;

                // Guess a suitable upper bound for our search.

                var estimated = Math.min(to, Math.ceil(x / charWidth()));

                for (;;) {

                    var estX = getX(estimated);

                    if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));

                    else {toX = estX; to = estimated; break;}

  • 相关阅读:
    研究生常用工具
    Android存储:轻松掌握MMKV
    强化学习调度环境:析取图和离散事件仿真
    【数据结构】ArrayList与顺序表
    Visual Studio 2022 + OpenCV 4.5.2 安装与配置教程
    【PAT甲级】1119 Pre- and Post-order Traversals
    【HALCON】如何实现hw窗口自适应相机拍照成像的大小
    C++命名空间知识点总结
    前端面试的话术集锦第 7 篇:高频考点(浏览器渲染原理 & 安全防范)
    Kafka磁盘写满日志清理操作
  • 原文地址:https://blog.csdn.net/N201871643/article/details/132995065