CKEDITOR.plugins.add("iframedialog",{requires:["dialog"],onLoad:function(){CKEDITOR.dialog.addIframe=function(t,s,r,q,p,o,n){var m={type:"iframe",src:r,width:"100%",height:"100%"};if(typeof o=="function"){m.onContentLoad=o}else{m.onContentLoad=function(){var c=this.getElement(),b=c.$.contentWindow;if(b.onDialogEvent){var a=this.getDialog(),d=function(e){return b.onDialogEvent(e)};a.on("ok",d);a.on("cancel",d);a.on("resize",d);a.on("hide",function(e){a.removeListener("ok",d);a.removeListener("cancel",d);a.removeListener("resize",d);e.removeListener()});b.onDialogEvent({name:"load",sender:this,editor:a._.editor})}}}var l={title:s,minWidth:q,minHeight:p,contents:[{id:"iframe",label:s,expand:true,elements:[m]}]};for(var k in n){l[k]=n[k]}this.add(t,function(){return l})};(function(){var b=function(r,q,p){if(arguments.length<3){return}var o=this._||(this._={}),n=q.onContentLoad&&CKEDITOR.tools.bind(q.onContentLoad,this),m=CKEDITOR.tools.cssLength(q.width),l=CKEDITOR.tools.cssLength(q.height);o.frameId=CKEDITOR.tools.getNextId()+"_iframe";r.on("load",function(){var d=CKEDITOR.document.getById(o.frameId),c=d.getParent();c.setStyles({width:m,height:l})});var k={src:"%2",id:o.frameId,frameborder:0,allowtransparency:true},a=[];if(typeof q.onContentLoad=="function"){k.onload="CKEDITOR.tools.callFunction(%1);"}CKEDITOR.ui.dialog.uiElement.call(this,r,q,a,"iframe",{width:m,height:l},k,"");p.push('<div style="width:'+m+";height:"+l+';" id="'+this.domId+'"></div>');a=a.join("");r.on("show",function(){var e=CKEDITOR.document.getById(o.frameId),d=e.getParent(),c=CKEDITOR.tools.addFunction(n),f=a.replace("%1",c).replace("%2",CKEDITOR.tools.htmlEncode(q.src));d.setHtml(f)})};b.prototype=new CKEDITOR.ui.dialog.uiElement();CKEDITOR.dialog.addUIElement("iframe",{build:function(a,f,e){return new b(a,f,e)}})})()}});