Annotation of loncom/html/htmlarea/plugins/SpellChecker/spell-checker.js, revision 1.2

1.1       www         1: // Spell Checker Plugin for HTMLArea-3.0
1.2     ! www         2: // Sponsored by www.americanbible.org
        !             3: // Implementation by Mihai Bazon, http://dynarch.com/mishoo/
1.1       www         4: //
1.2     ! www         5: // (c) dynarch.com 2003.
        !             6: // Distributed under the same terms as HTMLArea itself.
1.1       www         7: // This notice MUST stay intact for use (see license.txt).
                      8: //
1.2     ! www         9: // $Id: spell-checker.js,v 1.7 2004/01/30 00:25:06 mishoo Exp $
1.1       www        10: 
                     11: function SpellChecker(editor) {
                     12: 	this.editor = editor;
                     13: 
                     14: 	var cfg = editor.config;
                     15: 	var tt = SpellChecker.I18N;
                     16: 	var bl = SpellChecker.btnList;
                     17: 	var self = this;
                     18: 
                     19: 	// register the toolbar buttons provided by this plugin
                     20: 	var toolbar = [];
                     21: 	for (var i in bl) {
                     22: 		var btn = bl[i];
                     23: 		if (!btn) {
                     24: 			toolbar.push("separator");
                     25: 		} else {
                     26: 			var id = "SC-" + btn[0];
1.2     ! www        27: 			cfg.registerButton(id, tt[id], editor.imgURL(btn[0] + ".gif", "SpellChecker"), false,
1.1       www        28: 					   function(editor, id) {
                     29: 						   // dispatch button press event
                     30: 						   self.buttonPress(editor, id);
                     31: 					   }, btn[1]);
                     32: 			toolbar.push(id);
                     33: 		}
                     34: 	}
                     35: 
                     36: 	for (var i in toolbar) {
                     37: 		cfg.toolbar[0].push(toolbar[i]);
                     38: 	}
                     39: };
                     40: 
1.2     ! www        41: SpellChecker._pluginInfo = {
        !            42: 	name          : "SpellChecker",
        !            43: 	version       : "1.0",
        !            44: 	developer     : "Mihai Bazon",
        !            45: 	developer_url : "http://dynarch.com/mishoo/",
        !            46: 	c_owner       : "Mihai Bazon",
        !            47: 	sponsor       : "American Bible Society",
        !            48: 	sponsor_url   : "http://www.americanbible.org",
        !            49: 	license       : "htmlArea"
        !            50: };
        !            51: 
1.1       www        52: SpellChecker.btnList = [
                     53: 	null, // separator
                     54: 	["spell-check"]
                     55: 	];
                     56: 
                     57: SpellChecker.prototype.buttonPress = function(editor, id) {
                     58: 	switch (id) {
                     59: 	    case "SC-spell-check":
                     60: 		SpellChecker.editor = editor;
                     61: 		SpellChecker.init = true;
1.2     ! www        62: 		var uiurl = _editor_url + "plugins/SpellChecker/spell-check-ui.html";
1.1       www        63: 		var win;
                     64: 		if (HTMLArea.is_ie) {
                     65: 			win = window.open(uiurl, "SC_spell_checker",
                     66: 					  "toolbar=no,location=no,directories=no,status=no,menubar=no," +
1.2     ! www        67: 					  "scrollbars=no,resizable=yes,width=600,height=450");
1.1       www        68: 		} else {
                     69: 			win = window.open(uiurl, "SC_spell_checker",
1.2     ! www        70: 					  "toolbar=no,menubar=no,personalbar=no,width=600,height=450," +
1.1       www        71: 					  "scrollbars=no,resizable=yes");
                     72: 		}
                     73: 		win.focus();
                     74: 		break;
                     75: 	}
                     76: };
                     77: 
                     78: // this needs to be global, it's accessed from spell-check-ui.html
                     79: SpellChecker.editor = null;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>