X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=_source%2Fplugins%2Fforms%2Fplugin.js;h=5978e0bcb75ea4dcec48e87934e5166e66f07cc2;hb=c6e377a02b54abc07129d72b632763c727476a15;hp=66d3cec8868bfc9cfad61e7394add7cbdcafca79;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;p=ckeditor.git diff --git a/_source/plugins/forms/plugin.js b/_source/plugins/forms/plugin.js index 66d3cec..5978e0b 100644 --- a/_source/plugins/forms/plugin.js +++ b/_source/plugins/forms/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -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' ] } );