Options

Options

Represent a WEBSPELLCHECKER initialization options.

Properties:
Name Type Attributes Default Description
options.container string | Node

DOM node with text or its selector.

options.autoStartup boolean <optional>
true

The parameter turns on/off WEBSPELLCHECKER on the autostartup. If 'true', it turns on WEBSPELLCHECKER automatically after loading the WEBSPELLCHECKER application.

options.autoDestroy boolean <optional>
false

The parameter turns on/off the auto-destroy functionality of a WEBSPELLCHECKER instance. By default, it is enabled for WProofreader initialized using 'autoSearch'. It can be used to avoid monitoring the state of the instance and handling its destroy after removal of an editable container from the page.

options.disableProblemDescription boolean <optional>
false

The parameter disable grammar problem descriptions. If true problem description NOT showed in problem context menu and in Proofreader dialog.

options.enableGrammar boolean <optional>
true

The parameter turns Grammar As You Type on/off on the WEBSPELLCHECKER startup. If 'true', it turns on grammar check functionality automatically once WEBSPELLCHECKER has started.

options.actionItems array <optional>
['addWord', 'ignoreAll', 'settings', 'toggle', 'proofreadDialog']

The parameter defines existance and order of menu items inside of their sections.

options.lang string <optional>
'en_US'

The parameter sets the default spell checking language for WEBSPELLCHECKER. Possible values are: 'en_US', 'en_GB', 'pt_BR', 'da_DK', 'nl_NL', 'en_CA', 'fi_FI', 'fr_FR', 'fr_CA', 'de_DE', 'el_GR', 'it_IT', 'nb_NO', 'pt_PT', 'es_ES', 'sv_SE'.

options.suggestionsCount number <optional>
3

The parameter defines the number of WEBSPELLCHECKER suggestions to show in the context menu. Possible values are: '0' (zero) – No suggestions are shown in the context menu. All suggestions will be listed in the "More Suggestions" sub-menu. Positive number – The maximum number of suggestions to show in the context menu. Other suggestions will be shown in the "More Suggestions" sub-menu. Negative number – 5 suggestions are shown in the context menu. All other suggestions will be listed in the "More Suggestions" sub-menu.

options.moreSuggestionsCount number <optional>
0

The parameter enables/disables the "More Suggestions" sub-menu in the context menu. Possible values are: '0' (zero) – No suggestions are shown in the "More Suggestions" sub-menu. Positive number – The maximum number of suggestions to show in "More Suggestions" sub-menu. Negative number – 10 suggestions are shown in "More Suggestions" sub-menu.

options.serviceProtocol string <optional>
'http'

The parameter allows specifying a protocol for the WSC service (the entry point is ssrv.cgi) full path.

options.serviceHost string <optional>
'svc.webspellchecker.net'

The parameter allows specifying a host for the WSC service (the entry point is ssrv.cgi) full path.

options.servicePort number <optional>
'80'

The parameter allows specifying a default port for the WSC service (the entry point is ssrv.cgi) full path.

options.servicePath string <optional>
'spellcheck31/script/ssrv.cgi'

The parameter is used to specify a path to the WSC service (the entry point is ssrv.cgi) full path.

options.minWordLength number <optional>
3

The parameter defines minimum length of the letters that will be collected from container's text for spell checking. Possible value is any positive number.

options.customDictionaryIds string <optional>
''

The parameter links WEBSPELLCHECKER to custom dictionaries. Here is a string containing dictionary IDs separated by commas (','). Further details can be found at link.

options.userDictionaryName string <optional>
''

The parameter activates a User Dictionary in WEBSPELLCHECKER.

options.settingsSections array <optional>
['options', 'languages', 'dictionaries']

The parameter customizes the WEBSPELLCHECKER dialog to show particular sections. Please note that the "About" section is not allowed to be removed by default. Such a customization can be provided for an additional fee and for more details, please contact @BRANDING_SUPPORT_MAIL@.

options.serviceId string <optional>
''

The parameter sets the service ID for WEBSPELLCHECKER. It used for a migration from free, ad-supported version to paid, ad-free version.

options.localization string <optional>
'en'

The parameter sets localization. If no parameter is specified by a user, it will be detected automatically from a browser settings. If the parameter can't be automatically detected, a default value will be used. Possible values are: 'af', 'ar', 'bg', 'bn', 'bs', 'ca', 'cs', 'cy', 'da', 'de', 'el', 'en-us', 'en-au', 'en-ca', 'en-gb', 'en', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fo', 'fr-ca', 'fr', 'gl', 'gu', 'he', 'hi', 'hr', 'hu', 'is', 'it', 'ja', 'ka', 'km', 'ko', 'lt', 'lv', 'mk', 'mn', 'ms', 'nb', 'nl', 'no', 'pl', 'pt-br', 'pt', 'ro', 'ru', 'sk', 'sl', 'sr-latn', 'sr', 'sv', 'th', 'tr', 'ug', 'uk','ku', 'vi', 'zh-cn', 'zh'

