/*\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
CKEDITOR.dialog.add( 'select', function( editor )\r
function removeAllOptions( combo )\r
{\r
combo = getSelect( combo );\r
- while( combo.getChild( 0 ) && combo.getChild( 0 ).remove() )\r
+ while ( combo.getChild( 0 ) && combo.getChild( 0 ).remove() )\r
{ /*jsl:pass*/ }\r
}\r
// Moves the selected option by a number of steps (also negative).\r
this.commitContent( element );\r
\r
if ( isInsertMode )\r
+ {\r
editor.insertElement( element );\r
+ if ( CKEDITOR.env.ie )\r
+ {\r
+ var sel = editor.getSelection(),\r
+ bms = sel.createBookmarks();\r
+ setTimeout(function()\r
+ {\r
+ sel.selectBookmarks( bms );\r
+ }, 0 );\r
+ }\r
+ }\r
},\r
contents : [\r
{\r
label : editor.lang.common.name,\r
'default' : '',\r
accessKey : 'N',\r
- align : 'center',\r
style : 'width:350px',\r
setup : function( name, element )\r
{\r
if ( name == 'clear' )\r
- this.setValue( '' );\r
+ this.setValue( this[ 'default' ] || '' );\r
else if ( name == 'select' )\r
{\r
this.setValue(\r
- element.getAttribute( '_cke_saved_name' ) ||\r
+ element.data( 'cke-saved-name' ) ||\r
element.getAttribute( 'name' ) ||\r
'' );\r
}\r
commit : function( element )\r
{\r
if ( this.getValue() )\r
- element.setAttribute( '_cke_saved_name', this.getValue() );\r
+ element.data( 'cke-saved-name', this.getValue() );\r
else\r
{\r
- element.removeAttribute( '_cke_saved_name' ) ;\r
+ element.data( 'cke-saved-name', false );\r
element.removeAttribute( 'name' );\r
}\r
}\r
{\r
type : 'hbox',\r
widths : [ '175px', '170px' ],\r
- align : 'center',\r
children :\r
[\r
{\r
id : 'txtSize',\r
type : 'text',\r
- align : 'center',\r
labelLayout : 'horizontal',\r
label : editor.lang.select.size,\r
'default' : '',\r
{\r
type : 'hbox',\r
widths : [ '115px', '115px' ,'100px' ],\r
- align : 'top',\r
children :\r
[\r
{\r
[\r
{\r
type : 'button',\r
+ id : 'btnAdd',\r
style : '',\r
label : editor.lang.select.btnAdd,\r
title : editor.lang.select.btnAdd,\r
},\r
{\r
type : 'button',\r
+ id : 'btnModify',\r
label : editor.lang.select.btnModify,\r
title : editor.lang.select.btnModify,\r
style : 'width:100%;',\r
},\r
{\r
type : 'button',\r
+ id : 'btnUp',\r
style : 'width:100%;',\r
label : editor.lang.select.btnUp,\r
title : editor.lang.select.btnUp,\r
},\r
{\r
type : 'button',\r
+ id : 'btnDown',\r
style : 'width:100%;',\r
label : editor.lang.select.btnDown,\r
title : editor.lang.select.btnDown,\r
[\r
{\r
type : 'button',\r
+ id : 'btnSetValue',\r
label : editor.lang.select.btnSetValue,\r
title : editor.lang.select.btnSetValue,\r
onClick : function()\r
},\r
{\r
type : 'button',\r
+ id : 'btnDelete',\r
label : editor.lang.select.btnDelete,\r
title : editor.lang.select.btnDelete,\r
onClick : function()\r