a68f69a23807ba9473e8b3e5cddb49f4dd7d5a30
[citadel.git] / webcit / tiny_mce / plugins / iespell / editor_plugin_src.js
1 /**\r
2  * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $\r
3  *\r
4  * @author Moxiecode\r
5  * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.\r
6  */\r
7 \r
8 (function() {\r
9         tinymce.create('tinymce.plugins.IESpell', {\r
10                 init : function(ed, url) {\r
11                         var t = this, sp;\r
12 \r
13                         if (!tinymce.isIE)\r
14                                 return;\r
15 \r
16                         t.editor = ed;\r
17 \r
18                         // Register commands\r
19                         ed.addCommand('mceIESpell', function() {\r
20                                 try {\r
21                                         sp = new ActiveXObject("ieSpell.ieSpellExtension");\r
22                                         sp.CheckDocumentNode(ed.getDoc().documentElement);\r
23                                 } catch (e) {\r
24                                         if (e.number == -2146827859) {\r
25                                                 ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) {\r
26                                                         if (s)\r
27                                                                 window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');\r
28                                                 });\r
29                                         } else\r
30                                                 ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number);\r
31                                 }\r
32                         });\r
33 \r
34                         // Register buttons\r
35                         ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'});\r
36                 },\r
37 \r
38                 getInfo : function() {\r
39                         return {\r
40                                 longname : 'IESpell (IE Only)',\r
41                                 author : 'Moxiecode Systems AB',\r
42                                 authorurl : 'http://tinymce.moxiecode.com',\r
43                                 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',\r
44                                 version : tinymce.majorVersion + "." + tinymce.minorVersion\r
45                         };\r
46                 }\r
47         });\r
48 \r
49         // Register plugin\r
50         tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell);\r
51 })();