includes/clientside/tinymce/plugins/print/editor_plugin_src.js
changeset 335 67bd3121a12e
parent 1 fe660c52c48f
child 395 fa4c5ecb7c9a
--- a/includes/clientside/tinymce/plugins/print/editor_plugin_src.js	Wed Dec 26 00:37:26 2007 -0500
+++ b/includes/clientside/tinymce/plugins/print/editor_plugin_src.js	Thu Dec 27 22:09:33 2007 -0500
@@ -1,47 +1,31 @@
 /**
- * $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 theme	specific language pack */
-tinyMCE.importPluginLanguagePack('print');
+(function() {
+	tinymce.create('tinymce.plugins.Print', {
+		init : function(ed, url) {
+			ed.addCommand('mcePrint', function() {
+				ed.getWin().print();
+			});
 
-var TinyMCE_PrintPlugin = {
-	getInfo : function() {
-		return {
-			longname : 'Print',
-			author : 'Moxiecode Systems AB',
-			authorurl : 'http://tinymce.moxiecode.com',
-			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print',
-			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
-		};
-	},
-
-	getControlHTML : function(cn)	{
-		switch (cn) {
-			case "print":
-				return tinyMCE.getButtonHTML(cn, 'lang_print_desc', '{$pluginurl}/images/print.gif', 'mcePrint');
-		}
+			ed.addButton('print', {title : 'print.print_desc', cmd : 'mcePrint'});
+		},
 
-		return "";
-	},
+		getInfo : function() {
+			return {
+				longname : 'Print',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		}
+	});
 
-	/**
-	 * Executes	the	search/replace commands.
-	 */
-	execCommand : function(editor_id, element, command,	user_interface,	value) {
-		// Handle commands
-		switch (command) {
-			case "mcePrint":
-				tinyMCE.getInstanceById(editor_id).contentWindow.print();
-				return true;
-		}
-
-		// Pass to next handler in chain
-		return false;
-	}
-};
-
-tinyMCE.addPlugin("print", TinyMCE_PrintPlugin);
+	// Register plugin
+	tinymce.PluginManager.add('print', tinymce.plugins.Print);
+})();