X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fforms%2Fdialogs%2Ftextarea.js;h=dffab657d807231805465416dcb053a9abf82d29;hb=a272c66d841421f8bf933c16535bdcde1c4649fc;hp=df29235fb33efde65d97598fbf9f5c219c059d2b;hpb=48b1db88210b4160dce439c6e3e32e14af8c106b;p=ckeditor.git diff --git a/_source/plugins/forms/dialogs/textarea.js b/_source/plugins/forms/dialogs/textarea.js index df29235..dffab65 100644 --- a/_source/plugins/forms/dialogs/textarea.js +++ b/_source/plugins/forms/dialogs/textarea.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add( 'textarea', function( editor ) @@ -7,7 +7,7 @@ CKEDITOR.dialog.add( 'textarea', function( editor ) return { title : editor.lang.textarea.title, minWidth : 350, - minHeight : 150, + minHeight : 220, onShow : function() { delete this.textarea; @@ -66,47 +66,68 @@ CKEDITOR.dialog.add( 'textarea', function( editor ) } }, { - id : 'cols', - type : 'text', - label : editor.lang.textarea.cols, - 'default' : '', - accessKey : 'C', - style : 'width:50px', - validate : CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed ), - setup : function( element ) - { - var value = element.hasAttribute( 'cols' ) && element.getAttribute( 'cols' ); - this.setValue( value || '' ); - }, - commit : function( element ) - { - if ( this.getValue() ) - element.setAttribute( 'cols', this.getValue() ); - else - element.removeAttribute( 'cols' ); - } + type : 'hbox', + widths:['50%','50%'], + children:[ + { + id : 'cols', + type : 'text', + label : editor.lang.textarea.cols, + 'default' : '', + accessKey : 'C', + style : 'width:50px', + validate : CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed ), + setup : function( element ) + { + var value = element.hasAttribute( 'cols' ) && element.getAttribute( 'cols' ); + this.setValue( value || '' ); + }, + commit : function( element ) + { + if ( this.getValue() ) + element.setAttribute( 'cols', this.getValue() ); + else + element.removeAttribute( 'cols' ); + } + }, + { + id : 'rows', + type : 'text', + label : editor.lang.textarea.rows, + 'default' : '', + accessKey : 'R', + style : 'width:50px', + validate : CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed ), + setup : function( element ) + { + var value = element.hasAttribute( 'rows' ) && element.getAttribute( 'rows' ); + this.setValue( value || '' ); + }, + commit : function( element ) + { + if ( this.getValue() ) + element.setAttribute( 'rows', this.getValue() ); + else + element.removeAttribute( 'rows' ); + } + } + ] }, { - id : 'rows', - type : 'text', - label : editor.lang.textarea.rows, + id : 'value', + type : 'textarea', + label : editor.lang.textfield.value, 'default' : '', - accessKey : 'R', - style : 'width:50px', - validate : CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed ), setup : function( element ) { - var value = element.hasAttribute( 'rows' ) && element.getAttribute( 'rows' ); - this.setValue( value || '' ); + this.setValue( element.$.defaultValue ); }, commit : function( element ) { - if ( this.getValue() ) - element.setAttribute( 'rows', this.getValue() ); - else - element.removeAttribute( 'rows' ); + element.$.value = element.$.defaultValue = this.getValue() ; } } + ] } ]