tagging as ATutor 1.5.4-release
[atutor.git] / jscripts / tiny_mce / plugins / emotions / editor_plugin_src.js
1 /**\r
2  * $RCSfile: editor_plugin_src.js,v $\r
3  * $Revision: 1.23 $\r
4  * $Date: 2006/02/10 16:29:38 $\r
5  *\r
6  * @author Moxiecode\r
7  * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.\r
8  */\r
9 \r
10 /* Import plugin specific language pack */\r
11 tinyMCE.importPluginLanguagePack('emotions', 'en,tr,sv,zh_cn,cs,fa,fr_ca,fr,de,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk');\r
12 \r
13 // Plucin static class\r
14 var TinyMCE_EmotionsPlugin = {\r
15         getInfo : function() {\r
16                 return {\r
17                         longname : 'Emotions',\r
18                         author : 'Moxiecode Systems',\r
19                         authorurl : 'http://tinymce.moxiecode.com',\r
20                         infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_emotions.html',\r
21                         version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion\r
22                 };\r
23         },\r
24 \r
25         /**\r
26          * Returns the HTML contents of the emotions control.\r
27          */\r
28         getControlHTML : function(cn) {\r
29                 switch (cn) {\r
30                         case "emotions":\r
31                                 return tinyMCE.getButtonHTML(cn, 'lang_emotions_desc', '{$pluginurl}/images/emotions.gif', 'mceEmotion');\r
32                 }\r
33 \r
34                 return "";\r
35         },\r
36 \r
37         /**\r
38          * Executes the mceEmotion command.\r
39          */\r
40         execCommand : function(editor_id, element, command, user_interface, value) {\r
41                 // Handle commands\r
42                 switch (command) {\r
43                         case "mceEmotion":\r
44                                 var template = new Array();\r
45 \r
46                                 template['file'] = '../../plugins/emotions/emotions.htm'; // Relative to theme\r
47                                 template['width'] = 160;\r
48                                 template['height'] = 160;\r
49 \r
50                                 // Language specific width and height addons\r
51                                 template['width'] += tinyMCE.getLang('lang_emotions_delta_width', 0);\r
52                                 template['height'] += tinyMCE.getLang('lang_emotions_delta_height', 0);\r
53 \r
54                                 tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});\r
55 \r
56                                 return true;\r
57                 }\r
58 \r
59                 // Pass to next handler in chain\r
60                 return false;\r
61         }\r
62 };\r
63 \r
64 // Register plugin\r
65 tinyMCE.addPlugin('emotions', TinyMCE_EmotionsPlugin);\r