File modules/editor/codemirror/addon/mode/loadmode.min.js
Last commit: Tue May 22 22:39:55 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 // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 // Distributed under an MIT license: http://codemirror.net/LICENSE 3 4 (function(mod) { 5 if (typeof exports == "object" && typeof module == "object") // CommonJS 6 mod(require("../../lib/codemirror"), "cjs"); 7 else if (typeof define == "function" && define.amd) // AMD 8 define(["../../lib/codemirror"], function(CM) { mod(CM, "amd"); }); 9 else // Plain browser env 10 mod(CodeMirror, "plain"); 11 })(function(CodeMirror, env) { 12 if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js"; 13 14 var loading = {}; 15 function splitCallback(cont, n) { 16 var countDown = n; 17 return function() { if (--countDown == 0) cont(); }; 18 } 19 function ensureDeps(mode, cont) { 20 var deps = CodeMirror.modes[mode].dependencies; 21 if (!deps) return cont(); 22 var missing = []; 23 for (var i = 0; i < deps.length; ++i) { 24 if (!CodeMirror.modes.hasOwnProperty(deps[i])) 25 missing.push(deps[i]); 26 } 27 if (!missing.length) return cont(); 28 var split = splitCallback(cont, missing.length); 29 for (var i = 0; i < missing.length; ++i) 30 CodeMirror.requireMode(missing[i], split); 31 } 32 33 CodeMirror.requireMode = function(mode, cont) { 34 if (typeof mode != "string") mode = mode.name; 35 if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont); 36 if (loading.hasOwnProperty(mode)) return loading[mode].push(cont); 37 38 var file = CodeMirror.modeURL.replace(/%N/g, mode); 39 if (env == "plain") { 40 var script = document.createElement("script"); 41 script.src = file; 42 var others = document.getElementsByTagName("script")[0]; 43 var list = loading[mode] = [cont]; 44 CodeMirror.on(script, "load", function() { 45 ensureDeps(mode, function() { 46 for (var i = 0; i < list.length; ++i) list[i](); 47 }); 48 }); 49 others.parentNode.insertBefore(script, others); 50 } else if (env == "cjs") { 51 require(file); 52 cont(); 53 } else if (env == "amd") { 54 requirejs([file], cont); 55 } 56 }; 57 58 CodeMirror.autoLoadMode = function(instance, mode) { 59 if (!CodeMirror.modes.hasOwnProperty(mode)) 60 CodeMirror.requireMode(mode, function() { 61 instance.setOption("mode", instance.getOption("mode")); 62 }); 63 }; 64 });
Downloadmodules/editor/codemirror/addon/mode/loadmode.min.js
History Tue, 22 May 2018 22:39:55 +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'.