X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=plugins%2Fclipboard%2Fdialogs%2Fpaste.js;h=9af10373fbed5b67e55fb5ef4855eec01f4acc3d;hp=9a1fca4ca5dd229a27f04741511fc6ebb5bcbf7c;hb=1056598c95187351dc58f4991d331e2258d038b5;hpb=4e90e78dc97789709ee7404359a5517540c27553 diff --git a/plugins/clipboard/dialogs/paste.js b/plugins/clipboard/dialogs/paste.js index 9a1fca4..9af1037 100644 --- a/plugins/clipboard/dialogs/paste.js +++ b/plugins/clipboard/dialogs/paste.js @@ -3,5 +3,5 @@ Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ -CKEDITOR.dialog.add('paste',function(a){var b=a.lang.clipboard,c=CKEDITOR.env.isCustomDomain();function d(e){var f=new CKEDITOR.dom.document(e.document),g=f.$,h=f.getById('cke_actscrpt');h&&h.remove();CKEDITOR.env.ie?g.body.contentEditable='true':g.designMode='on';if(CKEDITOR.env.ie&&CKEDITOR.env.version<8)f.getWindow().on('blur',function(){g.selection.empty();});f.on('keydown',function(i){var j=i.data,k=j.getKeystroke(),l;switch(k){case 27:this.hide();l=1;break;case 9:case CKEDITOR.SHIFT+9:this.changeFocus(true);l=1;}l&&j.preventDefault();},this);a.fire('ariaWidget',new CKEDITOR.dom.element(e.frameElement));};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;var e=''+''+''+'',f=CKEDITOR.env.air?'javascript:void(0)':c?"javascript:void((function(){document.open();document.domain='"+document.domain+"';"+'document.close();'+'})())"':'',g=CKEDITOR.dom.element.createFromHtml('');g.on('load',function(k){k.removeListener();var l=g.getFrameDocument();l.write(e);if(CKEDITOR.env.air)d.call(this,l.getWindow().$);},this);g.setCustomData('dialog',this);var h=this.getContentElement('general','editing_area'),i=h.getElement();i.setHtml('');i.append(g);if(CKEDITOR.env.ie){var j=CKEDITOR.dom.element.createFromHtml('');j.on('focus',function(){g.$.contentWindow.focus();});i.append(j);h.focus=function(){j.focus();this.fire('focus');};}h.getInputElement=function(){return g;};if(CKEDITOR.env.ie){i.setStyle('display','block');i.setStyle('height',g.$.offsetHeight+2+'px');}},onHide:function(){if(CKEDITOR.env.ie)this.getParentEditor().document.getBody().$.contentEditable='true';},onLoad:function(){if((CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&a.lang.dir=='rtl')this.parts.contents.setStyle('overflow','hidden');},onOk:function(){var e=this.getContentElement('general','editing_area').getElement(),f=e.getElementsByTag('iframe').getItem(0),g=this.getParentEditor(),h=f.getFrameDocument().getBody(),i=h.getBogus(),j; -i&&i.remove();j=h.getHtml();setTimeout(function(){g.fire('paste',{html:j});},0);},contents:[{id:'general',label:a.lang.common.generalTab,elements:[{type:'html',id:'securityMsg',html:'
'+b.securityMsg+'
'},{type:'html',id:'pasteMsg',html:'
'+b.pasteMsg+'
'},{type:'html',id:'editing_area',style:'width: 100%; height: 100%;',html:'',focus:function(){var e=this.getInputElement().$.contentWindow;setTimeout(function(){e.focus();},500);}}]}]};}); +CKEDITOR.dialog.add('paste',function(a){var b=a.lang.clipboard,c=CKEDITOR.env.isCustomDomain();function d(e){var f=new CKEDITOR.dom.document(e.document),g=f.$,h=f.getById('cke_actscrpt');h&&h.remove();CKEDITOR.env.ie?g.body.contentEditable='true':g.designMode='on';if(CKEDITOR.env.ie&&CKEDITOR.env.version<8)f.getWindow().on('blur',function(){g.selection.empty();});f.on('keydown',function(i){var j=i.data,k=j.getKeystroke(),l;switch(k){case 27:this.hide();l=1;break;case 9:case CKEDITOR.SHIFT+9:this.changeFocus(true);l=1;}l&&j.preventDefault();},this);a.fire('ariaWidget',new CKEDITOR.dom.element(e.frameElement));};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();},onHide:function(){if(CKEDITOR.env.ie)this.getParentEditor().document.getBody().$.contentEditable='true';},onLoad:function(){if((CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&a.lang.dir=='rtl')this.parts.contents.setStyle('overflow','hidden');},onOk:function(){this.commitContent();},contents:[{id:'general',label:a.lang.common.generalTab,elements:[{type:'html',id:'securityMsg',html:'
'+b.securityMsg+'
'},{type:'html',id:'pasteMsg',html:'
'+b.pasteMsg+'
'},{type:'html',id:'editing_area',style:'width: 100%; height: 100%;',html:'',focus:function(){var e=this.getInputElement().$.contentWindow;setTimeout(function(){e.focus();},500);},setup:function(){var e=this.getDialog(),f=''+''+''+'',g=CKEDITOR.env.air?'javascript:void(0)':c?"javascript:void((function(){document.open();document.domain='"+document.domain+"';"+'document.close();'+'})())"':'',h=CKEDITOR.dom.element.createFromHtml('');h.on('load',function(k){k.removeListener();var l=h.getFrameDocument();l.write(f);if(CKEDITOR.env.air)d.call(this,l.getWindow().$); +},e);h.setCustomData('dialog',e);var i=this.getElement();i.setHtml('');i.append(h);if(CKEDITOR.env.ie){var j=CKEDITOR.dom.element.createFromHtml('');j.on('focus',function(){h.$.contentWindow.focus();});i.append(j);this.focus=function(){j.focus();this.fire('focus');};}this.getInputElement=function(){return h;};if(CKEDITOR.env.ie){i.setStyle('display','block');i.setStyle('height',h.$.offsetHeight+2+'px');}},commit:function(e){var f=this.getElement(),g=this.getDialog().getParentEditor(),h=this.getInputElement().getFrameDocument().getBody(),i=h.getBogus(),j;i&&i.remove();j=h.getHtml();setTimeout(function(){g.fire('paste',{html:j});},0);}}]}]};});