X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fforms%2Fplugin.js;h=e84de254d5e5fa039792cb865f8d19ff98a2dfc3;hp=66d3cec8868bfc9cfad61e7394add7cbdcafca79;hb=7cd80714081a8ffdf4a1a8d2c72f120ed5ef3d6d;hpb=8761695d9b70afe75905deaac88f78c1f8aeb32d diff --git a/_source/plugins/forms/plugin.js b/_source/plugins/forms/plugin.js index 66d3cec..e84de25 100644 --- a/_source/plugins/forms/plugin.js +++ b/_source/plugins/forms/plugin.js @@ -120,7 +120,7 @@ CKEDITOR.plugins.add( 'forms', { editor.contextMenu.addListener( function( element ) { - if ( element && element.hasAscendant( 'form' ) ) + if ( element && element.hasAscendant( 'form', true ) ) return { form : CKEDITOR.TRISTATE_OFF }; }); @@ -162,6 +162,30 @@ CKEDITOR.plugins.add( 'forms', }); } }, + + afterInit : function( editor ) + { + // Cleanup certain IE form elements default values. + if( CKEDITOR.env.ie ) + { + var dataProcessor = editor.dataProcessor, + htmlFilter = dataProcessor && dataProcessor.htmlFilter; + + htmlFilter && htmlFilter.addRules( + { + elements : + { + input : function( input ) + { + var attrs = input.attributes, + type = attrs.type; + if( type == 'checkbox' || type == 'radio' ) + attrs.value == 'on' && delete attrs.value; + } + } + } ); + } + }, requires : [ 'image' ] } );