ntRect() te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);" var oldScrollY if (webkit) { oldScrollY = window.scrollY } // Work around Chrome issue (#2712) display.input.focus() if (webkit) { window.scrollTo(null, oldScrollY) } display.input.reset() // Adds "Select all" to context menu in FF if (!cm.somethingSelected()) { te.value = input.prevInput = " " } input.contextMenuPending = true display.selForContextMenu = cm.doc.sel clearTimeout(display.detectingSelectAll) // Select-all will be greyed out if there's nothing to select, so // this adds a zero-width space so that we can later check whether // it got selected. function prepareSelectAllHack() { if (te.selectionStart != null) { var selected = cm.somethingSelected() var extval = "\u200b" + (selected ? te.value : "") te.value = "\u21da" // Used to catch context-menu undo te.value = extval input.prevInput = selected ? "" : "\u200b" te.selectionStart = 1; te.selectionEnd = extval.length // Re-set this, in case some other handler touched the // selection in the meantime. display.selForContextMenu = cm.doc.sel } } function rehide() { input.contextMenuPending = false input.wrapper.style.cssText = oldWrapperCSS te.style.cssText = oldCSS if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos) } // Try to detect the user choosing select-all if (te.selectionStart != null) { if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack() } var i = 0, poll = function () { if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && te.selectionEnd > 0 && input.prevInput == "\u200b") { operation(cm, selectAll)(cm) } else if (i++ < 10) { display.detectingSelectAll = setTimeout(poll, 500) } else { display.selForContextMenu = null display.input.reset() } } display.detectingSelectAll = setTimeout(poll, 200) } } if (ie && ie_version >= 9) { prepareSelectAllHack() } if (captureRightClick) { e_stop(e) var mouseup = function () { off(window, "mouseup", mouseup) setTimeout(rehide, 20) } on(window, "mouseup", mouseup) } else { setTimeout(rehide, 50) } }; TextareaInput.prototype.readOnlyChanged = function (val) { if (!val) { this.reset() } }; TextareaInput.prototype.setUneditable = function () {}; TextareaInput.prototype.needsContentAttribute = false function fromTextArea(textarea, options) { options = options ? copyObj(options) : {} options.value = textarea.value if (!options.tabindex && textarea.tabIndex) { options.tabindex = textarea.tabIndex } if (!options.placeholder && textarea.placeholder) { options.placeholder = textarea.placeholder } // Set autofocus to true if this textarea is focused, or if it has // autofocus and no other element is focused. if (options.autofocus == null) { var hasFocus = activeElt() options.autofocus = hasFocus == textarea || textarea.getAttribute("autofocus") != null && hasFocus == document.body } function save() {textarea.value = cm.getValue()} var realSubmit if (textarea.form) { on(textarea.form, "submit", save) // Deplorable hack to make the submit method do the right thing. if (!options.leaveSubmitMethodAlone) { var form = textarea.form realSubmit = form.submit try { var wrappedSubmit = form.submit = function () { save() form.submit = realSubmit form.submit() form.submit = wrappedSubmit } } catch(e) {} } } options.finishInit = function (cm) { cm.save = save cm.getTextArea = function () { return textarea; } cm.toTextArea = function () { cm.toTextArea = isNaN // Prevent this from being ran twice save() textarea.parentNode.removeChild(cm.getWrapperElement()) textarea.style.display = "" if (textarea.form) { off(textarea.form, "submit", save) if (typeof textarea.form.submit == "function") { textarea.form.submit = realSubmit } } } } textarea.style.display = "none" var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); }, options) return cm } function addLegacyProps(CodeMirror) { CodeMirror.off = off CodeMirror.on = on CodeMirror.wheelEventPixels = wheelEventPixels CodeMirror.Doc = Doc CodeMirror.splitLines = splitLinesAuto CodeMirror.countColumn = countColumn CodeMirror.findColumn = findColumn CodeMirror.isWordChar = isWordCharBasic CodeMirror.Pass = Pass CodeMirror.signal = signal CodeMirror.Line = Line CodeMirror.changeEnd = changeEnd CodeMirror.scrollbarModel = scrollbarModel CodeMirror.Pos = Pos CodeMirror.cmpPos = cmp CodeMirror.modes = modes CodeMirror.mimeModes = mimeModes CodeMirror.resolveMode = resolveMode CodeMirror.getMode = getMode CodeMirror.modeExtensions = modeExtensions CodeMirror.extendMode = extendMode CodeMirror.copyState = copyState CodeMirror.startState = startState CodeMirror.innerMode = innerMode CodeMirror.commands = commands CodeMirror.keyMap = keyMap CodeMirror.keyName = keyName CodeMirror.isModifierKey = isModifierKey CodeMirror.lookupKey = lookupKey CodeMirror.normalizeKeyMap = normalizeKeyMap CodeMirror.StringStream = StringStream CodeMirror.SharedTextMarker = SharedTextMarker CodeMirror.TextMarker = TextMarker CodeMirror.LineWidget = LineWidget CodeMirror.e_preventDefault = e_preventDefault CodeMirror.e_stopPropagation = e_stopPropagation CodeMirror.e_stop = e_stop CodeMirror.addClass = addClass CodeMirror.contains = contains CodeMirror.rmClass = rmClass CodeMirror.keyNames = keyNames } // EDITOR CONSTRUCTOR defineOptions(CodeMirror) addEditorMethods(CodeMirror) // Set up methods on CodeMirror's prototype to redirect to the editor's document. var dontDelegate = "iter insert remove copy getEditor constructor".split(" ") for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) { CodeMirror.prototype[prop] = (function(method) { return function() {return method.apply(this.doc, arguments)} })(Doc.prototype[prop]) } } eventMixin(Doc) // INPUT HANDLING CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput} // MODE DEFINITION AND QUERYING // Extra arguments are stored as the mode's dependencies, which is // used by (legacy) mechanisms like loadmode.js to automatically // load a mode. (Preferred mechanism is the require/define calls.) CodeMirror.defineMode = function(name/*, mode, …*/) { if (!CodeMirror.defaults.mode && name != "null") { CodeMirror.defaults.mode = name } defineMode.apply(this, arguments) } CodeMirror.defineMIME = defineMIME // Minimal default mode. CodeMirror.defineMode("null", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); }) CodeMirror.defineMIME("text/plain", "null") // EXTENSIONS CodeMirror.defineExtension = function (name, func) { CodeMirror.prototype[name] = func } CodeMirror.defineDocExtension = function (name, func) { Doc.prototype[name] = func } CodeMirror.fromTextArea = fromTextArea addLegacyProps(CodeMirror) CodeMirror.version = "5.24.2" return CodeMirror; })));oAVJ@-!t@з2Xb d$,>ܘƧBX%[+L4aFXX!wi.^6Vp,Ch8iTܦlGm_܃& aX Xw\ @<%Y|BkL& C"W9%O< CDU"< ~Ktk&84dsd!{ڵ%B(P!,%QXB`^9͑s;Ip`sxK-tN4H_IҘ£ x(^%X ȰZ`‚SY'A`f^>.A`[Pa 6*46S