• 笙默考试管理系统-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;}

  • 相关阅读:
    js中scrollIntoView第一次不生效,第二次生效
    卡码网语言基础课 |链表的基础操作III
    记 350亿数据从 es 迁移到 ClickHouse 遇到的问题
    Linux修改ssh端口
    做软件测试一定要注意的细节
    企业移动设备邮箱管理
    FPGA高端项目:图像缩放+GTX+UDP架构,高速接口以太网视频传输,提供2套工程源码加QT上位机源码和技术支持
    扩散模型的极简介绍
    《Python+Kivy(App开发)从入门到实践》自学笔记:高级UX部件——知识点总览
    如何用Jmeter编写脚本压测?
  • 原文地址:https://blog.csdn.net/N201871643/article/details/132995065