Ticket #5522: 5522.patch

File 5522.patch, 2.4 KB (added by Alfonso Martínez de Lizarrondo, 13 years ago)

Proposed patch

  • _source/plugins/forms/plugin.js

     
    149149
    150150                                                if ( name == 'input' )
    151151                                                {
    152                                                         var type = element.getAttribute( 'type' );
     152                                                        switch( element.getAttribute( 'type' ) )
     153                                                        {
     154                                                                case 'button' :
     155                                                                case 'submit' :
     156                                                                case 'reset' :
     157                                                                        return { button : CKEDITOR.TRISTATE_OFF };
    153158
    154                                                         if ( type == 'text' || type == 'password' )
    155                                                                 return { textfield : CKEDITOR.TRISTATE_OFF };
     159                                                                case 'checkbox' :
     160                                                                        return { checkbox : CKEDITOR.TRISTATE_OFF };
    156161
    157                                                         if ( type == 'button' || type == 'submit' || type == 'reset' )
    158                                                                 return { button : CKEDITOR.TRISTATE_OFF };
     162                                                                case 'radio' :
     163                                                                        return { radio : CKEDITOR.TRISTATE_OFF };
    159164
    160                                                         if ( type == 'checkbox' )
    161                                                                 return { checkbox : CKEDITOR.TRISTATE_OFF };
     165                                                                case 'image' :
     166                                                                        return { imagebutton : CKEDITOR.TRISTATE_OFF };
    162167
    163                                                         if ( type == 'radio' )
    164                                                                 return { radio : CKEDITOR.TRISTATE_OFF };
    165 
    166                                                         if ( type == 'image' )
    167                                                                 return { imagebutton : CKEDITOR.TRISTATE_OFF };
     168                                                                default :
     169                                                                        return { textfield : CKEDITOR.TRISTATE_OFF };
     170                                                        }
    168171                                                }
    169172
    170173                                                if ( name == 'img' && element.getAttribute( '_cke_real_element_type' ) == 'hiddenfield' )
     
    187190                                        evt.data.dialog = 'hiddenfield';
    188191                                else if ( element.is( 'input' ) )
    189192                                {
    190                                         var type = element.getAttribute( 'type' );
    191 
    192                                         switch ( type )
     193                                        switch ( element.getAttribute( 'type' ) )
    193194                                        {
    194                                                 case 'text' :
    195                                                 case 'password' :
    196                                                         evt.data.dialog = 'textfield';
    197                                                         break;
    198195                                                case 'button' :
    199196                                                case 'submit' :
    200197                                                case 'reset' :
     
    209206                                                case 'image' :
    210207                                                        evt.data.dialog = 'imagebutton';
    211208                                                        break;
     209                                                default :
     210                                                        evt.data.dialog = 'textfield';
     211                                                        break;
    212212                                        }
    213213                                }
    214214                        });
     
    231231                                        {
    232232                                                var attrs = input.attributes,
    233233                                                        type = attrs.type;
     234                                                // Old IEs don't provide type for Text inputs #5522
     235                                                if ( !type )
     236                                                        attrs.type = 'text';
    234237                                                if ( type == 'checkbox' || type == 'radio' )
    235238                                                        attrs.value == 'on' && delete attrs.value;
    236239                                        }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy