includes/clientside/tinymce/plugins/iespell/editor_plugin_src.js
changeset 335 67bd3121a12e
parent 1 fe660c52c48f
child 395 fa4c5ecb7c9a
--- a/includes/clientside/tinymce/plugins/iespell/editor_plugin_src.js	Wed Dec 26 00:37:26 2007 -0500
+++ b/includes/clientside/tinymce/plugins/iespell/editor_plugin_src.js	Thu Dec 27 22:09:33 2007 -0500
@@ -1,58 +1,51 @@
 /**
- * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
+ * $Id: editor_plugin_src.js 372 2007-11-11 18:38:50Z spocke $
  *
  * @author Moxiecode
  * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
  */
 
-/* Import plugin specific language pack */
-tinyMCE.importPluginLanguagePack('iespell');
+(function() {
+	tinymce.create('tinymce.plugins.IESpell', {
+		init : function(ed, url) {
+			var t = this, sp;
 
-var TinyMCE_IESpellPlugin = {
-	getInfo : function() {
-		return {
-			longname : 'IESpell (MSIE Only)',
-			author : 'Moxiecode Systems AB',
-			authorurl : 'http://tinymce.moxiecode.com',
-			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',
-			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
-		};
-	},
+			if (!tinymce.isIE)
+				return;
 
-	/**
-	 * Returns the HTML contents of the iespell control.
-	 */
-	getControlHTML : function(cn) {
-		// Is it the iespell control and is the brower MSIE.
-		if (cn == "iespell" && (tinyMCE.isMSIE && !tinyMCE.isOpera))
-			return tinyMCE.getButtonHTML(cn, 'lang_iespell_desc', '{$pluginurl}/images/iespell.gif', 'mceIESpell');
-
-		return "";
-	},
+			t.editor = ed;
 
-	/**
-	 * Executes the mceIESpell command.
-	 */
-	execCommand : function(editor_id, element, command, user_interface, value) {
-		// Handle ieSpellCommand
-		if (command == "mceIESpell") {
-			try {
-				var ieSpell = new ActiveXObject("ieSpell.ieSpellExtension");
-				ieSpell.CheckDocumentNode(tinyMCE.getInstanceById(editor_id).contentDocument.documentElement);
-			} catch (e) {
-				if (e.number == -2146827859) {
-					if (confirm(tinyMCE.getLang("lang_iespell_download", "", true)))
-						window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');
-				} else
-					alert("Error Loading ieSpell: Exception " + e.number);
-			}
+			// Register commands
+			ed.addCommand('mceIESpell', function() {
+				try {
+					sp = new ActiveXObject("ieSpell.ieSpellExtension");
+					sp.CheckDocumentNode(ed.getDoc().documentElement);
+				} catch (e) {
+					if (e.number == -2146827859) {
+						ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) {
+							if (s)
+								window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');
+						});
+					} else
+						ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number);
+				}
+			});
 
-			return true;
-		}
+			// Register buttons
+			ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'});
+		},
 
-		// Pass to next handler in chain
-		return false;
-	}
-};
+		getInfo : function() {
+			return {
+				longname : 'IESpell (IE Only)',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		}
+	});
 
-tinyMCE.addPlugin("iespell", TinyMCE_IESpellPlugin);
+	// Register plugin
+	tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell);
+})();
\ No newline at end of file