X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fpastetext%2Fdialogs%2Fpastetext.js;h=56143df9334bc1b6f5931605c6b6195c127142f3;hp=42a021fe46d4172d81d3bfa31e987caae3229c66;hb=1056598c95187351dc58f4991d331e2258d038b5;hpb=4e90e78dc97789709ee7404359a5517540c27553 diff --git a/_source/plugins/pastetext/dialogs/pastetext.js b/_source/plugins/pastetext/dialogs/pastetext.js index 42a021f..56143df 100644 --- a/_source/plugins/pastetext/dialogs/pastetext.js +++ b/_source/plugins/pastetext/dialogs/pastetext.js @@ -13,23 +13,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license minWidth : CKEDITOR.env.ie && CKEDITOR.env.quirks ? 368 : 350, minHeight : 240, - onShow : function() - { - // Reset the textarea value. - this.getContentElement( 'general', 'content' ).getInputElement().setValue( '' ); - }, - - onOk : function() - { - // Get the textarea value. - var text = this.getContentElement( 'general', 'content' ).getInputElement().getValue(), - editor = this.getParentEditor(); - - setTimeout( function() - { - editor.fire( 'paste', { 'text' : text } ); - }, 0 ); - }, + onShow : function(){ this.setupContent(); }, + onOk : function(){ this.commitContent(); }, contents : [ @@ -60,6 +45,18 @@ For licensing, see LICENSE.html or http://ckeditor.com/license focus : function() { this.getElement().focus(); + }, + setup : function() + { + this.setValue( '' ); + }, + commit : function() + { + var value = this.getValue(); + setTimeout( function() + { + editor.fire( 'paste', { 'text' : value } ); + }, 0 ); } } ]