CoreFiles by mySites.guru
joomla-editor-codemirror-es5.min.js1 lines, 5,090 bytes, from Joomla_4.0.0-alpha3-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha2
md5
0a53d58b3e07fcdeb4a756e0cf43c56d
sha1
af075258feee2714d03d20783a7f29600b68666b
sha256
a962fe6ea751a522ccd40f448ee59e7e575f713c8b6262de579a369fd89db2dd
!function(){return function e(t,r,n){function o(c,u){if(!r[c]){if(!t[c]){var a="function"==typeof require&&require;if(!u&&a)return a(c,!0);if(i)return i(c,!0);var s=new Error("Cannot find module '"+c+"'");throw s.code="MODULE_NOT_FOUND",s}var l=r[c]={exports:{}};t[c][0].call(l.exports,function(e){return o(t[c][1][e]||e)},l,l.exports,e,t,r,n)}return r[c].exports}for(var i="function"==typeof require&&require,c=0;c<n.length;c++)o(n[c]);return o}}()({1:[function(e,t,r){"use strict";var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();customElements.define("joomla-editor-codemirror",function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(e.instance="",e.cm="",e.file=document.currentScript,e.element=e.querySelector("textarea"),e.host=window.location.origin,!document.head.querySelector("#cm-editor")){var r=e.getAttribute("editor"),n=document.createElement("script");n.src=e.host+"/"+r,n.id="cm-editor",n.setAttribute("async",!1),document.head.insertBefore(n,e.file)}return e.toggleFullScreen=e.toggleFullScreen.bind(e),e.closeFullScreen=e.closeFullScreen.bind(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,HTMLElement),n(t,[{key:"attributeChangedCallback",value:function(e,t,r){switch(e){case"options":t&&r!==t&&this.refresh(this.element)}}},{key:"options",get:function(){return JSON.parse(this.getAttribute("options"))},set:function(e){this.setAttribute("options",e)}}],[{key:"observedAttributes",get:function(){return["options"]}}]),n(t,[{key:"connectedCallback",value:function(){var e=this;[].slice.call(this.querySelectorAll(".editor-xtd-buttons .xtd-button"));this.checkElement("CodeMirror").then(function(){if(!document.head.querySelector("#cm-addons")){var t=e.getAttribute("addons"),r=document.createElement("script");r.src=e.host+"/"+t,r.id="cm-addons",r.setAttribute("async",!1),document.head.insertBefore(r,e.file)}e.checkElement("CodeMirror","findModeByName").then(function(){window.CodeMirror.keyMap.default["Ctrl-Q"]=e.toggleFullScreen,window.CodeMirror.keyMap.default[e.getAttribute("fs-combo")]=e.toggleFullScreen,window.CodeMirror.keyMap.default.Esc=e.closeFullScreen,window.CodeMirror.modeURL=e.getAttribute("mod-path"),window.CodeMirror.defineInitHook(function(t){var r=window.CodeMirror.findModeByName(t.options.mode||"");r?(window.CodeMirror.autoLoadMode(t,r.mode),t.setOption("mode",r.mime)):window.CodeMirror.autoLoadMode(t,t.options.mode),t.on("gutterClick",function(e,t,r){if("CodeMirror-markergutter"===r){var n=e.lineInfo(t),o=!!n.gutterMarkers&&!!n.gutterMarkers["CodeMirror-markergutter"];e.setGutterMarker(t,"CodeMirror-markergutter",o?null:this.makeMarker())}}),"fieldset"===e.parentNode.tagName.toLowerCase()&&(e.parentNode.style.minWidth=0)}),e.instance=window.CodeMirror.fromTextArea(e.element,e.options),Joomla.editors.instances[e.element.id]=e.instance})})}},{key:"disconnectedCallback",value:function(){delete Joomla.editors.instances[this.element.id]}},{key:"refresh",value:function(e){this.instance=window.CodeMirror.fromTextArea(e,this.options)}},{key:"rafAsync",value:function(){return new Promise(function(e){requestAnimationFrame(e)})}},{key:"checkElement",value:function(){var e,t=(e=regeneratorRuntime.mark(function e(t,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!r){e.next=8;break}case 1:if("function"==typeof window[t][r]){e.next=6;break}return e.next=4,this.rafAsync();case 4:e.next=1;break;case 6:e.next=13;break;case 8:if("function"==typeof window[t]){e.next=13;break}return e.next=11,this.rafAsync();case 11:e.next=8;break;case 13:return e.abrupt("return",!0);case 14:case"end":return e.stop()}},e,this)}),function(){var t=e.apply(this,arguments);return new Promise(function(e,r){return function n(o,i){try{var c=t[o](i),u=c.value}catch(e){return void r(e)}if(!c.done)return Promise.resolve(u).then(function(e){n("next",e)},function(e){n("throw",e)});e(u)}("next")})});return function(e,r){return t.apply(this,arguments)}}()},{key:"toggleFullScreen",value:function(){this.instance.setOption("fullScreen",!this.instance.getOption("fullScreen"))}},{key:"closeFullScreen",value:function(){this.instance.getOption("fullScreen")&&this.instance.setOption("fullScreen",!1)}},{key:"makeMarker",value:function(){var e=document.createElement("div");return e.className="CodeMirror-markergutter-mark",e}}]),t}())},{}]},{},[1]);

No other release has this exact content. See every version of this file.