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