X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=plugins%2Fclipboard%2Fdialogs%2Fpaste.js;h=c67d20502f6e9dec007518df71590fe33ac8f6b7;hp=64d027aed623fbd98c19bba20eb297cfcc54283f;hb=941b0a9ba4e673e292510d80a5a86806994b8ea6;hpb=7cd80714081a8ffdf4a1a8d2c72f120ed5ef3d6d diff --git a/plugins/clipboard/dialogs/paste.js b/plugins/clipboard/dialogs/paste.js index 64d027a..c67d205 100644 --- a/plugins/clipboard/dialogs/paste.js +++ b/plugins/clipboard/dialogs/paste.js @@ -1,7 +1,7 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +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.insertHtml(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=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);}}]}]};});