Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

There are separate callback functions available such as onAddWordToUserDictionary and onDeleteWordFromUserDictionary, that you can use to get information about newly added or removed words from the personal user dictionaries.

Code Block
languagejs
themeEmacs
    onAddWordToUserDictionary: function(word, instance) {
        // word - a word added to the dictionary.
        // instance - a WEBSPELLCHECKER instance.
    },
    onDeleteWordFromUserDictionary: function(word, instance) {
        // word - a word deleted from the dictionary.
        // instance - a WEBSPELLCHECKER instance.
    }

For the versions of the package before release 5.5.8, there is a temporary workaround available if you need to listen to Add or remove word actions performed by end users.

...

.

Code Block
languagejs
themeEmacs
<script>
window.WEBSPELLCHECKER_CONFIG = {
    autoSearch: true,
    ....,
    onLoad: function(instance) {
        instance.subscribe('addWordToUserDictionary', function(data) {
            // Get the added `word` from `data.word` field
        });

        instance.subscribe('deleteWordFromUserDictionary', function(data) {
            // Get the deleted `word` from `data.word` field
        });
    }
};
</script>