X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fforms%2Fdialogs%2Fselect.js;h=aee101b723c8ca232c7b58cb404c1a68858559ed;hb=f0610347140239143439a511ee2bd48cb784f470;hp=ee5dbbd9de8c28edaa21d05f2374688947b5eca3;hpb=7cd80714081a8ffdf4a1a8d2c72f120ed5ef3d6d;p=ckeditor.git diff --git a/_source/plugins/forms/dialogs/select.js b/_source/plugins/forms/dialogs/select.js index ee5dbbd..aee101b 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). @@ -161,12 +161,12 @@ CKEDITOR.dialog.add( 'select', function( editor ) if ( isInsertMode ) { - editor.insertElement(element); - if( CKEDITOR.env.ie ) + editor.insertElement( element ); + if ( CKEDITOR.env.ie ) { var sel = editor.getSelection(), bms = sel.createBookmarks(); - setTimeout(function () + setTimeout(function() { sel.selectBookmarks( bms ); }, 0 ); @@ -188,16 +188,15 @@ CKEDITOR.dialog.add( 'select', function( editor ) label : editor.lang.common.name, 'default' : '', accessKey : 'N', - align : 'center', style : 'width:350px', 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' ) || '' ); } @@ -205,10 +204,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' ); } } @@ -237,13 +236,11 @@ CKEDITOR.dialog.add( 'select', function( editor ) { type : 'hbox', widths : [ '175px', '170px' ], - align : 'center', children : [ { id : 'txtSize', type : 'text', - align : 'center', labelLayout : 'horizontal', label : editor.lang.select.size, 'default' : '', @@ -282,7 +279,6 @@ CKEDITOR.dialog.add( 'select', function( editor ) { type : 'hbox', widths : [ '115px', '115px' ,'100px' ], - align : 'top', children : [ { @@ -408,6 +404,7 @@ CKEDITOR.dialog.add( 'select', function( editor ) [ { type : 'button', + id : 'btnAdd', style : '', label : editor.lang.select.btnAdd, title : editor.lang.select.btnAdd, @@ -431,6 +428,7 @@ CKEDITOR.dialog.add( 'select', function( editor ) }, { type : 'button', + id : 'btnModify', label : editor.lang.select.btnModify, title : editor.lang.select.btnModify, style : 'width:100%;', @@ -453,6 +451,7 @@ CKEDITOR.dialog.add( 'select', function( editor ) }, { type : 'button', + id : 'btnUp', style : 'width:100%;', label : editor.lang.select.btnUp, title : editor.lang.select.btnUp, @@ -469,6 +468,7 @@ CKEDITOR.dialog.add( 'select', function( editor ) }, { type : 'button', + id : 'btnDown', style : 'width:100%;', label : editor.lang.select.btnDown, title : editor.lang.select.btnDown, @@ -494,6 +494,7 @@ CKEDITOR.dialog.add( 'select', function( editor ) [ { type : 'button', + id : 'btnSetValue', label : editor.lang.select.btnSetValue, title : editor.lang.select.btnSetValue, onClick : function() @@ -507,6 +508,7 @@ CKEDITOR.dialog.add( 'select', function( editor ) }, { type : 'button', + id : 'btnDelete', label : editor.lang.select.btnDelete, title : editor.lang.select.btnDelete, onClick : function()