more font size tweaks.
[citadel.git] / webcit / tiny_mce / plugins / iespell / editor_plugin_src.js
old mode 100755 (executable)
new mode 100644 (file)
index 353db1c..1b2bb98
@@ -1,58 +1,54 @@
 /**\r
- * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $\r
+ * editor_plugin_src.js\r
  *\r
- * @author Moxiecode\r
- * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.\r
+ * Copyright 2009, Moxiecode Systems AB\r
+ * Released under LGPL License.\r
+ *\r
+ * License: http://tinymce.moxiecode.com/license\r
+ * Contributing: http://tinymce.moxiecode.com/contributing\r
  */\r
 \r
-/* Import plugin specific language pack */\r
-tinyMCE.importPluginLanguagePack('iespell');\r
-\r
-var TinyMCE_IESpellPlugin = {\r
-       getInfo : function() {\r
-               return {\r
-                       longname : 'IESpell (MSIE Only)',\r
-                       author : 'Moxiecode Systems AB',\r
-                       authorurl : 'http://tinymce.moxiecode.com',\r
-                       infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',\r
-                       version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion\r
-               };\r
-       },\r
-\r
-       /**\r
-        * Returns the HTML contents of the iespell control.\r
-        */\r
-       getControlHTML : function(cn) {\r
-               // Is it the iespell control and is the brower MSIE.\r
-               if (cn == "iespell" && (tinyMCE.isMSIE && !tinyMCE.isOpera))\r
-                       return tinyMCE.getButtonHTML(cn, 'lang_iespell_desc', '{$pluginurl}/images/iespell.gif', 'mceIESpell');\r
-\r
-               return "";\r
-       },\r
-\r
-       /**\r
-        * Executes the mceIESpell command.\r
-        */\r
-       execCommand : function(editor_id, element, command, user_interface, value) {\r
-               // Handle ieSpellCommand\r
-               if (command == "mceIESpell") {\r
-                       try {\r
-                               var ieSpell = new ActiveXObject("ieSpell.ieSpellExtension");\r
-                               ieSpell.CheckDocumentNode(tinyMCE.getInstanceById(editor_id).contentDocument.documentElement);\r
-                       } catch (e) {\r
-                               if (e.number == -2146827859) {\r
-                                       if (confirm(tinyMCE.getLang("lang_iespell_download", "", true)))\r
-                                               window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');\r
-                               } else\r
-                                       alert("Error Loading ieSpell: Exception " + e.number);\r
-                       }\r
-\r
-                       return true;\r
+(function() {\r
+       tinymce.create('tinymce.plugins.IESpell', {\r
+               init : function(ed, url) {\r
+                       var t = this, sp;\r
+\r
+                       if (!tinymce.isIE)\r
+                               return;\r
+\r
+                       t.editor = ed;\r
+\r
+                       // Register commands\r
+                       ed.addCommand('mceIESpell', function() {\r
+                               try {\r
+                                       sp = new ActiveXObject("ieSpell.ieSpellExtension");\r
+                                       sp.CheckDocumentNode(ed.getDoc().documentElement);\r
+                               } catch (e) {\r
+                                       if (e.number == -2146827859) {\r
+                                               ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) {\r
+                                                       if (s)\r
+                                                               window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');\r
+                                               });\r
+                                       } else\r
+                                               ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number);\r
+                               }\r
+                       });\r
+\r
+                       // Register buttons\r
+                       ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'});\r
+               },\r
+\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'IESpell (IE Only)',\r
+                               author : 'Moxiecode Systems AB',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',\r
+                               version : tinymce.majorVersion + "." + tinymce.minorVersion\r
+                       };\r
                }\r
+       });\r
 \r
-               // Pass to next handler in chain\r
-               return false;\r
-       }\r
-};\r
-\r
-tinyMCE.addPlugin("iespell", TinyMCE_IESpellPlugin);\r
+       // Register plugin\r
+       tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell);\r
+})();
\ No newline at end of file