]> code.citadel.org Git - citadel.git/blob - webcit/tiny_mce/plugins/emotions/editor_plugin_src.js
* Removed the Kevin Roth rich text editor and replaced it with TinyMCE.
[citadel.git] / webcit / tiny_mce / plugins / emotions / editor_plugin_src.js
1 /* Import plugin specific language pack */
2 tinyMCE.importPluginLanguagePack('emotions', 'en,sv,zh_cn,cs,fa,fr_ca,fr,de,pl,pt_br,nl');
3
4 function TinyMCE_emotions_getInfo() {
5         return {
6                 longname : 'Emotions',
7                 author : 'Moxiecode Systems',
8                 authorurl : 'http://tinymce.moxiecode.com',
9                 infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_emotions.html',
10                 version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
11         };
12 };
13
14 /**
15  * Returns the HTML contents of the emotions control.
16  */
17 function TinyMCE_emotions_getControlHTML(control_name) {
18         switch (control_name) {
19                 case "emotions":
20                         return '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceEmotion\');" 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>';
21         }
22
23         return "";
24 }
25
26 /**
27  * Executes the mceEmotion command.
28  */
29 function TinyMCE_emotions_execCommand(editor_id, element, command, user_interface, value) {
30         // Handle commands
31         switch (command) {
32                 case "mceEmotion":
33                         var template = new Array();
34
35                         template['file'] = '../../plugins/emotions/emotions.htm'; // Relative to theme
36                         template['width'] = 160;
37                         template['height'] = 160;
38
39                         // Language specific width and height addons
40                         template['width'] += tinyMCE.getLang('lang_emotions_delta_width', 0);
41                         template['height'] += tinyMCE.getLang('lang_emotions_delta_height', 0);
42
43                         tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
44
45                         return true;
46         }
47
48         // Pass to next handler in chain
49         return false;
50 }