]> code.citadel.org Git - citadel.git/blob - webcit/tiny_mce/plugins/emotions/editor_plugin_src.js
more translations
[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,no,hu');\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                         return '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceEmotion\');" 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
21         }\r
22 \r
23         return "";\r
24 }\r
25 \r
26 /**\r
27  * Executes the mceEmotion command.\r
28  */\r
29 function TinyMCE_emotions_execCommand(editor_id, element, command, user_interface, value) {\r
30         // Handle commands\r
31         switch (command) {\r
32                 case "mceEmotion":\r
33                         var template = new Array();\r
34 \r
35                         template['file'] = '../../plugins/emotions/emotions.htm'; // Relative to theme\r
36                         template['width'] = 160;\r
37                         template['height'] = 160;\r
38 \r
39                         // Language specific width and height addons\r
40                         template['width'] += tinyMCE.getLang('lang_emotions_delta_width', 0);\r
41                         template['height'] += tinyMCE.getLang('lang_emotions_delta_height', 0);\r
42 \r
43                         tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});\r
44 \r
45                         return true;\r
46         }\r
47 \r
48         // Pass to next handler in chain\r
49         return false;\r
50 }\r