X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=plugins%2Fpastetext%2Fplugin.js;h=33eb8cdcb8588c8787cce88d1eca20395a66f103;hb=HEAD;hp=01d00b95ac900720956f8e147c8d654553106478;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;p=ckeditor.git diff --git a/plugins/pastetext/plugin.js b/plugins/pastetext/plugin.js deleted file mode 100644 index 01d00b9..0000000 --- a/plugins/pastetext/plugin.js +++ /dev/null @@ -1,6 +0,0 @@ -/* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. -For licensing, see LICENSE.html or http://ckeditor.com/license -*/ - -(function(){var a={exec:function(c){if(CKEDITOR.getClipboardData()===false||!window.clipboardData){c.openDialog('pastetext');return;}c.insertText(window.clipboardData.getData('Text'));}};CKEDITOR.plugins.add('pastetext',{init:function(c){var d='pastetext',e=c.addCommand(d,a);c.ui.addButton('PasteText',{label:c.lang.pasteText.button,command:d});CKEDITOR.dialog.add(d,CKEDITOR.getUrl(this.path+'dialogs/pastetext.js'));if(c.config.forcePasteAsPlainText)c.on('beforePaste',function(f){if(c.mode=='wysiwyg'){setTimeout(function(){e.exec();},0);f.cancel();}},null,null,20);},requires:['clipboard']});var b;CKEDITOR.getClipboardData=function(){if(!CKEDITOR.env.ie)return false;var c=CKEDITOR.document,d=c.getBody();if(!b){b=c.createElement('div',{attributes:{id:'cke_hiddenDiv'},styles:{position:'absolute',visibility:'hidden',overflow:'hidden',width:'1px',height:'1px'}});b.setHtml('');b.appendTo(d);}var e=false,f=function(){e=true;};d.on('paste',f);var g=d.$.createTextRange();g.moveToElementText(b.$);g.execCommand('Paste');var h=b.getHtml();b.setHtml('');d.removeListener('paste',f);return e&&h;};})();CKEDITOR.editor.prototype.insertText=function(a){a=CKEDITOR.tools.htmlEncode(a);a=a.replace(/(?:\r\n)|\n|\r/g,'
');this.insertHtml(a);};CKEDITOR.config.forcePasteAsPlainText=false;