X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=plugins%2Fclipboard%2Fdialogs%2Fpaste.js;h=6094b246aa761079ca28f475c674acfd40a4f778;hp=c67d20502f6e9dec007518df71590fe33ac8f6b7;hb=059b4c2fef02528bf1af189f7996e80652faddfb;hpb=c6e377a02b54abc07129d72b632763c727476a15 diff --git a/plugins/clipboard/dialogs/paste.js b/plugins/clipboard/dialogs/paste.js index c67d205..6094b24 100644 --- a/plugins/clipboard/dialogs/paste.js +++ b/plugins/clipboard/dialogs/paste.js @@ -3,5 +3,5 @@ Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ -CKEDITOR.dialog.add('paste',function(a){var b=CKEDITOR.env.isCustomDomain();return{title:a.lang.clipboard.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?370:350,minHeight:CKEDITOR.env.quirks?250:245,htmlToLoad:'',onShow:function(){var h=this;if(CKEDITOR.env.ie)h.getParentEditor().document.getBody().$.contentEditable='false';h.parts.dialog.$.offsetHeight;var c=h.getContentElement('general','editing_area').getElement(),d=CKEDITOR.dom.element.createFromHtml(''),e=h.getParentEditor().lang;d.setStyles({width:'346px',height:'130px','background-color':'white',border:'1px solid black'});d.setCustomData('dialog',h);var f=e.editorTitle.replace('%1',e.clipboard.title);if(CKEDITOR.env.ie)c.setHtml(''+CKEDITOR.tools.htmlEncode(f)+'');else{c.setHtml('');c.setAttributes({role:'region',title:f});d.setAttributes({role:'region',title:' '});}c.append(d);if(CKEDITOR.env.ie)c.setStyle('height',d.$.offsetHeight+2+'px');if(b){CKEDITOR._cke_htmlToLoad=h.definition.htmlToLoad;d.setAttribute('src','javascript:void( (function(){document.open();document.domain="'+document.domain+'";'+'document.write( window.parent.CKEDITOR._cke_htmlToLoad );'+'delete window.parent.CKEDITOR._cke_htmlToLoad;'+'document.close();'+'})() )');}else{var g=d.$.contentWindow.document;g.open();g.write(h.definition.htmlToLoad);g.close();}},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 c=this.getContentElement('general','editing_area').getElement(),d=c.getElementsByTag('iframe').getItem(0),e=this.getParentEditor(),f=d.$.contentWindow.document.body.innerHTML;setTimeout(function(){e.fire('paste',{html:f}); -},0);},contents:[{id:'general',label:a.lang.common.generalTab,elements:[{type:'html',id:'securityMsg',html:'
'+a.lang.clipboard.securityMsg+'
'},{type:'html',id:'pasteMsg',html:'
'+a.lang.clipboard.pasteMsg+'
'},{type:'html',id:'editing_area',style:'width: 100%; height: 100%;',html:'
',focus:function(){var c=this.getElement(),d=c.getElementsByTag('iframe');if(d.count()<1)return;d=d.getItem(0);setTimeout(function(){d.$.contentWindow.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.$;f.getById('cke_actscrpt').remove();CKEDITOR.env.ie?g.body.contentEditable='true':g.designMode='on';CKEDITOR.env.ie&&f.getWindow().on('blur',function(){g.body.contentEditable='false';});f.on('keydown',function(h){var i=h.data,j=i.getKeystroke(),k;switch(j){case 27:this.hide();k=1;break;case 9:case CKEDITOR.SHIFT+9:this.changeFocus(true);k=1;}k&&i.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.dom.element.createFromHtml('');f.on('load',function(i){i.removeListener();var j=f.getFrameDocument().$;j.open();if(c)j.domain=document.domain;j.write(e);j.close();},this);f.setStyles({width:'346px',height:'130px','background-color':'white',border:'1px solid black'});f.setCustomData('dialog',this);var g=this.getContentElement('general','editing_area'),h=g.getElement();h.setHtml('');h.append(f);g.getInputElement=function(){return f;};if(CKEDITOR.env.ie){h.setStyle('display','block');h.setStyle('height',f.$.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.$.contentWindow.document.body.innerHTML;setTimeout(function(){g.fire('paste',{html:h});},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,f=e&&e.document.body; +setTimeout(function(){CKEDITOR.env.ie&&f&&(f.contentEditable='true');e.focus();},500);}}]}]};});