Ticket #7784: 7784_2.patch

File 7784_2.patch, 1.8 KB (added by Alfonso Martínez de Lizarrondo, 13 years ago)

Updated patch

  • _source/plugins/stylesheetparser/plugin.js

     
    102102                                // Do this only once
    103103                                e.removeListener();
    104104
    105                                 editor.getStylesSet( function( stylesDefinitions )
    106                                         {
    107                                                         // Rules that must be skipped
    108                                                 var skipSelectors = editor.config.stylesheetParser_skipSelectors || ( /(^body\.|^\.)/i ),
    109                                                         // Rules that are valid
    110                                                         validSelectors = editor.config.stylesheetParser_validSelectors || ( /\w+\.\w+/ );
     105                                // Use a delay before parsing the stylesheet to avoid errors with Firefox 4. #7784
     106                                // Safari requires even greater delay
     107                                window.setTimeout( function() {
     108                                        editor.getStylesSet( function( stylesDefinitions )
     109                                                {
     110                                                                // Rules that must be skipped
     111                                                        var skipSelectors = editor.config.stylesheetParser_skipSelectors || ( /(^body\.|^\.)/i ),
     112                                                                // Rules that are valid
     113                                                                validSelectors = editor.config.stylesheetParser_validSelectors || ( /\w+\.\w+/ );
    111114
    112                                                 // Add the styles found in the document
    113                                                 editor._.stylesDefinitions = stylesDefinitions.concat( LoadStylesCSS( editor.document.$, skipSelectors, validSelectors ) );
     115                                                        // Add the styles found in the document
     116                                                        editor._.stylesDefinitions = stylesDefinitions.concat( LoadStylesCSS( editor.document.$, skipSelectors, validSelectors ) );
    114117
    115                                                 // Refresh the styles combo
    116                                                 var combo = editor.ui._.items[ 'Styles' ];
    117                                                 combo && combo.args[ 0 ].reset();
    118                                         } );
     118                                                        // Refresh the styles combo
     119                                                        var combo = editor.ui._.items[ 'Styles' ];
     120                                                        combo && combo.args[ 0 ].reset();
     121                                                } );
     122                                }, 1000);
    119123                        });
    120124
    121125                }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy