/*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
\r
\r
if ( name == 'input' )\r
{\r
- var type = element.getAttribute( 'type' );\r
+ switch( element.getAttribute( 'type' ) )\r
+ {\r
+ case 'button' :\r
+ case 'submit' :\r
+ case 'reset' :\r
+ return { button : CKEDITOR.TRISTATE_OFF };\r
\r
- if ( type == 'text' || type == 'password' )\r
- return { textfield : CKEDITOR.TRISTATE_OFF };\r
+ case 'checkbox' :\r
+ return { checkbox : CKEDITOR.TRISTATE_OFF };\r
\r
- if ( type == 'button' || type == 'submit' || type == 'reset' )\r
- return { button : CKEDITOR.TRISTATE_OFF };\r
+ case 'radio' :\r
+ return { radio : CKEDITOR.TRISTATE_OFF };\r
\r
- if ( type == 'checkbox' )\r
- return { checkbox : CKEDITOR.TRISTATE_OFF };\r
+ case 'image' :\r
+ return { imagebutton : CKEDITOR.TRISTATE_OFF };\r
\r
- if ( type == 'radio' )\r
- return { radio : CKEDITOR.TRISTATE_OFF };\r
-\r
- if ( type == 'image' )\r
- return { imagebutton : CKEDITOR.TRISTATE_OFF };\r
+ default :\r
+ return { textfield : CKEDITOR.TRISTATE_OFF };\r
+ }\r
}\r
\r
if ( name == 'img' && element.data( 'cke-real-element-type' ) == 'hiddenfield' )\r
evt.data.dialog = 'hiddenfield';\r
else if ( element.is( 'input' ) )\r
{\r
- var type = element.getAttribute( 'type' );\r
-\r
- switch ( type )\r
+ switch ( element.getAttribute( 'type' ) )\r
{\r
- case 'text' :\r
- case 'password' :\r
- evt.data.dialog = 'textfield';\r
- break;\r
case 'button' :\r
case 'submit' :\r
case 'reset' :\r
case 'image' :\r
evt.data.dialog = 'imagebutton';\r
break;\r
+ default :\r
+ evt.data.dialog = 'textfield';\r
+ break;\r
}\r
}\r
});\r
{\r
var attrs = input.attributes,\r
type = attrs.type;\r
+ // Old IEs don't provide type for Text inputs #5522\r
+ if ( !type )\r
+ attrs.type = 'text';\r
if ( type == 'checkbox' || type == 'radio' )\r
attrs.value == 'on' && delete attrs.value;\r
}\r
return !!this.$.checked;\r
case 'value' :\r
var type = this.getAttribute( 'type' );\r
- if ( type == 'checkbox' || type == 'radio' )\r
- return this.$.value != 'on';\r
- break;\r
- default:\r
+ return type == 'checkbox' || type == 'radio' ? this.$.value != 'on' : this.$.value;\r
}\r
}\r
\r