1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/webtrees_ynh.git synced 2024-09-03 18:26:37 +02:00
webtrees_ynh/sources/packages/ckeditor-4.5.2-custom/plugins/clipboard/dialogs/paste.js

1 line
No EOL
3.4 KiB
JavaScript

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){i=i.data;var 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,method:"paste",dataTransfer:CKEDITOR.plugins.clipboard.initPasteDataTransfer()})},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%;word-break:break-all;}</style></head><body><script id="cke_actscrpt" type="text/javascript">window.parent.CKEDITOR.tools.callFunction('+CKEDITOR.tools.addFunction(a,e)+",this);\x3c/script></body></html>",i=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie&&!CKEDITOR.env.edge?"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+'" aria-label="'+b.pasteArea+'" aria-describedby="'+e.getContentElement("general","pasteMsg").domId+'"></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&&!CKEDITOR.env.edge){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)}}]}]}});