]> code.citadel.org Git - citadel.git/blob - webcit/tiny_mce/plugins/iespell/editor_plugin_src.js
* Removed the Kevin Roth rich text editor and replaced it with TinyMCE.
[citadel.git] / webcit / tiny_mce / plugins / iespell / editor_plugin_src.js
1 /* Import plugin specific language pack */
2 tinyMCE.importPluginLanguagePack('iespell', 'cs,el,en,fr_ca,it,ko,sv,zh_cn,fr,de,pl,pt_br,nl');
3
4 function TinyMCE_iespell_getInfo() {
5         return {
6                 longname : 'IESpell',
7                 author : 'Moxiecode Systems',
8                 authorurl : 'http://tinymce.moxiecode.com',
9                 infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_iespell.html',
10                 version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
11         };
12 };
13
14 /**
15  * Returns the HTML contents of the iespell control.
16  */
17 function TinyMCE_iespell_getControlHTML(control_name) {
18         // Is it the iespell control and is the brower MSIE.
19         if (control_name == "iespell" && tinyMCE.isMSIE)
20                 return '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceIESpell\');" onmousedown="return false;"><img id="{$editor_id}_iespell" src="{$pluginurl}/images/iespell.gif" title="{$lang_iespell_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>';
21
22         return "";
23 }
24
25 /**
26  * Executes the mceIESpell command.
27  */
28 function TinyMCE_iespell_execCommand(editor_id, element, command, user_interface, value) {
29         // Handle ieSpellCommand
30         if (command == "mceIESpell") {
31                 try {
32                         var ieSpell = new ActiveXObject("ieSpell.ieSpellExtension");
33                         ieSpell.CheckDocumentNode(tinyMCE.getInstanceById(editor_id).contentDocument.documentElement);
34                 } catch (e) {
35                         if (e.number == -2146827859) {
36                                 if (confirm(tinyMCE.getLang("lang_iespell_download", "", true)))
37                                         window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');
38                         } else
39                                 alert("Error Loading ieSpell: Exception " + e.number);
40                 }
41
42                 return true;
43         }
44
45         // Pass to next handler in chain
46         return false;
47 }