[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/media/plg_editors_codemirror/js/ -> joomla-editor-codemirror-es5.min.js (source)

   1  !function(){"use strict";function e(e,t,n,r,o,i,s){try{var c=e[i](s),a=c.value}catch(e){return void n(e)}c.done?t(a):Promise.resolve(a).then(r,o)}function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o(){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(e){return!1}}function i(e,t,n){return(i=o()?Reflect.construct:function(e,t,n){var o=[null];o.push.apply(o,t);var i=new(Function.bind.apply(e,o));return n&&r(i,n.prototype),i}).apply(null,arguments)}function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||(o=e,-1===Function.toString.call(o).indexOf("[native code]")))return e;var o;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,s)}function s(){return i(e,arguments,n(this).constructor)}return s.prototype=Object.create(e.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),r(s,e)})(e)}var c=function(n){var o,i;function s(){var e;return(e=n.call(this)||this).instance="",e.host=window.location.origin,e.element=e.querySelector("textarea"),e.refresh=e.refresh.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)),e.intersectionObserver=new IntersectionObserver((function(t){t[0].isIntersecting&&e.instance&&e.instance.refresh()}),{threshold:0}),e}i=n,(o=s).prototype=Object.create(i.prototype),o.prototype.constructor=o,r(o,i);var c,a,u,p=s.prototype;return p.attributeChangedCallback=function(e,t,n){switch(e){case"options":t&&n!==t&&this.refresh(this.element)}},p.connectedCallback=function(){var t,n=(t=regeneratorRuntime.mark((function e(){var t,n,r,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.getAttribute("editor"),n=this.getAttribute("addons"),e.next=4,import(this.host+"/"+t);case 4:if(!this.options.keyMapUrl){e.next=7;break}return e.next=7,import(this.host+"/"+this.options.keyMapUrl);case 7:return e.next=9,import(this.host+"/"+n);case 9:r=this,window.CodeMirror.modeURL=this.getAttribute("mod-path"),window.CodeMirror.defineInitHook((function(e){var t,n=window.CodeMirror.findModeByName(e.options.mode||"")||window.CodeMirror.findModeByExtension(e.options.mode||"");window.CodeMirror.autoLoadMode(e,"object"==typeof n?n.mode:e.options.mode),n&&n.mime&&(["text/x-php","application/x-httpd-php","application/x-httpd-php-open"].includes(n.mime)?e.setOption("mode","php"):e.setOption("mode",n.mime));var o=function(){r.instance.setOption("fullScreen",!r.instance.getOption("fullScreen"));var e=document.getElementById("subhead");e&&(document.getElementById("header").classList.toggle("hidden"),e.classList.toggle("hidden"),r.instance.display.wrapper.style.top=e.getBoundingClientRect().height+"px")},i=((t={"Ctrl-Q":o})[r.getAttribute("fs-combo")]=o,t.Esc=function(){if(r.instance.getOption("fullScreen"),r.instance.setOption("fullScreen",!1),!r.instance.getOption("fullScreen")){var e=document.getElementById("subhead");if(e){var t=document.getElementById("header");e.classList.toggle("hidden"),t.classList.toggle("hidden"),r.instance.display.wrapper.style.top=e.getBoundingClientRect().height+"px"}}},t);e.addKeyMap(i),e.on("gutterClick",(function(e,t,n){if("CodeMirror-markergutter"===n){var r,o=e.lineInfo(t),i=!!o.gutterMarkers&&!!o.gutterMarkers["CodeMirror-markergutter"];e.setGutterMarker(t,"CodeMirror-markergutter",i?null:((r=document.createElement("div")).className="CodeMirror-markergutter-mark",r))}})),"fieldset"===r.parentNode.tagName.toLowerCase()&&(r.parentNode.style.minWidth=0)})),this.instance=window.CodeMirror.fromTextArea(this.element,this.options),this.instance.disable=function(e){return o.setOption("readOnly",!!e&&"nocursor")},Joomla.editors.instances[this.element.id]=this.instance,this.intersectionObserver.observe(this);case 16:case"end":return e.stop()}}),e,this)})),function(){var n=this,r=arguments;return new Promise((function(o,i){var s=t.apply(n,r);function c(t){e(s,o,i,c,a,"next",t)}function a(t){e(s,o,i,c,a,"throw",t)}c(void 0)}))});return function(){return n.apply(this,arguments)}}(),p.disconnectedCallback=function(){delete Joomla.editors.instances[this.element.id],this.intersectionObserver.unobserve(this)},p.refresh=function(e){this.instance.fromTextArea(e,this.options)},c=s,u=[{key:"observedAttributes",get:function(){return["options"]}}],(a=[{key:"options",get:function(){return JSON.parse(this.getAttribute("options"))},set:function(e){this.setAttribute("options",e)}}])&&t(c.prototype,a),u&&t(c,u),Object.defineProperty(c,"prototype",{writable:!1}),s}(s(HTMLElement));customElements.define("joomla-editor-codemirror",c)}();


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer