]> code.citadel.org Git - citadel.git/blob - webcit/tiny_mce/plugins/emotions/editor_plugin_src.js
Upgrade of TinyMCE is in progress.
[citadel.git] / webcit / tiny_mce / plugins / emotions / editor_plugin_src.js
1 /**\r
2  * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $\r
3  *\r
4  * @author Moxiecode\r
5  * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.\r
6  */\r
7 \r
8 /* Import plugin specific language pack */\r
9 tinyMCE.importPluginLanguagePack('emotions');\r
10 \r
11 // Plucin static class\r
12 var TinyMCE_EmotionsPlugin = {\r
13         getInfo : function() {\r
14                 return {\r
15                         longname : 'Emotions',\r
16                         author : 'Moxiecode Systems AB',\r
17                         authorurl : 'http://tinymce.moxiecode.com',\r
18                         infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',\r
19                         version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion\r
20                 };\r
21         },\r
22 \r
23         /**\r
24          * Returns the HTML contents of the emotions control.\r
25          */\r
26         getControlHTML : function(cn) {\r
27                 switch (cn) {\r
28                         case "emotions":\r
29                                 return tinyMCE.getButtonHTML(cn, 'lang_emotions_desc', '{$pluginurl}/images/emotions.gif', 'mceEmotion');\r
30                 }\r
31 \r
32                 return "";\r
33         },\r
34 \r
35         /**\r
36          * Executes the mceEmotion command.\r
37          */\r
38         execCommand : function(editor_id, element, command, user_interface, value) {\r
39                 // Handle commands\r
40                 switch (command) {\r
41                         case "mceEmotion":\r
42                                 var template = new Array();\r
43 \r
44                                 template['file'] = '../../plugins/emotions/emotions.htm'; // Relative to theme\r
45                                 template['width'] = 250;\r
46                                 template['height'] = 160;\r
47 \r
48                                 // Language specific width and height addons\r
49                                 template['width'] += tinyMCE.getLang('lang_emotions_delta_width', 0);\r
50                                 template['height'] += tinyMCE.getLang('lang_emotions_delta_height', 0);\r
51 \r
52                                 tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});\r
53 \r
54                                 return true;\r
55                 }\r
56 \r
57                 // Pass to next handler in chain\r
58                 return false;\r
59         }\r
60 };\r
61 \r
62 // Register plugin\r
63 tinyMCE.addPlugin('emotions', TinyMCE_EmotionsPlugin);\r