File modules/editor/codemirror/src/edit/main.min.js

Last commit: Tue May 22 22:39:49 2018 +0200	Jan Dankert	Fix für PHP 7.2: 'Object' darf nun nicht mehr als Klassennamen verwendet werden. AUCH NICHT IN EINEM NAMESPACE! WTF, wozu habe ich das in einen verfickten Namespace gepackt? Wozu soll der sonst da sein??? Amateure. Daher nun notgedrungen unbenannt in 'BaseObject'.
1 // EDITOR CONSTRUCTOR 2 3 import { CodeMirror } from "./CodeMirror.js" 4 export { CodeMirror } from "./CodeMirror.js" 5 6 import { eventMixin } from "../util/event.js" 7 import { indexOf } from "../util/misc.js" 8 9 import { defineOptions } from "./options.js" 10 11 defineOptions(CodeMirror) 12 13 import addEditorMethods from "./methods.js" 14 15 addEditorMethods(CodeMirror) 16 17 import Doc from "../model/Doc.js" 18 19 // Set up methods on CodeMirror's prototype to redirect to the editor's document. 20 let dontDelegate = "iter insert remove copy getEditor constructor".split(" ") 21 for (let prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) 22 CodeMirror.prototype[prop] = (function(method) { 23 return function() {return method.apply(this.doc, arguments)} 24 })(Doc.prototype[prop]) 25 26 eventMixin(Doc) 27 28 // INPUT HANDLING 29 30 import ContentEditableInput from "../input/ContentEditableInput.js" 31 import TextareaInput from "../input/TextareaInput.js" 32 CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput} 33 34 // MODE DEFINITION AND QUERYING 35 36 import { defineMIME, defineMode } from "../modes.js" 37 38 // Extra arguments are stored as the mode's dependencies, which is 39 // used by (legacy) mechanisms like loadmode.js to automatically 40 // load a mode. (Preferred mechanism is the require/define calls.) 41 CodeMirror.defineMode = function(name/*, mode, …*/) { 42 if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name 43 defineMode.apply(this, arguments) 44 } 45 46 CodeMirror.defineMIME = defineMIME 47 48 // Minimal default mode. 49 CodeMirror.defineMode("null", () => ({token: stream => stream.skipToEnd()})) 50 CodeMirror.defineMIME("text/plain", "null") 51 52 // EXTENSIONS 53 54 CodeMirror.defineExtension = (name, func) => { 55 CodeMirror.prototype[name] = func 56 } 57 CodeMirror.defineDocExtension = (name, func) => { 58 Doc.prototype[name] = func 59 } 60 61 import { fromTextArea } from "./fromTextArea.js" 62 63 CodeMirror.fromTextArea = fromTextArea 64 65 import { addLegacyProps } from "./legacy.js" 66 67 addLegacyProps(CodeMirror) 68 69 CodeMirror.version = "5.32.0"
Download modules/editor/codemirror/src/edit/main.min.js
History Tue, 22 May 2018 22:39:49 +0200 Jan Dankert Fix für PHP 7.2: 'Object' darf nun nicht mehr als Klassennamen verwendet werden. AUCH NICHT IN EINEM NAMESPACE! WTF, wozu habe ich das in einen verfickten Namespace gepackt? Wozu soll der sonst da sein??? Amateure. Daher nun notgedrungen unbenannt in 'BaseObject'.