Ticket #6588: 6588.patch

File 6588.patch, 1.3 KB (added by WebSpellChecker.net, 13 years ago)
  • _source/plugins/scayt/plugin.js

     
    4646                        oParams.customDictionaryIds = config.scayt_customDictionaryIds || '';
    4747                        oParams.userDictionaryName = config.scayt_userDictionaryName || '';
    4848                        oParams.sLang = config.scayt_sLang || 'en_US';
     49                        oParams.addClass = true;
    4950
    5051                        // Introduce SCAYT onLoad callback. (#5632)
    5152                        oParams.onLoad = function()
     
    505506                {
    506507                        var moreSuggestions = {},
    507508                                mainSuggestions = {};
    508 
     509                       
     510                        // Delete span.scayt-misspell when text pasting in editor (#6588)
     511                        var dataProcessor = editor.dataProcessor;
     512                        var addDataFilterRules = {
     513                                elements : {
     514                                        span : function( element ){
     515                                                if (element.attributes['class'] != undefined){
     516                                                        if (element.attributes['class'].indexOf("scayt-misspell") != -1){ delete element.name }
     517                                                        if (element.attributes['class'].indexOf("scayt-ignore") != -1){ delete element.name }
     518                                                }
     519                                        }
     520                                }
     521                        };
     522                        dataProcessor.dataFilter.addRules( addDataFilterRules );
     523                       
    509524                        // Scayt command.
    510525                        var command = editor.addCommand( commandName, commandDefinition );
    511526
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy