X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fpastetext%2Fdialogs%2Fpastetext.js;h=56143df9334bc1b6f5931605c6b6195c127142f3;hb=1056598c95187351dc58f4991d331e2258d038b5;hp=9ff4f7491b8c684d7d9166d3e2263625f1c5f5a5;hpb=059b4c2fef02528bf1af189f7996e80652faddfb;p=ckeditor.git diff --git a/_source/plugins/pastetext/dialogs/pastetext.js b/_source/plugins/pastetext/dialogs/pastetext.js index 9ff4f74..56143df 100644 --- a/_source/plugins/pastetext/dialogs/pastetext.js +++ b/_source/plugins/pastetext/dialogs/pastetext.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -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 : [ @@ -44,29 +29,34 @@ For licensing, see LICENSE.html or http://ckeditor.com/license html : '
' + editor.lang.clipboard.pasteMsg + '
' }, { - type : 'html', + type : 'textarea', id : 'content', - style : 'width:340px;height:170px', - html : - '', + className : 'cke_pastetext', onLoad : function() { var label = this.getDialog().getContentElement( 'general', 'pasteMsg' ).getElement(), - input = this.getElement(); + input = this.getElement().getElementsByTag( 'textarea' ).getItem( 0 ); input.setAttribute( 'aria-labelledby', label.$.id ); + input.setStyle( 'direction', editor.config.contentsLangDirection ); }, focus : function() { this.getElement().focus(); + }, + setup : function() + { + this.setValue( '' ); + }, + commit : function() + { + var value = this.getValue(); + setTimeout( function() + { + editor.fire( 'paste', { 'text' : value } ); + }, 0 ); } } ]