includes/clientside/tinymce/plugins/emotions/editor_plugin_src.js
changeset 1 fe660c52c48f
equal deleted inserted replaced
0:902822492a68 1:fe660c52c48f
       
     1 /**
       
     2  * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
       
     3  *
       
     4  * @author Moxiecode
       
     5  * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
       
     6  */
       
     7 
       
     8 /* Import plugin specific language pack */
       
     9 tinyMCE.importPluginLanguagePack('emotions');
       
    10 
       
    11 // Plucin static class
       
    12 var TinyMCE_EmotionsPlugin = {
       
    13 	getInfo : function() {
       
    14 		return {
       
    15 			longname : 'Emotions',
       
    16 			author : 'Moxiecode Systems AB',
       
    17 			authorurl : 'http://tinymce.moxiecode.com',
       
    18 			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',
       
    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'] = 250;
       
    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);