adicionando arquivos de media (incluindo o editor tiny mce (LGPL)
[cascardo/eventmanager.git] / media / tiny_mce / plugins / advhr / editor_plugin_src.js
diff --git a/media/tiny_mce/plugins/advhr/editor_plugin_src.js b/media/tiny_mce/plugins/advhr/editor_plugin_src.js
new file mode 100755 (executable)
index 0000000..1005e05
--- /dev/null
@@ -0,0 +1,90 @@
+/**\r
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $\r
+ *\r
+ * @author Moxiecode\r
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.\r
+ */\r
+\r
+/* Import plugin specific language pack */\r
+tinyMCE.importPluginLanguagePack('advhr');\r
+\r
+var TinyMCE_AdvancedHRPlugin = {\r
+       getInfo : function() {\r
+               return {\r
+                       longname : 'Advanced HR',\r
+                       author : 'Moxiecode Systems AB',\r
+                       authorurl : 'http://tinymce.moxiecode.com',\r
+                       infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',\r
+                       version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion\r
+               }\r
+       },\r
+\r
+       getControlHTML : function(cn) {\r
+               switch (cn) {\r
+                       case "advhr":\r
+                               return tinyMCE.getButtonHTML(cn, 'lang_insert_advhr_desc', '{$pluginurl}/images/advhr.gif', 'mceAdvancedHr');\r
+               }\r
+\r
+               return "";\r
+       },\r
+\r
+       /**\r
+        * Executes the mceAdvanceHr command.\r
+        */\r
+       execCommand : function(editor_id, element, command, user_interface, value) {\r
+               // Handle commands\r
+               switch (command) {\r
+                       case "mceAdvancedHr":\r
+                               var template = new Array();\r
+\r
+                               template['file']   = '../../plugins/advhr/rule.htm'; // Relative to theme\r
+                               template['width']  = 250;\r
+                               template['height'] = 160;\r
+\r
+                               template['width']  += tinyMCE.getLang('lang_advhr_delta_width', 0);\r
+                               template['height'] += tinyMCE.getLang('lang_advhr_delta_height', 0);\r
+\r
+                               var size = "", width = "", noshade = "";\r
+                               if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "hr") {\r
+                                       tinyMCE.hrElement = tinyMCE.selectedElement;\r
+\r
+                                       if (tinyMCE.hrElement) {\r
+                                               size    = tinyMCE.hrElement.getAttribute('size') ? tinyMCE.hrElement.getAttribute('size') : "";\r
+                                               width   = tinyMCE.hrElement.getAttribute('width') ? tinyMCE.hrElement.getAttribute('width') : "";\r
+                                               noshade = tinyMCE.hrElement.getAttribute('noshade') ? tinyMCE.hrElement.getAttribute('noshade') : "";\r
+                                       }\r
+\r
+                                       tinyMCE.openWindow(template, {editor_id : editor_id, size : size, width : width, noshade : noshade, mceDo : 'update'});\r
+                               } else {\r
+                                       if (tinyMCE.isMSIE) {\r
+                                               tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false,'<hr />');\r
+                                       } else {\r
+                                               tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", size : size, width : width, noshade : noshade, mceDo : 'insert'});\r
+                                       }\r
+                               }\r
+\r
+                               return true;\r
+               }\r
+\r
+               // Pass to next handler in chain\r
+               return false;\r
+       },\r
+\r
+       handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {\r
+               if (node == null)\r
+                       return;\r
+\r
+               do {\r
+                       if (node.nodeName == "HR") {\r
+                               tinyMCE.switchClass(editor_id + '_advhr', 'mceButtonSelected');\r
+                               return true;\r
+                       }\r
+               } while ((node = node.parentNode));\r
+\r
+               tinyMCE.switchClass(editor_id + '_advhr', 'mceButtonNormal');\r
+\r
+               return true;\r
+       }\r
+};\r
+\r
+tinyMCE.addPlugin("advhr", TinyMCE_AdvancedHRPlugin);\r