mise a jour pour mtweb.0.9.0
[mw_pages] / app / out / default / tiny_mce / plugins / example / editor_plugin_src.js
diff --git a/app/out/default/tiny_mce/plugins/example/editor_plugin_src.js b/app/out/default/tiny_mce/plugins/example/editor_plugin_src.js
new file mode 100644 (file)
index 0000000..9a0e7da
--- /dev/null
@@ -0,0 +1,84 @@
+/**\r
+ * editor_plugin_src.js\r
+ *\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
+(function() {\r
+       // Load plugin specific language pack\r
+       tinymce.PluginManager.requireLangPack('example');\r
+\r
+       tinymce.create('tinymce.plugins.ExamplePlugin', {\r
+               /**\r
+                * Initializes the plugin, this will be executed after the plugin has been created.\r
+                * This call is done before the editor instance has finished it's initialization so use the onInit event\r
+                * of the editor instance to intercept that event.\r
+                *\r
+                * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.\r
+                * @param {string} url Absolute URL to where the plugin is located.\r
+                */\r
+               init : function(ed, url) {\r
+                       // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');\r
+                       ed.addCommand('mceExample', function() {\r
+                               ed.windowManager.open({\r
+                                       file : url + '/dialog.htm',\r
+                                       width : 320 + parseInt(ed.getLang('example.delta_width', 0)),\r
+                                       height : 120 + parseInt(ed.getLang('example.delta_height', 0)),\r
+                                       inline : 1\r
+                               }, {\r
+                                       plugin_url : url, // Plugin absolute URL\r
+                                       some_custom_arg : 'custom arg' // Custom argument\r
+                               });\r
+                       });\r
+\r
+                       // Register example button\r
+                       ed.addButton('example', {\r
+                               title : 'example.desc',\r
+                               cmd : 'mceExample',\r
+                               image : url + '/img/example.gif'\r
+                       });\r
+\r
+                       // Add a node change handler, selects the button in the UI when a image is selected\r
+                       ed.onNodeChange.add(function(ed, cm, n) {\r
+                               cm.setActive('example', n.nodeName == 'IMG');\r
+                       });\r
+               },\r
+\r
+               /**\r
+                * Creates control instances based in the incomming name. This method is normally not\r
+                * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons\r
+                * but you sometimes need to create more complex controls like listboxes, split buttons etc then this\r
+                * method can be used to create those.\r
+                *\r
+                * @param {String} n Name of the control to create.\r
+                * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.\r
+                * @return {tinymce.ui.Control} New control instance or null if no control was created.\r
+                */\r
+               createControl : function(n, cm) {\r
+                       return null;\r
+               },\r
+\r
+               /**\r
+                * Returns information about the plugin as a name/value array.\r
+                * The current keys are longname, author, authorurl, infourl and version.\r
+                *\r
+                * @return {Object} Name/value array containing information about the plugin.\r
+                */\r
+               getInfo : function() {\r
+                       return {\r
+                               longname : 'Example plugin',\r
+                               author : 'Some author',\r
+                               authorurl : 'http://tinymce.moxiecode.com',\r
+                               infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',\r
+                               version : "1.0"\r
+                       };\r
+               }\r
+       });\r
+\r
+       // Register plugin\r
+       tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin);\r
+})();
\ No newline at end of file