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

},{}]},{},[1]);

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