X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fforms%2Fplugin.js;h=3be5c3b6606936a5cb16f76a19112d433f09deea;hp=b66a31d854f01fc9aa9dc7ffde525f98cf16c2d3;hb=48b1db88210b4160dce439c6e3e32e14af8c106b;hpb=9afde8772159bd3436f1f5b7862960307710ae5a diff --git a/_source/plugins/forms/plugin.js b/_source/plugins/forms/plugin.js index b66a31d..3be5c3b 100644 --- a/_source/plugins/forms/plugin.js +++ b/_source/plugins/forms/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2010, 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 */ @@ -149,22 +149,25 @@ CKEDITOR.plugins.add( 'forms', if ( name == 'input' ) { - var type = element.getAttribute( 'type' ); + switch( element.getAttribute( 'type' ) ) + { + case 'button' : + case 'submit' : + case 'reset' : + return { button : CKEDITOR.TRISTATE_OFF }; - if ( type == 'text' || type == 'password' ) - return { textfield : CKEDITOR.TRISTATE_OFF }; + case 'checkbox' : + return { checkbox : CKEDITOR.TRISTATE_OFF }; - if ( type == 'button' || type == 'submit' || type == 'reset' ) - return { button : CKEDITOR.TRISTATE_OFF }; + case 'radio' : + return { radio : CKEDITOR.TRISTATE_OFF }; - if ( type == 'checkbox' ) - return { checkbox : CKEDITOR.TRISTATE_OFF }; + case 'image' : + return { imagebutton : CKEDITOR.TRISTATE_OFF }; - if ( type == 'radio' ) - return { radio : CKEDITOR.TRISTATE_OFF }; - - if ( type == 'image' ) - return { imagebutton : CKEDITOR.TRISTATE_OFF }; + default : + return { textfield : CKEDITOR.TRISTATE_OFF }; + } } if ( name == 'img' && element.data( 'cke-real-element-type' ) == 'hiddenfield' ) @@ -187,14 +190,8 @@ CKEDITOR.plugins.add( 'forms', evt.data.dialog = 'hiddenfield'; else if ( element.is( 'input' ) ) { - var type = element.getAttribute( 'type' ); - - switch ( type ) + switch ( element.getAttribute( 'type' ) ) { - case 'text' : - case 'password' : - evt.data.dialog = 'textfield'; - break; case 'button' : case 'submit' : case 'reset' : @@ -209,6 +206,9 @@ CKEDITOR.plugins.add( 'forms', case 'image' : evt.data.dialog = 'imagebutton'; break; + default : + evt.data.dialog = 'textfield'; + break; } } }); @@ -231,6 +231,9 @@ CKEDITOR.plugins.add( 'forms', { var attrs = input.attributes, type = attrs.type; + // Old IEs don't provide type for Text inputs #5522 + if ( !type ) + attrs.type = 'text'; if ( type == 'checkbox' || type == 'radio' ) attrs.value == 'on' && delete attrs.value; } @@ -272,10 +275,7 @@ if ( CKEDITOR.env.ie ) return !!this.$.checked; case 'value' : var type = this.getAttribute( 'type' ); - if ( type == 'checkbox' || type == 'radio' ) - return this.$.value != 'on'; - break; - default: + return type == 'checkbox' || type == 'radio' ? this.$.value != 'on' : this.$.value; } }