Ticket #7784: 7784_2.patch
File 7784_2.patch, 1.8 KB (added by , 14 years ago) |
---|
-
_source/plugins/stylesheetparser/plugin.js
102 102 // Do this only once 103 103 e.removeListener(); 104 104 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+/ ); 111 114 112 // Add the styles found in the document113 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 ) ); 114 117 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); 119 123 }); 120 124 121 125 }