webcit_before_automake is now the trunk
[citadel.git] / webcit / tiny_mce / plugins / emotions / editor_plugin_src.js
1 /* Import plugin specific language pack */\r
2 tinyMCE.importPluginLanguagePack('emotions', 'en,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
3 \r
4 function TinyMCE_emotions_getInfo() {\r
5         return {\r
6                 longname : 'Emotions',\r
7                 author : 'Moxiecode Systems',\r
8                 authorurl : 'http://tinymce.moxiecode.com',\r
9                 infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_emotions.html',\r
10                 version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion\r
11         };\r
12 };\r
13 \r
14 /**\r
15  * Returns the HTML contents of the emotions control.\r
16  */\r
17 function TinyMCE_emotions_getControlHTML(control_name) {\r
18         switch (control_name) {\r
19                 case "emotions":\r
20                         var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceEmotion\');return false;';\r
21                         return '<a href="javascript:' + cmd + '" onclick="' + cmd + '" target="_self" onmousedown="return false;"><img id="{$editor_id}_emotions" src="{$pluginurl}/images/emotions.gif" title="{$lang_emotions_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>';\r
22         }\r
23 \r
24         return "";\r
25 }\r
26 \r
27 /**\r
28  * Executes the mceEmotion command.\r
29  */\r
30 function TinyMCE_emotions_execCommand(editor_id, element, command, user_interface, value) {\r
31         // Handle commands\r
32         switch (command) {\r
33                 case "mceEmotion":\r
34                         var template = new Array();\r
35 \r
36                         template['file'] = '../../plugins/emotions/emotions.htm'; // Relative to theme\r
37                         template['width'] = 160;\r
38                         template['height'] = 160;\r
39 \r
40                         // Language specific width and height addons\r
41                         template['width'] += tinyMCE.getLang('lang_emotions_delta_width', 0);\r
42                         template['height'] += tinyMCE.getLang('lang_emotions_delta_height', 0);\r
43 \r
44                         tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});\r
45 \r
46                         return true;\r
47         }\r
48 \r
49         // Pass to next handler in chain\r
50         return false;\r
51 }\r