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


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

    目录

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

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

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

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

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

    • 笙默考试管理系统-MyExamTest

     function lookupKey(name, extraMap, map) {

            function lookup(name, map, ft) {

                var found = map[name];

                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() {

                        save();

                        textarea.form.submit = realSubmit;

                        textarea.form.submit();

                        textarea.form.submit = wrappedSubmit;

                    }

    • 笙默考试管理系统-MyExamTest

                    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;

                }

            };

    • 笙默考试管理系统-MyExamTest

            return instance;

        };

        // 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 = {};

    • 笙默考试管理系统-MyExamTest

            for (var n in state) {

                var val = state[n];

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

                nstate[n] = val;

            }

            return nstate;

        }

  • 相关阅读:
    齐岳发蓝光水溶性ZnCdS/ZnS量子点,波长400nm-480nm
    考研二战失败找工作心路历程
    Django测试环境搭建及ORM查询(创建外键|夸表查询|双下划线查询)
    c语言分层理解(动态通讯录的实现)
    umich cv-4-2 经典卷积网络架构
    2_JavaScript面试题
    车载-QNX渲染
    智能运维应用之道,告别企业数字化转型危机
    OpenCV(三十一):形态学操作
    『可道云』内网穿透牛刀小试,会敲键盘就能搭建的私有云网盘
  • 原文地址:https://blog.csdn.net/N201871643/article/details/133977205