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

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

目录

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

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

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

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

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

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

 function setShift(val) {

            if (val) shiftSelecting = shiftSelecting || (sel.inverted ? sel.to : sel.from);

            else shiftSelecting = null;

        }

        function setSelectionUser(from, to) {

            var sh = shiftSelecting && clipPos(shiftSelecting);

            if (sh) {

                if (posLess(sh, from)) from = sh;

                else if (posLess(to, sh)) to = sh;

            }

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

            setSelection(from, to);

            userSelChange = true;

        }

        // Update the selection. Last two args are only used by

        // updateLines, since they have to be expressed in the line

        // numbers before the update.

        function setSelection(from, to, oldFrom, oldTo) {

            goalColumn = null;

            if (oldFrom == null) {oldFrom = sel.from.line; oldTo = sel.to.line;}

            if (posEq(sel.from, from) && posEq(sel.to, to)) return;

            if (posLess(to, from)) {var tmp = to; to = from; from = tmp;}

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

            // Skip over hidden lines.

            if (from.line != oldFrom) from = skipHidden(from, oldFrom, sel.from.ch);

            if (to.line != oldTo) to = skipHidden(to, oldTo, sel.to.ch);

            if (posEq(from, to)) sel.inverted = false;

            else if (posEq(from, sel.to)) sel.inverted = false;

            else if (posEq(to, sel.from)) sel.inverted = true;

            // Some ugly logic used to only mark the lines that actually did

            // see a change in selection as changed, rather than the whole

            // selected range.

            if (posEq(from, to)) {

                if (!posEq(sel.from, sel.to))

                    changes.push({from: oldFrom, to: oldTo + 1});

            }

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

            else if (posEq(sel.from, sel.to)) {

                changes.push({from: from.line, to: to.line + 1});

            }

            else {

                if (!posEq(from, sel.from)) {

                    if (from.line < oldFrom)

                        changes.push({from: from.line, to: Math.min(to.line, oldFrom) + 1});

                    Else

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

                        changes.push({from: oldFrom, to: Math.min(oldTo, from.line) + 1});

                }

你可能感兴趣的:(笙默考试管理系统,javascript,linux,开发语言)