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

  • 相关阅读:
    专题四:指令
    [博士后申请]套磁信的五大误区
    网络安全-Diffie Hellman密钥协商
    企业级自定义表单引擎解决方案(十四)--表单模板2
    【源码+名师讲解】Java游戏开发_Java飞机大战1.0进阶版_Java28个功能点能力提升必备_Java初级项目_Java练手项目_Java课程设计
    企业电子招标采购系统源码Spring Boot + Mybatis + Redis + Layui + 前后端分离 构建企业电子招采平台之立项流程图
    什么是整体设备效率(OEE)?
    【无标题】
    Redis面试题(四)
    LabVIEW操作系列
  • 原文地址:https://blog.csdn.net/N201871643/article/details/133880593