egroupware_official/phpgwapi/js/htmlarea/plugins/SpellChecker/spell-checker.js
viniciuscb 0a28f3812e Some changes:
- Inclusion of the following javascript directories:
  * Connector: javascript object to interface xmlhttprequest object. This object allows
      asynchronous posts and support for messages while this post is being done, such as
      "wait, contacting server", etc.
  * JsAPI: general javascript functions and methods
  * jsolait: performs conversion from a xmlrpc message to a javascript object
  * xmlRpcMsgCreator: performs conversion from a javascript object to a xmlrpc message
  * dynapi: cross-browser class to draw layers

- Update in setup version: now is 1.0.1.008; Update your versions. There was made a
  change in phpgw_vfs2_files table in handling of modified files.

- Upgrade of vfs2 classes and PclZip class

- Changes in javascript object and common object to allow the javascript backend to
  applications to work (now just filescenter will use it...)
2005-06-18 20:43:14 +00:00

80 lines
2.1 KiB
JavaScript

// Spell Checker Plugin for HTMLArea-3.0
// Sponsored by www.americanbible.org
// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
//
// (c) dynarch.com 2003.
// Distributed under the same terms as HTMLArea itself.
// This notice MUST stay intact for use (see license.txt).
//
// $Id$
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 = 0; i < bl.length; ++i) {
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 = 0; i < toolbar.length; ++i) {
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=450");
} else {
win = window.open(uiurl, "SC_spell_checker",
"toolbar=no,menubar=no,personalbar=no,width=600,height=450," +
"scrollbars=no,resizable=yes");
}
win.focus();
break;
}
};
// this needs to be global, it's accessed from spell-check-ui.html
SpellChecker.editor = null;