目录
笙默考试管理系统-MyExamTest----codemirror(8)
一、 笙默考试管理系统-MyExamTest----codemirror
二、 笙默考试管理系统-MyExamTest----codemirror
三、 笙默考试管理系统-MyExamTest----codemirror
五、 笙默考试管理系统-MyExamTest----codemirror
// For button 1, if it was clicked inside the editor
// (posFromMouse returning non-null), we have to adjust the
// selection.
if (!start) {if (e_target(e) == scroller) e_preventDefault(e); return;}
if (!focused) onFocus();
var now = +new Date;
if (lastDoubleClick && lastDoubleClick.time > now - 400 && posEq(lastDoubleClick.pos, start)) {
e_preventDefault(e);
setTimeout(focusInput, 20);
return selectLine(start.line);
} else if (lastClick && lastClick.time > now - 400 && posEq(lastClick.pos, start)) {
lastDoubleClick = {time: now, pos: start};
e_preventDefault(e);
return selectWordAt(start);
} else { lastClick = {time: now, pos: start}; }
var last = start, going;
if (dragAndDrop && !posEq(sel.from, sel.to) &&
!posLess(start, sel.from) && !posLess(sel.to, start)) {
// Let the drag handler handle this.
if (webkit) lineSpace.draggable = true;
var up = connect(targetDocument, "mouseup", operation(function(e2) {
if (webkit) lineSpace.draggable = false;
draggingText = false;
up();
if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) {
e_preventDefault(e2);
setCursor(start.line, start.ch, true);
focusInput();
}
}), true);
draggingText = true;
return;
}
e_preventDefault(e);
setCursor(start.line, start.ch, true);
function extend(e) {
var cur = posFromMouse(e, true);
if (cur && !posEq(cur, last)) {
if (!focused) onFocus();
last = cur;
setSelectionUser(start, cur);
updateInput = false;
var visible = visibleLines();
if (cur.line >= visible.to || cur.line < visible.from)
going = setTimeout(operation(function(){extend(e);}), 150);
}
}
var move = connect(targetDocument, "mousemove", operation(function(e) {
clearTimeout(going);
e_preventDefault(e);
extend(e);
}), true);
var up = connect(targetDocument, "mouseup", operation(function(e) {
clearTimeout(going);
var cur = posFromMouse(e);
if (cur) setSelectionUser(start, cur);
e_preventDefault(e);
focusInput();
updateInput = true;
move(); up();
}), true);
}