CKEDITOR.dialog.add("paste",function(d){function a(e){var c=new CKEDITOR.dom.document(e.document),g=c.getBody(),h=c.getById("cke_actscrpt");h&&h.remove();g.setAttribute("contenteditable",!0);if(CKEDITOR.env.ie&&8>CKEDITOR.env.version){c.getWindow().on("blur",function(){c.$.selection.empty();});}c.on("keydown",function(i){var i=i.data,f;switch(i.getKeystroke()){case 27:this.hide();f=1;break;case 9:case CKEDITOR.SHIFT+9:this.changeFocus(1),f=1;}f&&i.preventDefault();},this);d.fire("ariaWidget",new CKEDITOR.dom.element(e.frameElement));c.getWindow().getFrame().removeCustomData("pendingFocus")&&g.focus();}var b=d.lang.clipboard;d.on("pasteDialogCommit",function(c){c.data&&d.fire("paste",{type:"auto",dataValue:c.data});},null,null,1000);return{title:b.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?370:350,minHeight:CKEDITOR.env.quirks?250:245,onShow:function(){this.parts.dialog.$.offsetHeight;this.setupContent();this.parts.title.setHtml(this.customTitle||b.title);this.customTitle=null;},onLoad:function(){(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&"rtl"==d.lang.dir&&this.parts.contents.setStyle("overflow","hidden");},onOk:function(){this.commitContent();},contents:[{id:"general",label:d.lang.common.generalTab,elements:[{type:"html",id:"securityMsg",html:'<div style="white-space:normal;width:340px">'+b.securityMsg+"</div>"},{type:"html",id:"pasteMsg",html:'<div style="white-space:normal;width:340px">'+b.pasteMsg+"</div>"},{type:"html",id:"editing_area",style:"width:100%;height:100%",html:"",focus:function(){var e=this.getInputElement(),c=e.getFrameDocument().getBody();!c||c.isReadOnly()?e.setCustomData("pendingFocus",1):c.focus();},setup:function(){var e=this.getDialog(),c='<html dir="'+d.config.contentsLangDirection+'" lang="'+(d.config.contentsLanguage||d.langCode)+'"><head><style>body{margin:3px;height:95%}</style></head><body><script id="cke_actscrpt" type="text/javascript">window.parent.CKEDITOR.tools.callFunction('+CKEDITOR.tools.addFunction(a,e)+",this);<\/script></body></html>",i=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie?"javascript:void((function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+'})())"':"",j=CKEDITOR.dom.element.createFromHtml('<iframe class="cke_pasteframe" frameborder="0"  allowTransparency="true" src="'+i+'" role="region" aria-label="'+b.pasteArea+'" aria-describedby="'+e.getContentElement("general","pasteMsg").domId+'" aria-multiple="true"></iframe>');j.on("load",function(f){f.removeListener();f=j.getFrameDocument();f.write(c);d.focusManager.add(f.getBody());CKEDITOR.env.air&&a.call(this,f.getWindow().$);},e);j.setCustomData("dialog",e);e=this.getElement();e.setHtml("");e.append(j);if(CKEDITOR.env.ie){var h=CKEDITOR.dom.element.createFromHtml('<span tabindex="-1" style="position:absolute" role="presentation"></span>');h.on("focus",function(){setTimeout(function(){j.$.contentWindow.focus();});});e.append(h);this.focus=function(){h.focus();this.fire("focus");};}this.getInputElement=function(){return j;};CKEDITOR.env.ie&&(e.setStyle("display","block"),e.setStyle("height",j.$.offsetHeight+2+"px"));},commit:function(){var f=this.getDialog().getParentEditor(),e=this.getInputElement().getFrameDocument().getBody(),h=e.getBogus(),g;h&&h.remove();g=e.getHtml();setTimeout(function(){f.fire("pasteDialogCommit",g);},0);}}]}]};});