webcit_before_automake is now the trunk
[citadel.git] / webcit / tiny_mce / plugins / iespell / editor_plugin_src.js
1 /* Import plugin specific language pack */\r
2 tinyMCE.importPluginLanguagePack('iespell', 'cs,el,en,fr_ca,it,ko,sv,zh_cn,fr,de,pl,pt_br,nl,da,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,zh_tw,zh_tw_utf8,sk');\r
3 \r
4 function TinyMCE_iespell_getInfo() {\r
5         return {\r
6                 longname : 'IESpell',\r
7                 author : 'Moxiecode Systems',\r
8                 authorurl : 'http://tinymce.moxiecode.com',\r
9                 infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_iespell.html',\r
10                 version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion\r
11         };\r
12 };\r
13 \r
14 /**\r
15  * Returns the HTML contents of the iespell control.\r
16  */\r
17 function TinyMCE_iespell_getControlHTML(control_name) {\r
18         // Is it the iespell control and is the brower MSIE.\r
19         if (control_name == "iespell" && (tinyMCE.isMSIE && !tinyMCE.isOpera)) {\r
20                 var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceIESpell\');return false;';\r
21                 return '<a href="javascript:' + cmd + '" onclick="' + cmd + '" target="_self" 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>';\r
22         }\r
23 \r
24         return "";\r
25 }\r
26 \r
27 /**\r
28  * Executes the mceIESpell command.\r
29  */\r
30 function TinyMCE_iespell_execCommand(editor_id, element, command, user_interface, value) {\r
31         // Handle ieSpellCommand\r
32         if (command == "mceIESpell") {\r
33                 try {\r
34                         var ieSpell = new ActiveXObject("ieSpell.ieSpellExtension");\r
35                         ieSpell.CheckDocumentNode(tinyMCE.getInstanceById(editor_id).contentDocument.documentElement);\r
36                 } catch (e) {\r
37                         if (e.number == -2146827859) {\r
38                                 if (confirm(tinyMCE.getLang("lang_iespell_download", "", true)))\r
39                                         window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');\r
40                         } else\r
41                                 alert("Error Loading ieSpell: Exception " + e.number);\r
42                 }\r
43 \r
44                 return true;\r
45         }\r
46 \r
47         // Pass to next handler in chain\r
48         return false;\r
49 }