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

  • 相关阅读:
    海外动态IP代理可以用来批量注册邮箱吗?
    使用Dokcer中的Mysql导入sql文件
    WPF如何实现应用程序托盘
    实战:使用Dockerfile创建镜像
    java datetime数据类型去掉时分秒
    Google play 应用下架、封号常见原因:8.3/10.3分发协议及恶意软件政策问题浅析
    动态规划之-----年终奖
    【Linux】Linux服务器防火墙架构简介
    java计算机毕业设计家乡旅游文化推广网站MyBatis+系统+LW文档+源码+调试部署
    旧物回收小程序开发,开启绿色生活新篇章
  • 原文地址:https://blog.csdn.net/N201871643/article/details/132995065