X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=_source%2Fplugins%2Fforms%2Fdialogs%2Fselect.js;h=dfecc6812170625d3b8ca4eae1b6afd9c2383279;hb=4e70ea24db840898be8cc21c950363a52a2a6aba;hp=645a1baa40a7ca8c84d9ed03ccf0331f046c320e;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;p=ckeditor.git diff --git a/_source/plugins/forms/dialogs/select.js b/_source/plugins/forms/dialogs/select.js index 645a1ba..dfecc68 100644 --- a/_source/plugins/forms/dialogs/select.js +++ b/_source/plugins/forms/dialogs/select.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2009, 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 */ CKEDITOR.dialog.add( 'select', function( editor ) @@ -73,7 +73,7 @@ CKEDITOR.dialog.add( 'select', function( editor ) function removeAllOptions( combo ) { combo = getSelect( combo ); - while( combo.getChild( 0 ) && combo.getChild( 0 ).remove() ) + while ( combo.getChild( 0 ) && combo.getChild( 0 ).remove() ) { /*jsl:pass*/ } } // Moves the selected option by a number of steps (also negative). @@ -160,7 +160,18 @@ CKEDITOR.dialog.add( 'select', function( editor ) this.commitContent( element ); if ( isInsertMode ) + { editor.insertElement( element ); + if ( CKEDITOR.env.ie ) + { + var sel = editor.getSelection(), + bms = sel.createBookmarks(); + setTimeout(function() + { + sel.selectBookmarks( bms ); + }, 0 ); + } + } }, contents : [ { @@ -182,11 +193,11 @@ CKEDITOR.dialog.add( 'select', function( editor ) setup : function( name, element ) { if ( name == 'clear' ) - this.setValue( '' ); + this.setValue( this[ 'default' ] || '' ); else if ( name == 'select' ) { this.setValue( - element.getAttribute( '_cke_saved_name' ) || + element.data( 'cke-saved-name' ) || element.getAttribute( 'name' ) || '' ); } @@ -194,10 +205,10 @@ CKEDITOR.dialog.add( 'select', function( editor ) commit : function( element ) { if ( this.getValue() ) - element.setAttribute( '_cke_saved_name', this.getValue() ); + element.data( 'cke-saved-name', this.getValue() ); else { - element.removeAttribute( '_cke_saved_name' ) ; + element.data( 'cke-saved-name', false ); element.removeAttribute( 'name' ); } } @@ -247,6 +258,8 @@ CKEDITOR.dialog.add( 'select', function( editor ) { if ( name == 'select' ) this.setValue( element.getAttribute( 'size' ) || '' ); + if ( CKEDITOR.env.webkit ) + this.getInputElement().setStyle( 'width', '86px' ); }, commit : function( element ) { @@ -395,6 +408,7 @@ CKEDITOR.dialog.add( 'select', function( editor ) [ { type : 'button', + id : 'btnAdd', style : '', label : editor.lang.select.btnAdd, title : editor.lang.select.btnAdd, @@ -418,6 +432,7 @@ CKEDITOR.dialog.add( 'select', function( editor ) }, { type : 'button', + id : 'btnModify', label : editor.lang.select.btnModify, title : editor.lang.select.btnModify, style : 'width:100%;', @@ -440,6 +455,7 @@ CKEDITOR.dialog.add( 'select', function( editor ) }, { type : 'button', + id : 'btnUp', style : 'width:100%;', label : editor.lang.select.btnUp, title : editor.lang.select.btnUp, @@ -456,6 +472,7 @@ CKEDITOR.dialog.add( 'select', function( editor ) }, { type : 'button', + id : 'btnDown', style : 'width:100%;', label : editor.lang.select.btnDown, title : editor.lang.select.btnDown, @@ -481,6 +498,7 @@ CKEDITOR.dialog.add( 'select', function( editor ) [ { type : 'button', + id : 'btnSetValue', label : editor.lang.select.btnSetValue, title : editor.lang.select.btnSetValue, onClick : function() @@ -494,6 +512,7 @@ CKEDITOR.dialog.add( 'select', function( editor ) }, { type : 'button', + id : 'btnDelete', label : editor.lang.select.btnDelete, title : editor.lang.select.btnDelete, onClick : function() @@ -523,6 +542,8 @@ CKEDITOR.dialog.add( 'select', function( editor ) { if ( name == 'select' ) this.setValue( element.getAttribute( 'multiple' ) ); + if ( CKEDITOR.env.webkit ) + this.getElement().getParent().setStyle( 'vertical-align', 'middle' ); }, commit : function( element ) {