This plugin provides a spelling check capability for the editor.
See the dojox/editor/plugins/SpellCheck reference documentation for more information.
The span that holds the current position of the cursor
The reference to the editor the plug-in belongs to.
The style of the highlighted incorrect words
The style of the ignored incorrect words
The wrapper that marks the incorrect words
The max number of the suggestion list items
The style of the marked incorrect words.
An empty CSS class that identifies the incorrect words
The max length of each XHR request. It is used to divide the large text into pieces so that the server-side piece can hold.
String like "insertUnorderedList", "outdent", "justifyCenter", etc. that represents an editor command.
Passed to editor.execCommand() if useDefaultCommand
is true.
Flag to indicate if this plugin has been disabled and should do nothing helps control button state, among other things. Set via the setter api.
The object that holds all the parametes passed into the constructor
The CSS class name for the button node is formed from iconClassPrefix
and command
Indicate if the interactive spelling check is enabled
The minutes to waiting for the response. The default value is 30 seconds.
If true, this plugin executes by calling Editor.execCommand() with the argument specified in command
.
Add the word at the index to the dictionary
Parameter | Type | Description |
---|---|---|
index | undefined | The index of the span list |
word | String |
Optional If this argument is given, add the word to the dictionary and skip all the words like it |
Connect up all the events with their event handlers
When the plugin is disabled (the button is disabled), reset all to their initial status. If the interactive mode is on, check the content once it is enabled.
Parameter | Type | Description |
---|---|---|
name | undefined | Command name |
disabled | undefined | Command argument |
This function invokes a find with specific options
Parameter | Type | Description |
---|---|---|
txt | String | The text to locate in the document. |
caseSensitive | Boolean | Whether or ot to search case-sensitively. |
backwards | Boolean | Whether or not to search backwards in the document. |
Boolean indicating if the content was found or not.
Helper function for get() and set(). Caches attribute name values so we don't do the string ops every time.
Parameter | Type | Description |
---|---|---|
name | undefined |
Get the cursor position. It is the index of the characters where the cursor is.
Parameter | Type | Description |
---|---|---|
eValue | String | The html value of the editor |
Substitute the tag with white charactors so that the server can easily process the text. For example:
"<a src="sample.html">Hello, world!</a>" ==> " Hello, world! "
Parameter | Type | Description |
---|---|---|
html | undefined | The html code |
Initialize the button displayed on the editor's toolbar
The handler of the onKeyPress event of the editor
Parameter | Type | Description |
---|---|---|
evt | undefined |
Apply the query result to the content
Parameter | Type | Description |
---|---|---|
data | Array | The result of the query |
Mark the incorrect words and set up menus if available
Parameter | Type | Description |
---|---|---|
html | String | The html value of the editor |
cache | Object | The local word cache |
Move to the position when the cursor was.
Populate the content of the dailog
Parameter | Type | Description |
---|---|---|
index | undefined | The idex of the span list |
Send the query text to the service. The query text is a string of words separated by space.
Parameter | Type | Description |
---|---|---|
html | String | The html value of the editor |
Replace the incorrect word with the selected one, or the one the user types in the textbox
Replace the word at the given index with the text
Parameter | Type | Description |
---|---|---|
index | undefined | The index of the span list |
text | undefined | The text to be replaced with |
Select the incorrect word. Move to it and highlight it
Parameter | Type | Description |
---|---|---|
index | undefined | The index of the span list |
Helper function to set new value for specified attribute
Parameter | Type | Description |
---|---|---|
name | String | |
value | anything |
Function to set the plugin state and call updateState to make sure the button is updated appropriately.
Parameter | Type | Description |
---|---|---|
disabled | undefined |
Ignore this word and move to the next unignored one.
Parameter | Type | Description |
---|---|---|
evt | Event |
Optional The event object |
noUpdate | Boolean |
Optional Indicate whether to update the status of the span list or not |
Skip the word at the index
Parameter | Type | Description |
---|---|---|
index | undefined | The index of the span list |
Skip the all the word that have the same text as the word at the index or the given word
Parameter | Type | Description |
---|---|---|
index | undefined | The index of the span list |
word | String |
Optional If this argument is given, skip all the words that have the same text as the word |
Filter out the incorrect word style so that the value of the edtior won't include the spans that wrap around the incorrect words
Parameter | Type | Description |
---|---|---|
value | String | The html value of the editor |
Functions to submit the content of the editor
Parameter | Type | Description |
---|---|---|
delay | Boolean |
Optional Indicate if the action is taken immediately or not |
Class of widget (ex: dijit.form.Button or dijit/form/FilteringSelect)
that is added to the toolbar to control this plugin.
This is used to instantiate the button, unless button
itself is specified directly.
Deprecated. Use this.own() with dojo/on or dojo/aspect.instead.
Make a connect.connect() that is automatically disconnected when this plugin is destroyed.
Similar to dijit/_Widget.connect()
.
Parameter | Type | Description |
---|---|---|
o | undefined | |
f | undefined | |
tf | undefined |
Get a property from a plugin.
Get a named property from a plugin. The property may potentially be retrieved via a getter method. If no getter is defined, this just retrieves the object's property. For example, if the plugin has a properties "foo" and "bar" and a method named "_getFooAttr", calling:
plugin.get("foo");
would be equivalent to writing:
plugin._getFooAttr();
and:
plugin.get("bar");
would be equivalent to writing:
plugin.bar;
Parameter | Type | Description |
---|---|---|
name | undefined | The property to get. |
Returns the label to use for the button
Parameter | Type | Description |
---|---|---|
key | String |
Track specified handles and remove/destroy them when this instance is destroyed, unless they were already removed/destroyed manually.
The array of specified handles, so you can do for example:
var handle = this.own(on(...))[0];
Set a property on a plugin
Sets named properties on a plugin which may potentially be handled by a setter in the plugin. For example, if the plugin has a properties "foo" and "bar" and a method named "_setFooAttr", calling:
plugin.set("foo", "Howdy!");
would be equivalent to writing:
plugin._setFooAttr("Howdy!");
and:
plugin.set("bar", 3);
would be equivalent to writing:
plugin.bar = 3;
set() may also be called with a hash of name/value pairs, ex:
plugin.set({ foo: "Howdy", bar: 3 })
This is equivalent to calling set(foo, "Howdy") and set(bar, 3)
Parameter | Type | Description |
---|---|---|
name | attribute | The property to set. |
value | anything | The value to set in the property. |
Set a property on a plugin
Parameter | Type | Description |
---|---|---|
editor | dijit.Editor |
Tell the plugin to add it's controller widget (often a button) to the toolbar. Does nothing if there is no controller widget.
Parameter | Type | Description |
---|---|---|
toolbar | dijit/Toolbar |
Change state of the plugin to respond to events in the editor.
This is called on meaningful events in the editor, such as change of selection or caret position (but not simple typing of alphanumeric keys). It gives the plugin a chance to update the CSS of its button.
For example, the "bold" plugin will highlight/unhighlight the bold button depending on whether the characters next to the caret are bold or not.
Only makes sense when useDefaultCommand
is true, as it calls Editor.queryCommandEnabled(command
).