Menu

[r15]: / includes / htmlarea / plugins / SpellChecker / spell-checker.js  Maximize  Restore  History

Download this file

84 lines (75 with data), 2.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Spell Checker Plugin for HTMLArea-3.0
// Implementation by Mihai Bazon. Sponsored by www.americanbible.org
//
// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
// This notice MUST stay intact for use (see license.txt).
//
// A free WYSIWYG editor replacement for <textarea> fields.
// For full source code and docs, visit http://www.interactivetools.com/
//
// Version 3.0 developed by Mihai Bazon for InteractiveTools.
// http://dynarch.com/mishoo
//
// $Id: spell-checker.js,v 1.1 2004/01/15 01:41:14 fullo Exp $
function SpellChecker(editor) {
this.editor = editor;
var cfg = editor.config;
var tt = SpellChecker.I18N;
var bl = SpellChecker.btnList;
var self = this;
// register the toolbar buttons provided by this plugin
var toolbar = [];
for (var i in bl) {
var btn = bl[i];
if (!btn) {
toolbar.push("separator");
} else {
var id = "SC-" + btn[0];
cfg.registerButton(id, tt[id], editor.imgURL(btn[0] + ".gif", "SpellChecker"), false,
function(editor, id) {
// dispatch button press event
self.buttonPress(editor, id);
}, btn[1]);
toolbar.push(id);
}
}
for (var i in toolbar) {
cfg.toolbar[0].push(toolbar[i]);
}
};
SpellChecker._pluginInfo = {
name : "SpellChecker",
version : "1.0",
developer : "Mihai Bazon",
developer_url : "http://dynarch.com/mishoo/",
c_owner : "Mihai Bazon",
sponsor : "American Bible Society",
sponsor_url : "http://www.americanbible.org",
license : "htmlArea"
};
SpellChecker.btnList = [
null, // separator
["spell-check"]
];
SpellChecker.prototype.buttonPress = function(editor, id) {
switch (id) {
case "SC-spell-check":
SpellChecker.editor = editor;
SpellChecker.init = true;
var uiurl = _editor_url + "plugins/SpellChecker/spell-check-ui.html";
var win;
if (HTMLArea.is_ie) {
win = window.open(uiurl, "SC_spell_checker",
"toolbar=no,location=no,directories=no,status=no,menubar=no," +
"scrollbars=no,resizable=yes,width=600,height=400");
} else {
win = window.open(uiurl, "SC_spell_checker",
"toolbar=no,menubar=no,personalbar=no,width=600,height=400," +
"scrollbars=no,resizable=yes");
}
win.focus();
break;
}
};
// this needs to be global, it's accessed from spell-check-ui.html
SpellChecker.editor = null;
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.