NMandapaty/ArcticVoice

View on GitHub
public/assets/ckeditor/plugins/clipboard/dialogs/paste-e2dfa41471426d3c1d10dda5cce438de1499c5eb9f838f4dcdb73be123584be2.js

Summary

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