Ticket #51 (closed defect: fixed)
SpellChecker default dictionary
| Reported by: | Niko <ns@…> | Owned by: | gogo |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Xinha Core | Version: | |
| Severity: | normal | Keywords: | SpellChecker |
| Cc: |
Description
I made a little path that provides a default-dictionary-setting for the SpellChecker plugin.
please review it.
Index: spell-check-ui.js
===================================================================
--- spell-check-ui.js (Revision 23)
+++ spell-check-ui.js (Arbeitskopie)
@@ -203,6 +203,14 @@
frame = document.getElementById("i_framecontent");
var field = document.getElementById("f_content");
field.value = HTMLArea.getHTML(editor._doc.body, false, editor);
+
+ var dict = document.getElementById("f_dictionary");
+ if(typeof editor.config.SpellChecker.defaultDictionary != "undefined"
+ && editor.config.SpellChecker.defaultDictionary != "") {
+ dict.value = editor.config.SpellChecker.defaultDictionary;
+ } else {
+ dict.value = "en_GB";
+ }
if(editor.config.SpellChecker.backend == 'php')
{
@@ -421,11 +429,11 @@
for (var i = select.length; --i >= 0;) {
select.remove(i);
}
+ var activeDictionary = document.getElementById("f_dictionary").value;
for (var i = 0; i < dicts.length; ++i) {
var txt = dicts[i];
var option = document.createElement("option");
- if (/^@(.*)$/.test(txt)) {
- txt = RegExp.$1;
+ if(txt == activeDictionary) {
option.selected = true;
}
option.value = txt;
Index: spell-checker.js
===================================================================
--- spell-checker.js (Revision 23)
+++ spell-checker.js (Arbeitskopie)
@@ -8,7 +8,7 @@
//
// $Id$
-HTMLArea.Config.prototype.SpellChecker = { 'backend': 'php', 'personalFilesDir' : '' };
+HTMLArea.Config.prototype.SpellChecker = { 'backend': 'php', 'personalFilesDir' : '', 'defaultDictionary' : 'en_GB' };
function SpellChecker(editor) {
this.editor = editor;
Change History
Note: See
TracTickets for help on using
tickets.
