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


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

    目录

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

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

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

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

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

    • 笙默考试管理系统-MyExamTest

      if (found != null) return found;

                if (ft == null) ft = map.fallthrough;

                if (ft == null) return map.catchall;

                if (typeof ft == "string") return lookup(name, keyMap[ft]);

                for (var i = 0, e = ft.length; i < e; ++i) {

                    found = lookup(name, keyMap[ft[i]]);

                    if (found != null) return found;

                }

                return null;

            }

            return extraMap ? lookup(name, extraMap, map) : lookup(name, keyMap[map]);

        }

        function isModifierKey(event) {

            var name = keyNames[event.keyCode];

            return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod";

        }

    • 笙默考试管理系统-MyExamTest

        CodeMirror.fromTextArea = function(textarea, options) {

            if (!options) options = {};

            options.value = textarea.value;

            if (!options.tabindex && textarea.tabindex)

                options.tabindex = textarea.tabindex;

            function save() {textarea.value = instance.getValue();}

            if (textarea.form) {

                // Deplorable hack to make the submit method do the right thing.

                var rmSubmit = connect(textarea.form, "submit", save, true);

                if (typeof textarea.form.submit == "function") {

                    var realSubmit = textarea.form.submit;

                    function wrappedSubmit() {

    • 笙默考试管理系统-MyExamTest

                        save();

                        textarea.form.submit = realSubmit;

                        textarea.form.submit();

                        textarea.form.submit = wrappedSubmit;

                    }

                    textarea.form.submit = wrappedSubmit;

                }

            }

            textarea.style.display = "none";

            var instance = CodeMirror(function(node) {

                textarea.parentNode.insertBefore(node, textarea.nextSibling);

            }, options);

            instance.save = save;

            instance.getTextArea = function() { return textarea; };

            instance.toTextArea = function() {

                save();

                textarea.parentNode.removeChild(instance.getWrapperElement());

                textarea.style.display = "";

                if (textarea.form) {

                    rmSubmit();

                    if (typeof textarea.form.submit == "function")

                        textarea.form.submit = realSubmit;

                }

            };

            return instance;

        };

    • 笙默考试管理系统-MyExamTest

        // Utility functions for working with state. Exported because modes

        // sometimes need to do this.

        function copyState(mode, state) {

            if (state === true) return state;

            if (mode.copyState) return mode.copyState(state);

            var nstate = {};

            for (var n in state) {

                var val = state[n];

                if (val instanceof Array) val = val.concat([]);

                nstate[n] = val;

            }

            return nstate;

        }

        CodeMirror.copyState = copyState;

        function startState(mode, a1, a2) {

            return mode.startState ? mode.startState(a1, a2) : true;

        }

        CodeMirror.startState = startState;

    • 笙默考试管理系统-MyExamTest

        // The character stream used by a mode's parser.

        function StringStream(string, tabSize) {

            this.pos = this.start = 0;

            this.string = string;

            this.tabSize = tabSize || 8;

        }

        StringStream.prototype = {

            eol: function() {return this.pos >= this.string.length;},

            sol: function() {return this.pos == 0;},

            peek: function() {return this.string.charAt(this.pos);},

            next: function() {

                if (this.pos < this.string.length)

                    return this.string.charAt(this.pos++);

            },

            eat: function(match) {

                var ch = this.string.charAt(this.pos);

                if (typeof match == "string") var ok = ch == match;

                else var ok = ch && (match.test ? match.test(ch) : match(ch));

                if (ok) {++this.pos; return ch;}

            },

            eatWhile: function(match) {

                var start = this.pos;

                while (this.eat(match)){}

                return this.pos > start;

            },

            eatSpace: function() {

                var start = this.pos;

                while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;

                return this.pos > start;

            },

            skipToEnd: function() {this.pos = this.string.length;},

            skipTo: function(ch) {

                var found = this.string.indexOf(ch, this.pos);

                if (found > -1) {this.pos = found; return true;}

  • 相关阅读:
    中央处理器
    WSL VSCode运行C++项目
    【Python】【OpenCV】OCR识别(二)——透视变换
    【JUC系列-10】深入理解ArrayBlockingQueue的底层原理
    数据结构:排序
    设计模式-状态模式在Java中的使用示例-信用卡业务系统
    【css】创建一个带有上矩形和下倒三角角标
    数据分析技能点-机器学习优化思想
    5个高质量的自用原型设计工具分享!
    如何搭建接口自动化测试框架
  • 原文地址:https://blog.csdn.net/N201871643/article/details/133880593