jodit-pro
Version:
PRO Version of Jodit Editor
8 lines • 5.05 kB
JavaScript
/*!
* jodit-pro - PRO Version of Jodit Editor
* Author: Chupurnov Valerii <chupurnov@gmail.com>
* Version: v4.9.27
* Url: https://xdsoft.net/jodit/pro/
* License(s): SEE LICENSE IN LICENSE.md
*/
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i=t();for(var o in i)("object"==typeof exports?exports:e)[o]=i[o]}}(self,function(){return(self.webpackChunkjodit_pro=self.webpackChunkjodit_pro||[]).push([[122],{1050:function(e,t,i){"use strict";i.r(t),i.d(t,{IframeEditor:function(){return _}});var o=i(80294),n=i(20616),r=i(67709),a=i(82749),l=i(18766),s=i(23078),u=i(31635);i(88092);var c=i(29744),d=i(65478),f=i(22732),h=i(21537),m=i(50911),g=i(62843),p=i(41409),v=i(2692),_=function(e){function t(){var e;return(0,n._)(this,t),e=(0,o._)(this,t,arguments),(0,a._)(e,"buttons",[{group:"form",name:"iframeEditor"}]),(0,a._)(e,"__dialog",void 0),e}return(0,l._)(t,e),(0,r._)(t,[{key:"afterInit",value:function(e){e.e.on("toggleIframeEditor",this.toggleEditor)}},{key:"toggleEditor",value:function(e){var t,i,o,n,r,a=this;this.__dialog||(this.__dialog=new p.Dialog({language:this.j.o.language,theme:this.j.o.theme}),this.__dialog.setHeader("Iframe Properties").setSize(470,400)),e&&!f.Dom.isTag(e,"iframe")&&(e=void 0);var l=new c.UIIframeEditor(this.__dialog,{src:null!=(t=null==e?void 0:e.src)?t:"",name:null!=(i=null==e?void 0:e.name)?i:"",title:null!=(o=null==e?void 0:e.title)?o:"",frameBorder:(null==e?void 0:e.frameBorder)==="1"||(null==e?void 0:e.frameBorder)==="yes",width:null!=(n=null==e?void 0:e.offsetWidth)?n:700,height:null!=(r=null==e?void 0:e.offsetHeight)?r:400});this.__dialog.setContent(l);var s=this.__dialog;s.isOpened?s.close():(s.setFooter([(0,g.Button)(s,"cancel","Cancel","default").onAction(function(){return s.close()}),(0,g.Button)(s,"ok",e?"Update":"Insert","primary").onAction(function(){if(!l.srcField.value){l.srcField.validate(),l.srcField.focus();return}e||(e=a.j.createInside.element("iframe"),a.j.s.insertNode(e,!0,!1)),e.className=l.state.className||"",(0,h.attr)(e,{src:l.state.src,title:l.state.title,name:l.state.name,frameborder:l.state.frameBorder?"1":"0",width:l.state.width,height:l.state.height}),f.Dom.isTag(e.parentElement,"jodit")&&(0,h.css)(e.parentElement,{width:l.state.width,height:l.state.height}),a.jodit.e.fire("synchro"),s.close()})]).open(),this.jodit.async.requestIdleCallback(function(){l.srcField.focus()}))}},{key:"onDblClick",value:function(e){f.Dom.isTag(e.target,"iframe")&&this.toggleEditor(e.target)}},{key:"beforeDestruct",value:function(e){var t;null==(t=this.__dialog)||t.destruct()}}]),t}((0,s._)(m.Plugin));(0,a._)(_,"requires",["license","color-picker"]),(0,u.__decorate)([d.autobind],_.prototype,"toggleEditor",null),(0,u.__decorate)([(0,d.watch)(":dblclick")],_.prototype,"onDblClick",null),v.JoditPro.plugins.add("iframe-editor",_)},29744:function(e,t,i){"use strict";i.d(t,{UIIframeEditor:function(){return d}});var o=i(80294),n=i(20616),r=i(67709),a=i(82749),l=i(18766),s=i(31635),u=i(87325),c=i(67510),d=function(e){function t(e,i){var r;return(0,n._)(this,t),r=(0,o._)(this,t,[e]),(0,a._)(r,"state",{src:"",className:"",width:400,height:200,frameBorder:!1,enableScrollbars:!1,name:"",title:""}),(0,a._)(r,"srcField",void 0),Object.assign(r.state,i),r.srcField=new c.UIInput(e,{label:"URL",type:"url",required:!0,value:r.state.src,onChange:function(e){r.state.src=e}}),r.append([r.srcField,new c.UIBlock(e,[new c.UIInput(e,{label:"Width",type:"number",value:r.state.width,onChange:function(e){r.state.width=parseInt(e,10)||0}}),new c.UIInput(e,{label:"Height",type:"number",value:r.state.height,onChange:function(e){r.state.height=parseInt(e,10)||0}})],{className:r.getFullElName("block"),align:"center"}),new c.UIBlock(e,[new c.UICheckbox(e,{label:"Show frame border",checked:!!i.frameBorder,onChange:function(e){r.state.frameBorder="true"===e}})]),new c.UIInput(e,{label:"Name",value:r.state.name,type:"text",onChange:function(e){r.state.name=e}}),new c.UIInput(e,{label:"Title",value:r.state.title,type:"text",onChange:function(e){r.state.title=e}})]),r}return(0,l._)(t,e),(0,r._)(t,[{key:"className",value:function(){return"UIIframeEditor"}}]),t}(c.UIGroup);d=(0,s.__decorate)([u.component],d)},67008:function(e){e.exports='<svg viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"> <rect fill="none" height="32" width="32"/> <path d="M28,14H18v2h10V14z M28,18H18v2h10V18z M24,22h-6v2h6V22z M14,14H4v10h10V14z M0,6v26h32V6H0z M30,30H2l0.08-20H30V30z"/> </svg>'},88092:function(e,t,i){"use strict";var o=i(67008),n=i.n(o),r=i(6441),a=i(2748),l=i(68345);r.Config.prototype.controls.iframeEditor={icon:n(),tooltip:"Iframe Editor",exec:function(e,t){a.Dom.isTag(t,"jodit")&&a.Dom.isTag(t.firstElementChild,"iframe")&&(t=t.firstElementChild),e.e.fire("toggleIframeEditor",a.Dom.isTag(t,"iframe")?t:null)}},(0,l.isArray)(r.Config.prototype.popup.iframe)&&r.Config.prototype.popup.iframe.push("iframeEditor")}},function(e){return e(e.s=1050)}])});