Ticket #6646: 6646.patch

File 6646.patch, 2.6 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/htmldataprocessor/plugin.js

     
    250250
    251251        function protectReadOnly( element )
    252252        {
    253                 element.attributes.contenteditable = "false";
     253                var attrs = element.attributes;
     254                // We should flag that the element was locked by our code so
     255                // it'll be editable by the editor functions (#6046).
     256                if ( attrs.contenteditable != "false" )
     257                        attrs[ '_cke_editable' ] = attrs.contenteditable? true : 1;
     258
     259                attrs.contenteditable = "false";
    254260        }
     261
    255262        function unprotectReadyOnly( element )
    256263        {
    257                 delete element.attributes.contenteditable;
    258         }
     264                var attrs = element.attributes;
     265                switch( attrs[ '_cke_editable' ] )
     266                {
     267                        case 'true' : attrs.contenteditable = true; break;
     268                        case '1' :      delete attrs.contenteditable;
     269                }
     270
     271                delete attrs[ '_cke_editable' ];
     272        }
    259273        // Disable form elements editing mode provided by some browers. (#5746)
    260274        for ( i in { input : 1, textarea : 1 } )
    261275        {
  • _source/core/dom/node.js

     
    666666                        {
    667667                                if ( current.type == CKEDITOR.NODE_ELEMENT )
    668668                                {
    669                                         if ( current.is( 'body' ) || current.getCustomData( '_cke_notReadOnly' ) )
     669                                        if ( current.is( 'body' ) || current.getAttribute( '_cke_editable' ) )
    670670                                                break;
    671671
    672672                                        if ( current.getAttribute( 'contentEditable' ) == 'false' )
  • _source/plugins/wysiwygarea/plugin.js

     
    10471047                                if ( element.type == CKEDITOR.NODE_ELEMENT
    10481048                                                && ( element.is( 'input' ) || element.is( 'textarea' ) ) )
    10491049                                {
    1050                                         if ( !element.isReadOnly() )
    1051                                         {
    1052                                                 element.setAttribute( 'contentEditable', false );
    1053                                                 // We should flag that the element was locked by our code so
    1054                                                 // it'll be editable by the editor functions (#6046).
    1055                                                 element.setCustomData( '_cke_notReadOnly', 1 );
    1056                                         }
    1057                                 }
     1050                                        // We should flag that the element was locked by our code so
     1051                                        // it'll be editable by the editor functions (#6046).
     1052                                        if ( !element.isReadOnly() )
     1053                                                element.setAttribute( '_cke_editable',
     1054                                                        element.hasAttribute( 'contenteditable' ) ? true : 1  );
     1055
     1056                                        element.setAttribute( 'contentEditable', false );
     1057                                }
    10581058                        });
    10591059
    10601060                }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy