CoreFiles by mySites.guru
joomla-editor-codemirror-es5.min.js1 lines, 12,169 bytes, from Joomla_4.3.4-Stable-Full_Package.zip
Raw History Compare with 4.3.3
md5
37258832e20c182e9061a8e1956bd629
sha1
fb78a1d176d573a6ffb6f3032af45785e3d8fedc
sha256
dec7d3da1ba3cc6784ef4e6c487fc20f9cb50a3d2835be6c43a42fc28cf10fa3
!function(){"use strict";function t(){t=function(){return e};var e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),c=new j(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h={};function p(){}function d(){}function y(){}var v={};s(v,a,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(_([])));g&&g!==r&&n.call(g,a)&&(v=g);var b=y.prototype=p.prototype=Object.create(v);function w(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,c){var u=f(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return M()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=L(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=f(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function L(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,L(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=f(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function _(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return d.prototype=y,o(b,"constructor",{value:y,configurable:!0}),o(y,"constructor",{value:d,configurable:!0}),d.displayName=s(y,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,s(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},e.awrap=function(t){return{__await:t}},w(x.prototype),s(x.prototype,c,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(b),s(b,u,"Generator"),s(b,a,(function(){return this})),s(b,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=_,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function e(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"))?i:String(i)),n)}var o,i}function n(t){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function i(t,e,r){return i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct.bind():function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&o(i,r.prototype),i},i.apply(null,arguments)}function a(t){var e="function"==typeof Map?new Map:void 0;return a=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,a)}function a(){return i(t,arguments,n(this).constructor)}return a.prototype=Object.create(t.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),o(a,t)},a(t)}var c=function(n){var i,a;function c(){var t;return(t=n.call(this)||this).instance="",t.host=window.location.origin,t.element=t.querySelector("textarea"),t.refresh=t.refresh.bind(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)),t.intersectionObserver=new IntersectionObserver((function(e){e[0].isIntersecting&&t.instance&&t.instance.refresh()}),{threshold:0}),t}a=n,(i=c).prototype=Object.create(a.prototype),i.prototype.constructor=i,o(i,a);var u,s,l,f=c.prototype;return f.attributeChangedCallback=function(t,e,r){if("options"===t)e&&r!==e&&this.refresh(this.element)},f.connectedCallback=function(){var r,n=(r=t().mark((function e(){var r,n,o,i=this;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.getAttribute("editor"),n=this.getAttribute("addons"),t.next=4,import(this.host+"/"+r);case 4:if(!this.options.keyMapUrl){t.next=7;break}return t.next=7,import(this.host+"/"+this.options.keyMapUrl);case 7:return t.next=9,import(this.host+"/"+n);case 9:o=this,window.CodeMirror.modeURL=this.getAttribute("mod-path"),window.CodeMirror.defineInitHook((function(t){var e,r=window.CodeMirror.findModeByName(t.options.mode||"")||window.CodeMirror.findModeByExtension(t.options.mode||"");window.CodeMirror.autoLoadMode(t,"object"==typeof r?r.mode:t.options.mode),r&&r.mime&&(["text/x-php","application/x-httpd-php","application/x-httpd-php-open"].includes(r.mime)?t.setOption("mode","php"):"text/html"===r.mime?t.setOption("mode",r.mode):t.setOption("mode",r.mime));var n=function(){o.instance.setOption("fullScreen",!o.instance.getOption("fullScreen"));var t=document.getElementById("subhead");t&&(document.getElementById("header").classList.toggle("hidden"),t.classList.toggle("hidden"),o.instance.display.wrapper.style.top=t.getBoundingClientRect().height+"px")},i=((e={"Ctrl-Q":n})[o.getAttribute("fs-combo")]=n,e.Esc=function(){if(o.instance.getOption("fullScreen"),o.instance.setOption("fullScreen",!1),!o.instance.getOption("fullScreen")){var t=document.getElementById("subhead");if(t){var e=document.getElementById("header");t.classList.toggle("hidden"),e.classList.toggle("hidden"),o.instance.display.wrapper.style.top=t.getBoundingClientRect().height+"px"}}},e);t.addKeyMap(i),t.on("gutterClick",(function(t,e,r){if("CodeMirror-markergutter"===r){var n,o=t.lineInfo(e),i=!!o.gutterMarkers&&!!o.gutterMarkers["CodeMirror-markergutter"];t.setGutterMarker(e,"CodeMirror-markergutter",i?null:((n=document.createElement("div")).className="CodeMirror-markergutter-mark",n))}})),"fieldset"===o.parentNode.tagName.toLowerCase()&&(o.parentNode.style.minWidth=0)})),this.instance=window.CodeMirror.fromTextArea(this.element,this.options),this.instance.disable=function(t){return i.setOption("readOnly",!!t&&"nocursor")},Joomla.editors.instances[this.element.id]=this.instance,this.intersectionObserver.observe(this);case 16:case"end":return t.stop()}}),e,this)})),function(){var t=this,n=arguments;return new Promise((function(o,i){var a=r.apply(t,n);function c(t){e(a,o,i,c,u,"next",t)}function u(t){e(a,o,i,c,u,"throw",t)}c(void 0)}))});return function(){return n.apply(this,arguments)}}(),f.disconnectedCallback=function(){delete Joomla.editors.instances[this.element.id],this.intersectionObserver.unobserve(this)},f.refresh=function(t){this.instance.fromTextArea(t,this.options)},u=c,l=[{key:"observedAttributes",get:function(){return["options"]}}],(s=[{key:"options",get:function(){return JSON.parse(this.getAttribute("options"))},set:function(t){this.setAttribute("options",t)}}])&&r(u.prototype,s),l&&r(u,l),Object.defineProperty(u,"prototype",{writable:!1}),c}(a(HTMLElement));customElements.define("joomla-editor-codemirror",c)}();

The same content is in 17 releases, Joomla 4.3.0-beta4 to 5.0.0-alpha1. See them all, or every version of this file.