Ticket #4527: 4527.patch
File 4527.patch, 2.3 KB (added by , 14 years ago) |
---|
-
_source/plugins/forms/dialogs/checkbox.js
79 79 accessKey : 'V', 80 80 setup : function( element ) 81 81 { 82 this.setValue( element.getAttribute( 'value' ) || '' ); 82 var value = element.getAttribute( 'value' ); 83 this.setValue( CKEDITOR.env.ie && value == 'on' ? '' : value ); 83 84 }, 84 85 commit : function( data ) 85 86 { … … 115 116 { 116 117 var replace = CKEDITOR.dom.element.createFromHtml( '<input type="checkbox"' 117 118 + ( isChecked ? ' checked="checked"' : '' ) 118 + '></input>', editor.document ); 119 + '/>', editor.document ); 120 119 121 element.copyAttributes( replace, { type : 1, checked : 1 } ); 120 122 replace.replace( element ); 121 123 editor.getSelection().selectElement( replace ); … … 124 126 } 125 127 else 126 128 { 127 if ( this.getValue() ) 128 element.setAttribute( 'checked', this.getValue() ); 129 var value = this.getValue(); 130 if ( value ) 131 element.setAttribute( 'checked', 'checked' ); 129 132 else 130 133 element.removeAttribute( 'checked' ); 131 134 } -
_source/plugins/forms/plugin.js
162 162 }); 163 163 } 164 164 }, 165 166 afterInit : function( editor ) 167 { 168 // Cleanup certain IE form elements default values. 169 if( CKEDITOR.env.ie ) 170 { 171 var dataProcessor = editor.dataProcessor, 172 htmlFilter = dataProcessor && dataProcessor.htmlFilter; 173 174 htmlFilter && htmlFilter.addRules( 175 { 176 elements : 177 { 178 input : function( input ) 179 { 180 var attrs = input.attributes, 181 type = attrs.type; 182 if( type == 'checkbox' || type == 'radio' ) 183 { 184 attrs.checked == '0' && delete attrs.checked; 185 attrs.value == 'on' && delete attrs.value; 186 } 187 } 188 } 189 } ); 190 } 191 }, 165 192 requires : [ 'image' ] 166 193 } ); 167 194