From 866eaec7e6b1e2f1099fe95a2aef5739ad04c487 Mon Sep 17 00:00:00 2001 From: "jihong.lee" <0125ses@hanmail.net> Date: Tue, 6 Nov 2018 04:55:40 +0900 Subject: [PATCH] version up: 2.7.1 - align image rotate --- bower.json | 2 +- dist/suneditor.min.js | 2 +- package-lock.json | 2 +- package.json | 2 +- src/plugins/dialog/image.js | 6 ++++-- src/plugins/dialog/video.js | 4 +++- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/bower.json b/bower.json index 158d0dc7b..74d04c3ac 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "suneditor", - "version": "2.7.0", + "version": "2.7.1", "description": "Pure JavaScript based WYSIWYG web editor", "main": "src/suneditor.js", "keywords": [ diff --git a/dist/suneditor.min.js b/dist/suneditor.min.js index ce5915cd9..0e1ff173f 100644 --- a/dist/suneditor.min.js +++ b/dist/suneditor.min.js @@ -1 +1 @@ -!function(e){var t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s="XJR1")}({"0A7J":function(module,__webpack_exports__,__webpack_require__){"use strict";var _modules_colorPicker__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("EjF6");__webpack_exports__.a={name:"fontColor",add:function(core,targetElement){core.addModule([_modules_colorPicker__WEBPACK_IMPORTED_MODULE_0__.a]);const context=core.context;context.fontColor={previewEl:null,colorInput:null};let listDiv=eval(this.setSubmenu(context.colorPicker.colorListHTML));context.fontColor.colorInput=listDiv.getElementsByClassName("sun-editor-id-submenu-color-input")[0],context.fontColor.colorInput.addEventListener("keyup",this.onChangeInput.bind(core)),listDiv.getElementsByClassName("sun-editor-id-submenu-color-submit")[0].addEventListener("click",this.submit.bind(core)),listDiv.getElementsByTagName("UL")[0].addEventListener("click",this.pickup.bind(core)),targetElement.parentNode.appendChild(listDiv),listDiv=null},setSubmenu:function(e){const t=document.createElement("DIV");return t.className="layer_editor",t.style.display="none",t.innerHTML=e,t},on:function(){const e=this.context.colorPicker;e._colorInput=this.context.fontColor.colorInput,e._defaultColor="#000000",e._styleProperty="color",this.plugins.colorPicker.init.call(this,this.getSelectionNode(),null)},onChangeInput:function(e){this.plugins.colorPicker.setCurrentColor.call(this,"#"+e.target.value)},submit:function(){this.plugins.fontColor.applyColor.call(this,this.context.colorPicker._currentColor)},pickup:function(e){if(e.preventDefault(),e.stopPropagation(),!/^BUTTON$/i.test(e.target.tagName))return!1;this.plugins.fontColor.applyColor.call(this,e.target.getAttribute("data-value"))},applyColor:function(e){const t=document.createElement("SPAN");t.style.color=e,this.wrapRangeToTag(t,["color"]),this.submenuOff(),this.focus()}}},"1kvd":function(e,t,i){"use strict";t.a={name:"dialog",add:function(e){const t=e.context;t.dialog={};let i=document.createElement("DIV");i.className="sun-editor-id-dialogBox sun-editor-common";let n=document.createElement("DIV");n.className="modal-dialog-background sun-editor-id-dialog-back",n.style.display="none";let o=document.createElement("DIV");o.className="modal-dialog sun-editor-id-dialog-modal",o.style.display="none",i.appendChild(n),i.appendChild(o),t.dialog.modalArea=i,t.dialog.back=n,t.dialog.modal=o,t.dialog.modal.addEventListener("click",this.onClick_dialog.bind(e)),t.element.topArea.getElementsByClassName("sun-editor-container")[0].appendChild(i),i=null,n=null,o=null},onClick_dialog:function(e){e.stopPropagation(),(/modal-dialog/.test(e.target.className)||/close/.test(e.target.getAttribute("data-command")))&&this.plugins.dialog.closeDialog.call(this)},openDialog:function(e,t,i){if(this.modalForm)return!1;this.context.dialog.updateModal=i,this.context.dialog.modalArea.style.position="full"===t?"fixed":"absolute",this.context.dialog.kind=e,this.modalForm=this.context[e].modal;const n=this.context[e].focusElement;this.context.dialog.modalArea.style.display="block",this.context.dialog.back.style.display="block",this.context.dialog.modal.style.display="block",this.modalForm.style.display="block",n&&n.focus()},closeDialog:function(){this.modalForm.style.display="none",this.context.dialog.back.style.display="none",this.context.dialog.modalArea.style.display="none",this.modalForm=null,this.context.dialog.updateModal=!1,this.plugins[this.context.dialog.kind].init.call(this)}}},"3FqI":function(e,t,i){},"50IV":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_exports__.a={name:"font",add:function(core,targetElement){let listDiv=eval(this.setSubmenu(core.context.user));listDiv.getElementsByClassName("list_family")[0].addEventListener("click",this.pickup.bind(core)),targetElement.parentNode.appendChild(listDiv),listDiv=null},setSubmenu:function(e){const t=document.createElement("DIV");let i,n,o,l;t.className="layer_editor",t.style.display="none";let s=e.font?e.font:["Arial","Comic Sans MS","Courier New,Courier","Impact,Charcoal,sans-serif","Georgia","tahoma","Trebuchet MS,Helvetica","Verdana"],a='
",a+="
",t.innerHTML=a,t},pickup:function(e){if(!/^BUTTON$/i.test(e.target.tagName))return!1;e.preventDefault(),e.stopPropagation();const t=e.target;this.util.changeTxt(this.context.tool.font,t.getAttribute("data-txt"));const i=document.createElement("SPAN");i.style.fontFamily=t.getAttribute("data-value"),this.wrapRangeToTag(i,["font-family"]),this.submenuOff(),this.focus()}}},EjF6:function(e,t,i){"use strict";t.a={name:"colorPicker",add:function(e){const t=e.context;t.colorPicker={colorListHTML:"",_colorInput:"",_defaultColor:"#000",_styleProperty:"color",_currentColor:""};let i=this.createColorList(e.context.user,e.lang);t.colorPicker.colorListHTML=i,i=null},createColorList:function(e,t){const i=e.colorList?e.colorList:["#ff0000","#ff5e00","#ffe400","#abf200","#00d8ff","#0055ff","#6600ff","#ff00dd","#000000","#ffd8d8","#fae0d4","#faf4c0","#e4f7ba","#d4f4fa","#d9e5ff","#e8d9ff","#ffd9fa","#ffffff","#ffa7a7","#ffc19e","#faed7d","#cef279","#b2ebf4","#b2ccff","#d1b2ff","#ffb2f5","#bdbdbd","#f15f5f","#f29661","#e5d85c","#bce55c","#5cd1e5","#6699ff","#a366ff","#f261df","#8c8c8c","#980000","#993800","#998a00","#6b9900","#008299","#003399","#3d0099","#990085","#353535","#670000","#662500","#665c00","#476600","#005766","#002266","#290066","#660058","#222222"];let n='
"},init:function(e,t){const i=this.plugins.colorPicker;let n=t||(i.getColorInNode.call(this,e)||this.context.colorPicker._defaultColor);n=i.isHexColor(n)?n:i.rgb2hex(n),i.setInputText.call(this,n)},setCurrentColor:function(e){this.context.colorPicker._currentColor=e,this.context.colorPicker._colorInput.style.borderColor=e},setInputText:function(e){this.context.colorPicker._colorInput.value=e.replace("#",""),this.plugins.colorPicker.setCurrentColor.call(this,e)},getColorInNode:function(e){let t="";const i=this.context.colorPicker._styleProperty;for(;!this.util.isWysiwygDiv(e)&&0===t.length;)1===e.nodeType&&e.style[i]&&(t=e.style[i]),e=e.parentNode;return t},isHexColor:function(e){return/^#[0-9a-f]{3}(?:[0-9a-f]{3})?$/i.test(e)},rgb2hex:function(e){return(e=e.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&4===e.length?"#"+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2)+("0"+parseInt(e[3],10).toString(16)).slice(-2):""}}},KKur:function(module,__webpack_exports__,__webpack_require__){"use strict";var _modules_dialog__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("1kvd"),_modules_resizing__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("ee5k");__webpack_exports__.a={name:"image",add:function(core){core.addModule([_modules_dialog__WEBPACK_IMPORTED_MODULE_0__.a,_modules_resizing__WEBPACK_IMPORTED_MODULE_1__.a]);const context=core.context;context.image={_linkElement:null,_container:null,_cover:null,_element:null,_element_w:1,_element_h:1,_element_l:0,_element_t:0,_user_w:context.user.imageSize,_user_h:0,_altText:"",_caption:null,captionCheckEl:null,_linkValue:"",_align:"none",_captionChecked:!1,_proportionChecked:!0,_floatClassRegExp:"float\\-[a-z]+",_xmlHttp:null};let image_dialog=eval(this.setDialog(core.context.user,core.lang));context.image.modal=image_dialog,context.image.imgUrlFile=image_dialog.getElementsByClassName("sun-editor-id-image-url")[0],context.image.imgInputFile=context.image.focusElement=image_dialog.getElementsByClassName("sun-editor-id-image-file")[0],context.image.altText=image_dialog.getElementsByClassName("sun-editor-id-image-alt")[0],context.image.imgLink=image_dialog.getElementsByClassName("sun-editor-id-image-link")[0],context.image.imgLinkNewWindowCheck=image_dialog.getElementsByClassName("sun-editor-id-linkCheck")[0],context.image.captionCheckEl=image_dialog.getElementsByClassName("suneditor-id-image-check-caption")[0],context.image.proportion=image_dialog.getElementsByClassName("suneditor-id-image-check-proportion")[0],context.image.imageX=image_dialog.getElementsByClassName("sun-editor-id-image-x")[0],context.image.imageY=image_dialog.getElementsByClassName("sun-editor-id-image-y")[0],context.image.imageX.value=context.user.imageSize,context.image.modal.getElementsByClassName("sun-editor-tab-button")[0].addEventListener("click",this.openTab.bind(core)),context.image.modal.getElementsByClassName("btn-primary")[0].addEventListener("click",this.submit.bind(core)),context.image.imageX.addEventListener("change",this.setInputSize.bind(core,"x")),context.image.imageY.addEventListener("change",this.setInputSize.bind(core,"y")),image_dialog.getElementsByClassName("sun-editor-id-image-revert-button")[0].addEventListener("click",this.sizeRevert.bind(core)),context.dialog.modal.appendChild(image_dialog),image_dialog=null},setDialog:function(e,t){const i=document.createElement("DIV");i.className="modal-content sun-editor-id-dialog-image",i.style.display="none";let n='
",i.innerHTML=n,i},openTab:function(e){const t=this.context.image.modal,i="init"===e?t.getElementsByClassName("sun-editor-id-tab-link")[0]:e.target;if(!/^BUTTON$/i.test(i.tagName))return!1;const n=i.getAttribute("data-tab-link");let o,l,s;for(l=t.getElementsByClassName("sun-editor-id-tab-content"),o=0;o0){const t=this.context.user.imageUploadUrl,i=this.context.dialog.updateModal?1:e.length;if(null!==t&&t.length>0){const n=new FormData;for(let t=0;t0?1:result.length;e0){const n=document.createElement("A");return n.href=/^https?:\/\//.test(t)?t:"http://"+t,n.target=i?"_blank":"",n.setAttribute("data-image-link","image"),e.setAttribute("data-image-link",t),n.appendChild(e),n}return e},setInputSize:function(e){this.context.dialog.updateModal&&this.context.image.proportion.checked&&("x"===e?this.context.image.imageY.value=Math.round(this.context.image._element_h/this.context.image._element_w*this.context.image.imageX.value):this.context.image.imageX.value=Math.round(this.context.image._element_w/this.context.image._element_h*this.context.image.imageY.value))},submit:function(e){this.showLoading(),e.preventDefault(),e.stopPropagation(),this.context.image._linkValue=this.context.image.imgLink.value,this.context.image._altText=this.context.image.altText.value,this.context.image._align=this.context.image.modal.querySelector('input[name="suneditor_image_radio"]:checked').value,this.context.image._captionChecked=this.context.image.captionCheckEl.checked,this.context.image._proportionChecked=this.context.image.proportion.checked;try{this.context.dialog.updateModal&&this.plugins.image.update_image.call(this),this.context.image.imgInputFile.files.length>0?this.plugins.image.onRender_imgInput.call(this):this.context.image.imgUrlFile.value.trim().length>0?this.plugins.image.onRender_imgUrl.call(this):this.closeLoading()}catch(e){throw this.closeLoading(),Error('[SUNEDITOR.image.submit.fail] cause : "'+e.message+'"')}finally{this.plugins.dialog.closeDialog.call(this)}return!1},create_image:function(e,t,i,n,o,l,s){if(l)return void(s.src=e);const a=this.context.image;let r=document.createElement("IMG");r.src=e,r.style.width=n,r.setAttribute("data-align",o),r.setAttribute("data-proportion",a._proportionChecked),r.alt=a._altText,(r=this.plugins.image.onRender_link(r,t,i)).setAttribute("data-rotate","0"),r.onload=function(){this.setAttribute("origin-size",this.naturalWidth+","+this.naturalHeight),this.setAttribute("data-origin",this.offsetWidth+","+this.offsetHeight),this.style.height=this.offsetHeight+"px"}.bind(r);const d=this.plugins.resizing.set_cover.call(this,r),c=this.plugins.resizing.set_container.call(this,d,"sun-editor-id-image-container");a._captionChecked&&(a._caption=this.plugins.resizing.create_caption.call(this),a._caption.setAttribute("contenteditable",!1),d.appendChild(a._caption)),d.style.margin="none"!==o?"auto":"0",this.util.removeClass(c,a._floatClassRegExp),this.util.addClass(c,"float-"+o),this.insertNode(c,this.util.getFormatElement(this.getSelectionNode())),this.appendFormatTag(c)},update_image:function(){const e=this.context.image,t=e._linkValue;let i=e._element,n=e._cover,o=e._container,l=!1;const s=1*e.imageX.value!==i.offsetWidth||1*e.imageY.value!==i.offsetHeight;if(null===n&&(l=!0,i=e._element.cloneNode(!0),n=this.plugins.resizing.set_cover.call(this,i)),null===o&&(l=!0,o=this.plugins.resizing.set_container.call(this,n.cloneNode(!0),"sun-editor-id-image-container")),l&&(o.innerHTML="",o.appendChild(n)),this.plugins.image.onRender_imgInput.call(this),i.src=e.imgUrlFile.value,i.alt=e._altText,i.setAttribute("data-proportion",e._proportionChecked),s&&this.plugins.image.setSize.call(this,e.imageX.value,e.imageY.value),e._captionChecked?e._caption||(e._caption=this.plugins.resizing.create_caption.call(this),n.appendChild(e._caption)):e._caption&&(this.util.removeItem(e._caption),e._caption=null),e._align&&"none"!==e._align?n.style.margin="auto":n.style.margin="0",this.util.removeClass(o,this.context.image._floatClassRegExp),this.util.addClass(o,"float-"+e._align),i.setAttribute("data-align",e._align),t.trim().length>0)if(null!==e._linkElement)e._linkElement.href=t,e._linkElement.target=e.imgLinkNewWindowCheck.checked?"_blank":"",i.setAttribute("data-image-link",t);else{let o=this.plugins.image.onRender_link(i,t,this.context.image.imgLinkNewWindowCheck.checked);n.insertBefore(o,e._caption)}else if(null!==e._linkElement){const t=i;t.setAttribute("data-image-link","");let o=t.cloneNode(!0);n.removeChild(e._linkElement),n.insertBefore(o,e._caption),i=o}if(l){const e=this.util.getFormatElement(i);e.parentNode.insertBefore(o,e),this.util.removeItem(e)}s&&this.plugins.resizing.setTransformSize.call(this,i)},sizeRevert:function(){const e=this.context.image;e._user_w&&(e.imageX.value=e._element_w=e._user_w,e.imageY.value=e._element_h=e._user_h)},onModifyMode:function(e,t){const i=this.context.image;i._linkElement=/^A$/i.test(e.parentNode.nodeName)?e.parentNode:null,i._element=e,i._cover=this.util.getParentElement(e,".sun-editor-figure-cover"),i._container=this.util.getParentElement(e,".sun-editor-id-image-container"),i._caption=this.util.getChildElement(this.util.getParentElement(e,".sun-editor-figure-cover"),"FIGCAPTION"),i._element_w=t.w,i._element_h=t.h,i._element_t=t.t,i._element_l=t.l;let n=i._element.getAttribute("data-origin");n?(n=n.split(","),i._user_w=1*n[0],i._user_h=1*n[1]):(i._user_w=t.w,i._user_h=t.h,i._element.setAttribute("data-origin",t.w+","+t.h))},openModify:function(){const e=this.context.image;e.imgUrlFile.value=e._element.src,e.altText.value=e._element.alt,e.imgLink.value=null===e._linkElement?"":e._linkElement.href,e.imgLinkNewWindowCheck.checked=e._linkElement&&"_blank"===e._linkElement.target,e.modal.querySelector('input[name="suneditor_image_radio"][value="'+(e._element.getAttribute("data-align")||"none")+'"]').checked=!0,e._captionChecked=e.captionCheckEl.checked=!!e._caption,e.proportion.checked=e._proportionChecked="true"===e._element.getAttribute("data-proportion"),e.imageX.value=e._element.offsetWidth,e.imageY.value=e._element.offsetHeight,e.imageY.disabled=!1,e.proportion.disabled=!1,this.plugins.dialog.openDialog.call(this,"image",null,!0)},setSize:function(e,t){const i=this.context.image;i._element.style.width=e+"px",i._element.style.height=t+"px"},setPercentSize:function(e){const t=this.context.image;t._container.style.width=e,t._container.style.height="",t._cover.style.width="100%",t._cover.style.height="",t._element.style.width="100%",t._element.style.height="",/100/.test(e)&&(this.util.removeClass(t._container,this.context.image._floatClassRegExp),this.util.addClass(t._container,"float-center"))},cancelPercentAttr:function(){const e=this.context.image;e._cover.style.width="",e._cover.style.height="",e._container.style.width="",e._container.style.height="",this.util.removeClass(e._container,this.context.image._floatClassRegExp),this.util.addClass(e._container,"float-"+e._align)},resetAlign:function(){const e=this.context.image;e._element.setAttribute("data-align",""),e._align="none",e._cover.style.margin="0",this.util.removeClass(e._container,e._floatClassRegExp)},destroy:function(){const e=this.util.getParentElement(this.context.image._element,".sun-editor-id-image-container")||this.context.image._element;this.util.removeItem(e),this.plugins.image.init.call(this)},init:function(){const e=this.context.image;e.imgInputFile.value="",e.imgUrlFile.value="",e.altText.value="",e.imgLink.value="",e.imgLinkNewWindowCheck.checked=!1,e.modal.querySelector('input[name="suneditor_image_radio"][value="none"]').checked=!0,e.captionCheckEl.checked=!1,e.proportion.checked=!1,e.imageX.value=this.context.user.imageSize,e.imageY.value="",e.imageY.disabled=!0,e.proportion.disabled=!0,e._element=null,this.plugins.image.openTab.call(this,"init")}}},MIhV:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_exports__.a={name:"fontSize",add:function(core,targetElement){let listDiv=eval(this.setSubmenu(core.context.user));listDiv.getElementsByTagName("UL")[0].addEventListener("click",this.pickup.bind(core)),targetElement.parentNode.appendChild(listDiv),listDiv=null},setSubmenu:function(e){const t=document.createElement("DIV");t.className="layer_editor layer_size",t.style.display="none";const i=e.fontSize?e.fontSize:[8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72];let n='
    ';for(let e=0,t=i.length;e"}return n+="
",t.innerHTML=n,t},pickup:function(e){if(e.preventDefault(),e.stopPropagation(),!/^BUTTON$/i.test(e.target.tagName))return!1;this.util.changeTxt(this.context.tool.fontSize,e.target.getAttribute("data-value"));const t=document.createElement("SPAN");t.style.fontSize=e.target.getAttribute("data-value")+"px",this.wrapRangeToTag(t,["font-size"]),this.submenuOff(),this.focus()}}},Rp48:function(module,__webpack_exports__,__webpack_require__){"use strict";var _modules_dialog__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("1kvd");__webpack_exports__.a={name:"link",add:function(core){core.addModule([_modules_dialog__WEBPACK_IMPORTED_MODULE_0__.a]);const context=core.context;context.link={};let link_dialog=eval(this.setDialog(core.lang));context.link.modal=link_dialog,context.link.focusElement=link_dialog.getElementsByClassName("sun-editor-id-link-url")[0],context.link.linkAnchorText=link_dialog.getElementsByClassName("sun-editor-id-link-text")[0],context.link.linkNewWindowCheck=link_dialog.getElementsByClassName("sun-editor-id-link-check")[0];let link_button=eval(this.setController_LinkButton(core.lang));context.link.linkBtn=link_button,context.link._linkAnchor=null,link_dialog.getElementsByClassName("btn-primary")[0].addEventListener("click",this.submit.bind(core)),link_button.addEventListener("click",this.onClick_linkBtn.bind(core)),context.dialog.modal.appendChild(link_dialog),context.element.relative.appendChild(link_button),link_dialog=null,link_button=null},setDialog:function(e){const t=document.createElement("DIV");return t.className="modal-content sun-editor-id-dialog-link",t.style.display="none",t.innerHTML='",t},setController_LinkButton:function(e){const t=document.createElement("DIV");return t.className="sun-editor-id-link-btn",t.style.display="none",t.innerHTML='
',t},submit:function(e){this.showLoading(),e.preventDefault(),e.stopPropagation();const t=function(){if(0===this.context.link.focusElement.value.trim().length)return!1;const e=this.context.link.focusElement.value,t=this.context.link.linkAnchorText||this.context.dialog.document.getElementById("linkAnchorText"),i=0===t.value.length?e:t.value;if(this.context.dialog.updateModal)this.context.link._linkAnchor.href=e,this.context.link._linkAnchor.textContent=i,this.context.link._linkAnchor.target=this.context.link.linkNewWindowCheck.checked?"_blank":"",this.setRange(this.context.link._linkAnchor.childNodes[0],0,this.context.link._linkAnchor.childNodes[0],this.context.link._linkAnchor.textContent.length);else{const t=document.createElement("A");t.href=e,t.textContent=i,t.target=this.context.link.linkNewWindowCheck.checked?"_blank":"",this.insertNode(t),this.setRange(t.childNodes[0],0,t.childNodes[0],t.textContent.length)}this.context.link.focusElement.value="",this.context.link.linkAnchorText.value=""}.bind(this);try{t()}finally{this.plugins.dialog.closeDialog.call(this),this.closeLoading(),this.focus()}return!1},call_controller_linkButton:function(e){this.editLink=this.context.link._linkAnchor=e;const t=this.context.link.linkBtn;t.getElementsByTagName("A")[0].href=e.href,t.getElementsByTagName("A")[0].textContent=e.textContent;const i=this.util.getOffset(e);t.style.left=i.left-this.context.element.wysiwyg.scrollLeft+"px",t.style.top=i.top+e.offsetHeight+10+"px",t.style.display="block",this.controllerArray=[t]},onClick_linkBtn:function(e){e.stopPropagation();const t=e.target.getAttribute("data-command")||e.target.parentNode.getAttribute("data-command");t&&(e.preventDefault(),/update/.test(t)?(this.context.link.focusElement.value=this.context.link._linkAnchor.href,this.context.link.linkAnchorText.value=this.context.link._linkAnchor.textContent,this.context.link.linkNewWindowCheck.checked=!!/_blank/i.test(this.context.link._linkAnchor.target),this.plugins.dialog.openDialog.call(this,"link",null,!0)):(this.util.removeItem(this.context.link._linkAnchor),this.context.link._linkAnchor=null,this.focus()),this.controllersOff())},init:function(){const e=this.context.link;e.linkBtn.style.display="none",e._linkAnchor=null,e.focusElement.value="",e.linkAnchorText.value="",e.linkNewWindowCheck.checked=!1}}},VquE:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_exports__.a={name:"table",add:function(core,targetElement){const context=core.context;context.table={_element:null,_tdElement:null,_trElement:null,_trElements:null,_tdIndex:0,_trIndex:0,_tdCnt:0,_trCnt:0,_tableXY:[]};let listDiv=eval(this.setSubmenu()),tablePicker=listDiv.getElementsByClassName("sun-editor-id-table-picker")[0];context.table.tableHighlight=listDiv.getElementsByClassName("sun-editor-id-table-highlighted")[0],context.table.tableUnHighlight=listDiv.getElementsByClassName("sun-editor-id-table-unhighlighted")[0],context.table.tableDisplay=listDiv.getElementsByClassName("sun-editor-table-display")[0];let resizeDiv=eval(this.setController_tableEditor(core.lang));context.table.resizeDiv=resizeDiv,tablePicker.addEventListener("mousemove",this.onMouseMove_tablePicker.bind(core)),tablePicker.addEventListener("click",this.appendTable.bind(core)),resizeDiv.addEventListener("click",this.onClick_resizeDiv.bind(core)),targetElement.parentNode.appendChild(listDiv),context.element.relative.appendChild(resizeDiv),listDiv=null,tablePicker=null,resizeDiv=null},setSubmenu:function(){const e=document.createElement("DIV");return e.className="table-content",e.style.display="none",e.innerHTML='
1 x 1
',e},setController_tableEditor:function(e){const t=document.createElement("DIV");return t.className="sun-editor-id-table-edit",t.style.display="none",t.innerHTML='
',t},appendTable:function(){const e=document.createElement("TABLE");let t=this.context.table._tableXY[0],i=this.context.table._tableXY[1],n="";for(;i>0;){n+="";let e=t;for(;e>0;)n+="",--e;n+="",--i}n+="",e.innerHTML=n;const o=this.util.getFormatElement(this.getSelectionNode());this.insertNode(e,/^LI$/i.test(o.nodeName)?this.util.getRangeFormatElement(o):o),this.appendFormatTag(e),this.focus(),this.plugins.table.reset_table_picker.call(this)},onMouseMove_tablePicker:function(e){e.stopPropagation();let t=Math.ceil(e.offsetX/18),i=Math.ceil(e.offsetY/18);t=t<1?1:t,i=i<1?1:i,this.context.table.tableHighlight.style.width=t+"em",this.context.table.tableHighlight.style.height=i+"em";let n=t<5?5:t>9?10:t+1,o=i<5?5:i>9?10:i+1;this.context.table.tableUnHighlight.style.width=n+"em",this.context.table.tableUnHighlight.style.height=o+"em",this.util.changeTxt(this.context.table.tableDisplay,t+" x "+i),this.context.table._tableXY=[t,i]},reset_table_picker:function(){if(!this.context.table.tableHighlight)return;const e=this.context.table.tableHighlight.style,t=this.context.table.tableUnHighlight.style;e.width="1em",e.height="1em",t.width="5em",t.height="5em",this.util.changeTxt(this.context.table.tableDisplay,"1 x 1"),this.submenuOff()},init:function(){const e=this.context.table;e._tdElement&&this.util.removeClass(e._tdElement,"sun-editor-selected-cell"),e._element=null,e._tdElement=null,e._trElement=null,e._trElements=0,e._tdIndex=0,e._trIndex=0,e._trCnt=0,e._tdCnt=0,e._tableXY=[]},call_controller_tableEdit:function(e){const t=this.context.table.resizeDiv;this.plugins.table.setPositionControllerDiv.call(this,e,!1),t.style.display="block",this.controllerArray=[t],this.controllerFunction=[this.plugins.table.init.bind(this)]},setPositionControllerDiv:function(e,t){const i=this.context.table,n=i.resizeDiv;let o=i._element;if(!o){for(o=e;!/^TABLE$/i.test(o.nodeName);)o=o.parentNode;i._element=o}i._tdElement!==e&&(i._tdElement&&this.util.removeClass(i._tdElement,"sun-editor-selected-cell"),this.util.addClass(e,"sun-editor-selected-cell"),i._tdElement=e,i._trElement=e.parentNode),(t||0===i._trCnt)&&(i._trElements=o.rows,i._tdIndex=e.cellIndex,i._trIndex=i._trElement.rowIndex,i._trCnt=o.rows.length,i._tdCnt=i._trElement.cells.length);const l=this.util.getOffset(e);n.style.left=l.left-this.context.element.wysiwyg.scrollLeft+"px",n.style.top=l.top+e.offsetHeight+12+"px"},insertRowCell:function(e,t){const i=this.context.table;if("row"===e){const e="up"===t?i._trIndex:i._trIndex+1;let n="";for(let e=0,t=i._tdCnt;e";i._element.insertRow(e).innerHTML=n}else{const e=i._trElements,n="left"===t?i._tdIndex:i._tdIndex+1;for(let t=0,o=i._trCnt;t'+e.toolbar.alignLeft+'
  • ",t},pickup:function(e){e.preventDefault(),e.stopPropagation();let t=e.target,i=null;for(;!i&&!/UL/i.test(t.tagName);)i=t.getAttribute("data-command"),t=t.parentNode;this.focus(),this.execCommand(i,!1,null),this.submenuOff()}}},WUQj:function(e,t,i){},WzUB:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_exports__.a={name:"formatBlock",add:function(core,targetElement){let listDiv=eval(this.setSubmenu(core.lang));listDiv.getElementsByTagName("UL")[0].addEventListener("click",this.pickUp.bind(core)),targetElement.parentNode.appendChild(listDiv),listDiv=null},setSubmenu:function(e){const t=document.createElement("DIV");return t.className="layer_editor layer_block",t.style.display="none",t.innerHTML='
    ",t},pickUp:function(e){e.preventDefault(),e.stopPropagation();let t=e.target,i=null,n=null;for(;!i&&!/UL/i.test(t.tagName);)i=t.getAttribute("data-command"),n=t.getAttribute("data-value"),t=t.parentNode;if("range"===i){const e=document.createElement(n);this.wrapToTags(e),this.setRange(e.firstChild,0,e.firstChild,0),this.appendFormatTag(e,this.util.isCell(this.getSelectionNode())?"DIV":"")}else this.execCommand("formatBlock",!1,n),this.util.changeTxt(this.commandMap.FORMAT,n);this.submenuOff(),this.focus()}}},XJR1:function(e,t,i){"use strict";i.r(t);i("3FqI"),i("WUQj");var n=i("WRt5"),o=i("50IV"),l=i("MIhV"),s=i("0A7J"),a=i("s0fJ"),r=i("g4XY"),d=i("gMuy"),c=i("VquE"),u=i("WzUB"),m=i("Rp48"),g=i("KKur"),h=i("hlhS"),p={align:n.a,font:o.a,fontSize:l.a,fontColor:s.a,hiliteColor:a.a,horizontalRule:r.a,list:d.a,table:c.a,formatBlock:u.a,link:m.a,image:g.a,video:h.a};var _={getXMLHttpRequest:function(){if(!window.ActiveXObject)return window.XMLHttpRequest?new XMLHttpRequest:null;try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){return null}}},copyObj:function(e){const t={};for(let i in e)t[i]=e[i];return t},getIncludePath:function(e,t){let i="";const n=[],o="js"===t?"script":"link",l="js"===t?"src":"href";let s="(?:";for(let t=0,i=e.length;t0?n[0][l]:""),-1===i.indexOf(":/")&&"//"!==i.slice(0,2)&&(i=0===i.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+i:location.href.match(/^[^\?]*\/(?:)/)[0]+i),!i)throw"[SUNEDITOR.util.getIncludePath.fail] The SUNEDITOR installation path could not be automatically detected. (name: +"+name+", extension: "+t+")";return i},convertContentsForEditor:function(e){let t,i,n="";e=e.trim();for(let o=0,l=(t=document.createRange().createContextualFragment(e).childNodes).length;o0&&(n+="

    "+t+"

    ")}else n+=i;const o={"&":"&"," ":" ","'":""","<":"<",">":">"};return e=e.replace(/&|\u00A0|'|<|>/g,function(e){return"string"==typeof o[e]?o[e]:e}),0===n.length&&(n="

    "+(e.length>0?e:"")+"

    "),n},convertHTMLForCodeView:function(e){return e.replace(/\s*<(?:li|td)\s*(?:[a-z\-]+)?\s*(?:="?[^>]*"?)?\s*>/gi,this._insertIndent).replace(/<\/?(?:blockquote|hr|ol|ul|table|tbody|thead|th|tr)\s*(?:[a-z\-]+)?\s*(?:="?[^>]*"?)?\s*>(?=[^\n])/gi,this._insertLineBreak).replace(/<\/(?:p|div|h[1-6]|li|td|pre)>(?=[^\n])/gi,this._insertLineBreak)},_insertIndent:function(e){return" "+e.trim()},_insertLineBreak:function(e){return e+"\n"},isWysiwygDiv:function(e){return!(!e||1!==e.nodeType||!this.hasClass(e,"sun-editor-id-wysiwyg"))},isFormatElement:function(e){return!(!e||1!==e.nodeType||!/^(?:P|DIV|H[1-6]|LI)$/i.test(e.nodeName)||/sun-editor-id-comp/.test(e.className))},isRangeFormatElement:function(e){return!(!e||1!==e.nodeType||!/^(?:BLOCKQUOTE|TH|TD|OL|UL|PRE)$/i.test(e.nodeName))},getFormatElement:function(e){if(!e)return null;for(;!this.isFormatElement(e)&&!this.isWysiwygDiv(e.parentNode);)e=e.parentNode;if(this.isWysiwygDiv(e)||this.isRangeFormatElement(e)){return this.getListChildren(e,function(e){return this.isFormatElement(e)}.bind(this))[0]}return e},getRangeFormatElement:function(e){if(!e)return null;for(;!this.isRangeFormatElement(e)&&!this.isWysiwygDiv(e);)e=e.parentNode;return this.isWysiwygDiv(e)?null:e},getArrayIndex:function(e,t){let i=-1;for(let n=0,o=e.length;n0){for(let t=0;t0){for(let e=0;e":i)},focus:function(){if("none"===e.element.wysiwyg.style.display)return;const i=t.getParentElement(this.getSelectionNode(),"figcaption");i?i.focus():e.element.wysiwyg.focus(),this._setEditorRange(),l._findButtonEffectTag()},_setEditorRange:function(){const e=window.getSelection();let t=null;t=e.rangeCount>0?e.getRangeAt(0):this._createDefaultRange(),this._variable.range=t,t.collapsed?this.setSelectionNode(t.commonAncestorContainer):this.setSelectionNode(e.extentNode||e.anchorNode)},_createDefaultRange:function(){const t=document.createRange();return t.setStart(e.element.wysiwyg.firstChild,0),t.setEnd(e.element.wysiwyg.firstChild,0),t},setRange:function(e,t,i,n){const o=document.createRange();o.setStart(e,t),o.setEnd(i,n);const l=window.getSelection();l.rangeCount>0&&l.removeAllRanges(),this._variable.range=o,l.addRange(o)},getRange:function(){return this._variable.range||this._createDefaultRange()},setSelectionNode:function(e){this._variable.selectionNode=e},getSelectionNode:function(){return this._variable.selectionNode?this._variable.selectionNode:e.element.wysiwyg.firstChild},getSelectedFormatElements:function(){const e=this.getRange(),i=e.startContainer,n=e.endContainer,o=e.commonAncestorContainer,l=[];if(!t.isWysiwygDiv(o)&&!t.isRangeFormatElement(o))return[t.getFormatElement(o)];const s=t.getListChildren(o,function(e){return t.isFormatElement(e)});if(i===n)return s[0];let a=t.getFormatElement(i),r=t.getFormatElement(n),d=0,c=0;for(let e=0,t=s.length;e=0;e--)d[e]===t.parentNode&&d[e].firstChild===t&&0===n&&(c=e,t=t.parentNode);for(let e=u-1,t=o;e>c;e--)d[e]===t.parentNode&&1===d[e].nodeType&&(d.splice(e,1),t=t.parentNode,--u);for(let e=c;e<=u;e++){const s=d[e];0===s.length||3===s.nodeType&&void 0===s.data?t.removeItem(s):s!==i?s!==o?t.removeItem(s):(r=1===o.nodeType?document.createTextNode(o.textContent):document.createTextNode(o.substringData(l,o.length-l))).length>0?o.data=r.data:t.removeItem(o):(a=1===i.nodeType?document.createTextNode(i.textContent):document.createTextNode(i.substringData(0,n))).length>0?i.data=a.data:t.removeItem(i)}},wrapToTags:function(e){const i=this.getRange(),n=this.getSelectedFormatElements();if(!n){const i=document.createElement(t.isCell(this.getSelectionNode())?"DIV":"P");return i.innerHTML="",e.appendChild(i),void this.getSelectionNode().appendChild(e)}let o,l,s,a=n[n.length-1];o=t.isRangeFormatElement(a)||t.isFormatElement(a)?a:t.getRangeFormatElement(a)||t.getFormatElement(a),t.isCell(o)?(l=null,s=o):(l=o.nextSibling,s=o.parentNode);let r=null,d=null,c="";for(let t=0,i=n.length;t0&&(i=e.style.cssText.replace(u,"").trim()),(i.length>0||e.nodeName!==d)&&(e.style.cssText.length>0&&(e.style.cssText=i),!0)};if(o===s){if(!(c=e.cloneNode(!1)))return;if(n.collapsed){if(c.innerHTML="",t.isFormatElement(o))o.appendChild(c);else{const e=3===o.nodeType?o.parentNode:o,t=3===r.nodeType?r.splitText(a):null;e.insertBefore(c,t)}m.container=c,m.offset=1,g.container=c,g.offset=1}else{if(1===o.nodeType)c.innerHTML=h(o)?o.outerHTML:o.innerHTML,o.parentNode.appendChild(c),t.removeItem(o);else{const e=document.createTextNode(o.substringData(0,l)),i=document.createTextNode(o.substringData(a,o.length-a)),n=o.parentNode;c.innerText=o.substringData(l,a-l),0!==e.data.length||0!==i.data.length||h(n)||t.isFormatElement(n)?(n.insertBefore(c,o.nextSibling),e.data.length>0?o.data=e.data:o.data=o.substringData(0,l),i.data.length>0&&n.insertBefore(i,c.nextSibling)):(n.parentNode.insertBefore(c,n.nextSibling),t.removeItem(n))}m.container=c,m.offset=0,g.container=c,g.offset=1}}else if(t.isWysiwygDiv(r)||t.isRangeFormatElement(r)){const t=this.getSelectedFormatElements(),i=t.length-1;c=e.cloneNode(!1),m=this._wrapLineNodesStart(t[0],c,h,o,l);for(let n=1;n0?(c=e.cloneNode(!1),g=this._wrapLineNodesEnd(t[i],c,h,s,a)):g=m}else{c=e.cloneNode(!1);const i=this._wrapLineNodesOneLine(t.getFormatElement(r),c,h,o,l,s,a);m.container=i.startContainer,m.offset=i.startOffset,g.container=i.endContainer,g.offset=i.endOffset}this.setRange(m.container,m.offset,g.container,g.offset)},_wrapLineNodesOneLine:function(e,i,n,o,l,s,a){const r=e,d=e.cloneNode(!1);let c,u,m,g,h=o,p=l,_=s,f=a,b=!1,v=!1;function y(e){const t=new RegExp("(?:;|^|\\s)(?:"+g+"null)\\s*:[^;]*\\s*(?:;|$)","ig");let i="";return t&&e.style.cssText.length>0&&(i=t.test(e.style.cssText)),!i}return function e(o,l){const s=o.childNodes;for(let o=0,a=s.length;o0&&""!==a.textContent||t.isBreak(a)){let o;if(!b&&1===h.nodeType&&3===a.nodeType){let e;e=h.firstChild&&3===h.firstChild.nodeType?h.firstChild:a,p=e.length,h=e}if(!b&&a===h){const e=document.createTextNode(h.substringData(0,p)),t=document.createTextNode(h.substringData(p,h.length-p));for(e.data.length>0&&l.appendChild(e),u=a,c=[],g="";u!==d&&u!==r&&null!==u;)n(u)&&1===u.nodeType&&y(u)&&(c.push(u.cloneNode(!1)),g+=u.style.cssText.substr(0,u.style.cssText.indexOf(":"))+"|"),u=u.parentNode;const o=c.pop()||t;for(m=u=o;c.length>0;)u=c.pop(),m.appendChild(u),m=u;i.appendChild(o),d.appendChild(i),h=t,p=0,b=!0,u!==t&&u.appendChild(h);continue}if(!v&&a===_){const e=document.createTextNode(_.substringData(f,_.length-f)),t=document.createTextNode(_.substringData(0,f));if(e.data.length>0){for(u=a,g="",c=[];u!==d&&u!==r&&null!==u;)1===u.nodeType&&y(u)&&(c.push(u.cloneNode(!1)),g+=u.style.cssText.substr(0,u.style.cssText.indexOf(":"))+"|"),u=u.parentNode;for(o=m=u=c.pop()||e;c.length>0;)u=c.pop(),m.appendChild(u),m=u;d.appendChild(o),u.textContent=e.data}for(u=a,c=[],g="";u!==d&&u!==r&&null!==u;)n(u)&&1===u.nodeType&&y(u)&&(c.push(u.cloneNode(!1)),g+=u.style.cssText.substr(0,u.style.cssText.indexOf(":"))+"|"),u=u.parentNode;const l=c.pop()||t;for(m=u=l;c.length>0;)u=c.pop(),m.appendChild(u),m=u;i.appendChild(l),_=t,f=t.data.length,v=!0,u!==t&&u.appendChild(_);continue}if(b){if(1===a.nodeType&&!t.isBreak(a)){e(a,a);continue}for(u=a,c=[],g="";null!==u.parentNode&&u!==r&&u!==i;)1===u.nodeType&&!t.isBreak(a)&&(v||n(u))&&y(u)&&(c.push(u.cloneNode(!1)),g+=u.style.cssText.substr(0,u.style.cssText.indexOf(":"))+"|"),u=u.parentNode;const o=c.pop()||a;for(m=u=o;c.length>0;)u=c.pop(),m.appendChild(u),m=u;o===a?l=v?d:i:v?(d.appendChild(o),l=u):(i.appendChild(o),l=u)}o=a.cloneNode(!1),l.appendChild(o),1!==a.nodeType||t.isBreak(a)||(x=o)}e(a,x)}}(e,d),t.removeEmptyNode(d),e.parentNode.insertBefore(d,e),t.removeItem(e),{startContainer:h,startOffset:p,endContainer:_,endOffset:f}},_wrapLineNodes:function(e,i,n){!function e(i,o){const l=i.childNodes;for(let i=0,s=l.length;i0&&""!==s.textContent||t.isBreak(s))){let e=s.cloneNode(!1);o.appendChild(e),1===s.nodeType&&(a=e)}e(s,a)}}(e,i),e.innerHTML="",e.appendChild(i)},_wrapLineNodesStart:function(e,i,n,o,l){const s=e,a=e.cloneNode(!1);let r,d,c,u=o,m=l,g=!1;return function e(o,l){const h=o.childNodes;for(let o=0,p=h.length;o0){const e=r.pop();for(c=d=e;r.length>0;)d=r.pop(),c.appendChild(d),c=d;i.appendChild(e),l=d}else l=i}if(g||p!==u){if((!g||n(p))&&(p.textContent.length>0&&""!==p.textContent||t.isBreak(p))){const e=p.cloneNode(!1);l.appendChild(e),1===p.nodeType&&(_=e)}e(p,_)}else{const e=document.createTextNode(u.substringData(0,m)),t=document.createTextNode(u.substringData(m,u.length-m));for(e.data.length>0&&l.appendChild(e),d=l,r=[];d!==a&&null!==d;)1===d.nodeType&&n(d)&&r.push(d.cloneNode(!1)),d=d.parentNode;const o=r.pop()||l;for(c=d=o;r.length>0;)d=r.pop(),c.appendChild(d),c=d;o!==l?(i.appendChild(o),l=d):l=i,a.appendChild(i),u=t,m=0,g=!0,l.appendChild(u)}}}(e,a),e.parentNode.insertBefore(a,e),t.removeItem(e),{container:u,offset:m}},_wrapLineNodesEnd:function(e,i,n,o,l){const s=e,a=e.cloneNode(!1);let r,d,c,u=o,m=l,g=!1;return function e(o,l){const h=o.childNodes;for(let o=h.length-1;0<=o;o--){const p=h[o];let _=l;if(g&&!t.isBreak(p)){if(1===p.nodeType){e(p,p);continue}for(d=p,r=[];null!==d.parentNode&&d!==s&&d!==i;)n(d)&&1===d.nodeType&&r.push(d.cloneNode(!1)),d=d.parentNode;if(r.length>0){const e=r.pop();for(c=d=e;r.length>0;)d=r.pop(),c.appendChild(d),c=d;i.insertBefore(e,i.firstChild),l=d}else l=i}if(g||p!==u){if((!g||n(p))&&(p.textContent.length>0&&""!==p.textContent||t.isBreak(p))){const e=p.cloneNode(!1);l.insertBefore(e,l.firstChild),1===p.nodeType&&(_=e)}e(p,_)}else{const e=document.createTextNode(u.substringData(m,u.length-m)),t=document.createTextNode(u.substringData(0,m));for(e.data.length>0&&l.insertBefore(e,l.firstChild),d=l,r=[];d!==a&&null!==d;)n(d)&&1===d.nodeType&&r.push(d.cloneNode(!1)),d=d.parentNode;const o=r.pop()||l;for(c=d=o;r.length>0;)d=r.pop(),c.appendChild(d),c=d;o!==l?(i.insertBefore(o,i.firstChild),l=d):l=i,a.insertBefore(i,a.firstChild),u=t,m=t.data.length,g=!0,l.insertBefore(u,l.firstChild)}}}(e,a),e.parentNode.insertBefore(a,e),t.removeItem(e),{container:u,offset:m}},commandHandler:function(i,n){switch(n){case"codeView":this.controllersOff(),this.toggleCodeView(),t.toggleClass(i,"on");break;case"fullScreen":this.controllersOff(),this.toggleFullScreen(i),t.toggleClass(i,"on");break;case"indent":case"outdent":this.indent(n);break;case"redo":case"undo":case"removeFormat":this.execCommand(n,!1,null);break;case"preview":case"print":this.openWindowContents(n);break;case"showBlocks":this.toggleDisplayBlocks(),t.toggleClass(i,"on");break;case"subscript":t.hasClass(e.tool.superscript,"on")&&(this.execCommand("superscript",!1,null),t.removeClass(e.tool.superscript,"on")),this.execCommand(n,!1,null),t.toggleClass(i,"on");break;case"superscript":t.hasClass(e.tool.subscript,"on")&&(this.execCommand("subscript",!1,null),t.removeClass(e.tool.subscript,"on")),this.execCommand(n,!1,null),t.toggleClass(i,"on");break;default:this.execCommand(n,!1,i.getAttribute("data-value")),t.toggleClass(i,"on")}},indent:function(e){const t=this.getSelectedFormatElements();let i,n;for(let o=0,l=t.length;o0?e.element.code.scrollHeight+"px":"auto"),this._variable.wysiwygActive=!1,e.element.code.focus();else{const i=e.element.code.value.trim();e.element.wysiwyg.innerHTML=i.length>0?t.convertContentsForEditor(i):"

    

    ",e.element.wysiwyg.scrollTop=0,e.element.code.style.display="none",e.element.wysiwyg.style.display="block","auto"===e.user.height&&(e.element.code.style.height="0px"),this._variable.wysiwygActive=!0,this.focus()}},toggleFullScreen:function(i){this._variable.isFullScreen?(this._variable.isFullScreen=!1,e.element.code.style.cssText=this._variable._codeOriginCssText,e.element.wysiwyg.style.cssText=this._variable._wysiwygOriginCssText,e.element.toolbar.style.cssText="",e.element.editorArea.style.cssText=this._variable._editorAreaOriginCssText,e.element.topArea.style.cssText=this._variable._originCssText,document.body.style.overflow=this._variable._bodyOverflow,e.user.stickyToolbar>-1&&(t.removeClass(e.element.toolbar,"sun-editor-sticky"),l.onScroll_window()),t.removeClass(i.firstElementChild,"icon-reduction"),t.addClass(i.firstElementChild,"icon-expansion")):(this._variable.isFullScreen=!0,e.element.topArea.style.position="fixed",e.element.topArea.style.top="0",e.element.topArea.style.left="0",e.element.topArea.style.width="100%",e.element.topArea.style.height="100%",e.element.topArea.style.zIndex="2147483647",this._variable._bodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden",this._variable._editorAreaOriginCssText=e.element.editorArea.style.cssText,this._variable._wysiwygOriginCssText=e.element.wysiwyg.style.cssText,this._variable._codeOriginCssText=e.element.code.style.cssText,e.element.editorArea.style.cssText=e.element.toolbar.style.cssText=e.element.wysiwyg.style.cssText=e.element.code.style.cssText="",e.element.toolbar.style.width=e.element.wysiwyg.style.height=e.element.code.style.height="100%",e.element.toolbar.style.position="relative",this._variable.innerHeight_fullScreen=window.innerHeight-e.element.toolbar.offsetHeight,e.element.editorArea.style.height=this._variable.innerHeight_fullScreen+"px",t.removeClass(i.firstElementChild,"icon-expansion"),t.addClass(i.firstElementChild,"icon-reduction"))},openWindowContents:function(i){const o="print"===i,l=window.open("","_blank");l.mimeType="text/html",l.document.write(''+(o?n.toolbar.print:n.toolbar.preview)+'
    '+e.element.wysiwyg.innerHTML+"
    "+(o?"