options.ignoreElements string <optional>
'a|style|script'

The parameter specifies the names of tags which will be skipped while problem checking. It is a string containing tag names separated by '|' symbol. E.g.: 'style|del'. Please note that the "Style" and "Script" tags will be added to a specified tag list.

options.ignoreAllCapsWords boolean <optional>
false

The parameter enables the "Ignore All-Caps Words" option by default. You may need to options.disableOptionsStorage (disable option storing) for this setting to be effective because option storage has a higher priority.

options.ignoreDomainNames boolean <optional>
true

The parameter enables the "Ignore Domain Names" option by default. You may need to options.disableOptionsStorage (disable option storing) for this setting to be effective because option storage has a higher priority.

options.ignoreWordsWithMixedCases boolean <optional>
false

The parameter enables the "Ignore Words with Mixed Case" option by default. You may need to options.disableOptionsStorage (disable option storing) for this setting to be effective because option storage has a higher priority.

options.ignoreWordsWithNumbers boolean <optional>
false

The parameter enables the "Ignore Words with Numbers" option by default. You may need to options.disableOptionsStorage (disable option storing) for this setting to be effective because option storage has a higher priority.

options.enableBadgeButton boolean <optional>
true

The parameter enables the Badge button functionality. If true badge button will be added to the side of WebSpellChecker control. Part of context menu items will be moved to Badge.

options.proofreadAsYouType boolean <optional>
true

The parameter turns Proofread As You Type on/off.

options.disableOptionsStorage array <optional>
[]

The parameter disables storing of WEBSPELLCHECKER options such as ignore options and language between browser sessions. If enabled, the user-selected options will be reset after page reload. The 'autoSearch' functionality by default is set to reset all settings. The following settings can be used:

  • 'options' – Disables storing of all WEBSPELLCHECKER Ignore options, except 'lang'.
  • 'ignoreAllCapsWords' – Disables storing of the "Ignore All-Caps Words" option.
  • 'ignoreDomainNames' – Disables storing of the "Ignore Domain Names" option.
  • 'ignoreWordsWithMixedCases' – Disables storing of the "Ignore Words with Mixed Case" option.
  • 'ignoreWordsWithNumbers' – Disables storing of the "Ignore Words with Numbers" option.
  • 'lang' – Disables storing of the WEBSPELLCHECKER spell check language.
  • 'all' – Disables storing of all WEBSPELLCHECKER options.
ecVersion number <optional>
2

The parameter sets version of the application for HTML editable controls. The default value is '2'. Value '1' stands for enabling the old version of the application which is kept for the backward compatibility and exception case (like old versions of IE browser).

options.undoDataSize number <optional>
20

The parameter sets length of the Undo array. It can be applied and used only with old version of the application for HTML editable controls (if 'ecVersion = 1').

options.disableDictionariesPreferences boolean <optional>
false

The parameter disables dictionaries preferences for end users. Creating, connecting, deleting and renamig for user dictionaries will not be available.

options.removeBranding boolean <optional>
false

The parameter removes branding information that is present on WProofreader such as the product title, the About tab with logo and copyrights. Note: This option is available only for certain types of pricing plans.

options.disableBadgePulsing boolean <optional>
false

The parameter disables pulsing effect for badge button.

options.requestTokensCount number <optional>
10

The parameter sets number of tokens (sentences) per request.

options.onLoad function

This is the WEBSPELLCHECKER onLoad callback.

Example

var instance = WEBSPELLCHECKER.init({
    container: document.getElementById('elementId'),
    autoStartup: true,
    lang: 'de_DE',
    localization: 'de',
    actionItems: ['ignoreall', 'addword', 'settings', 'toggle'],
    serviceProtocol: 'http',
    servicePort: '80',
    serviceHost: document.location.host,
    servicePath: 'spellcheck/script/ssrv.cgi',
    ignoreAllCapsWords: true,
    ignoreDomainNames: false,
    ignoreWordsWithMixedCases: true,
    ignoreWordsWithNumbers: true,
    disableOptionsStorage: ['lang', 'ignoreDomainNames'],
    undoDataSize: 10,
    enableOnTouchDevices: true,
    onLoad: function() {
        // 'this' refers to WEBSPELLCHECKER instance
        this.setDisabled(true);
    }
});