Module: TinyMCE::SpellChecker
- Included in:
- Base
- Defined in:
- lib/tiny_mce/spell_checker.rb
Overview
Provides Spell checking capability to tiny_mce plugin Note: this may not always be up to date. Please supply patches if this isn’t working
Constant Summary collapse
- ASPELL_WORD_DATA_REGEX =
Regexp.new(/\&\s\w+\s\d+\s\d+(.*)$/)
- ASPELL_PATH =
fall back to a pathless call
aspell_path || "aspell"
Instance Method Summary collapse
-
#spellchecker ⇒ Object
The method called via AJAX request by the Spellchecking plugin in TinyMCE.
Instance Method Details
#spellchecker ⇒ Object
The method called via AJAX request by the Spellchecking plugin in TinyMCE. Passes in various params (language, words, and method) Return a JSON object required by the Spellchecking plugin
30 31 32 33 34 35 36 37 38 |
# File 'lib/tiny_mce/spell_checker.rb', line 30 def spellchecker language, words, method = params[:params][0], params[:params][1], params[:method] unless params[:params].blank? return render(:nothing => true) if language.blank? || words.blank? || method.blank? headers["Content-Type"] = "text/plain" headers["charset"] = "utf-8" suggestions = check_spelling(words, method, language) results = {"id" => nil, "result" => suggestions, "error" => nil} render :json => results end |