Namespace: spellcheck

Marked. spellcheck

Spelling/Grammar check properties and methods

Properties:
Name Type Description
spellData object

spellcheck results

showing boolean

whether spellcheck results are showing

showingGrammar boolean

whether grammar results are showing

checked boolean

Whether spellcheck has been completed for current document

Source:
spellcheck.js

Requires

Methods


checkDocument(options)

Spell/Grammar check current document

Parameters:
Name Type Description
options object

Object containing {boolean} lazy, {function} onResults, {function} onComplete

Source:
spellcheck.js
Returns:

result of document check

Type
boolean

init()

Initialize spell checking. Checks for cached results, runs spellcheck, turns on spelling and grammar display if enabled.

Source:
spellcheck.js
Returns:

success

Type
boolean

render(id)

Build spelling result panel for error at index

Parameters:
Name Type Description
id number

Index of element in errorElements array

Source:
spellcheck.js

report()

Build a report panel. Currently not implemented

Source:
spellcheck.js
Returns:

jQuery element containing report summary

Type
object

reveal(id)

Show panel for error at index

Parameters:
Name Type Description
id number

Index of error in errorElements

Source:
spellcheck.js

show( [type] [, hide])

Show/hide spelling, grammar, or both

Parameters:
Name Type Argument Default Description
type string <optional>
both

"spell", "grammar", or "both"

hide boolean <optional>
false

Hide results (true) or show (false)

Source:
spellcheck.js

summary( [reset])

Build spelling summary showing counts for spelling, grammar, and total issues

Parameters:
Name Type Argument Default Description
reset boolean <optional>
false

If true, reset the current summary and rebuild

Source:
spellcheck.js
Returns:

Object containing error counts, html string, and text string

Type
object

toggle( [spelling] [, grammar])

Toggle visibility of spelling and grammar results

Parameters:
Name Type Argument Description
spelling boolean <optional>

force spelling results to show (true)/hide (false)

grammar boolean <optional>

force grammar results to show (true)/hide (false)

Source:
spellcheck.js

togglePanel(id)

Toggle display of panel for error at index

Parameters:
Name Type Description
id number

Index of error in errorElements

Source:
spellcheck.js