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

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

目录

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

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

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

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

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

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

        return chunk.lines[n];

    }

    

    History.prototype = {

        addChange: function(start, added, old) {

            this.undone.length = 0;

            var time = +new Date, last = this.done[this.done.length - 1];

            if (time - this.time > 400 || !last ||

                last.start > start + added || last.start + last.added < start - last.added + last.old.length)

                this.done.push({start: start, added: added, old: old});

            else {

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

                var oldoff = 0;

                if (start < last.start) {

                    for (var i = last.start - start - 1; i >= 0; --i)

                        last.old.unshift(old[i]);

                    last.added += last.start - start;

                    last.start = start;

                }

                else if (last.start < start) {

                    oldoff = start - last.start;

                    added += oldoff;

                }

                for (var i = last.added - oldoff, e = old.length; i < e; ++i)

                    last.old.push(old[i]);

                if (last.added < added) last.added = added;

            }

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

            this.time = time;

        }

    };

    function stopMethod() {e_stop(this);}

    // Ensure an event has a stop method.

    function addStop(event) {

        if (!event.stop) event.stop = stopMethod;

        return event;

    }

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

    function e_preventDefault(e) {

        if (e.preventDefault) e.preventDefault();

        else e.returnValue = false;

    }

    function e_stopPropagation(e) {

        if (e.stopPropagation) e.stopPropagation();

        else e.cancelBubble = true;

    }

    function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}

    CodeMirror.e_stop = e_stop;

    CodeMirror.e_preventDefault = e_preventDefault;

    CodeMirror.e_stopPropagation = e_stopPropagation;

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

    function e_target(e) {return e.target || e.srcElement;}

    function e_button(e) {

        if (e.which) return e.which;

        else if (e.button & 1) return 1;

        else if (e.button & 2) return 3;

        else if (e.button & 4) return 2;

    }

    // Event handler registration. If disconnect is true, it'll return a

    // function that unregisters the handler.

    function connect(node, type, handler, disconnect) {

        if (typeof node.addEventListener == "function") {

            node.addEventListener(type, handler, false);

            if (disconnect) return function() {node.removeEventListener(type, handler, false);};

        }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

N201871643

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值