home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Plugins / tinymce-advanced / mce / emotions / editor_plugin.js next >
Encoding:
Text File  |  2008-02-20  |  1.9 KB  |  72 lines

  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.  * Modified to use the build-in smilies in WordPress.
  8.  */
  9.  
  10. // UK lang variables
  11. tadvmce = realTinyMCE;
  12. tadvmce.addToLang('emotions',{
  13. title : ':-)'
  14. });
  15.  
  16. /* Import plugin specific language pack */
  17. tinyMCE.importPluginLanguagePack('emotions');
  18.  
  19. // Plugin static class
  20. var TinyMCE_EmotionsPlugin = {
  21.     getInfo : function() {
  22.         return {
  23.             longname : 'Emotions',
  24.             author : 'Moxiecode Systems AB',
  25.             authorurl : 'http://tinymce.moxiecode.com',
  26.             infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',
  27.             version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
  28.         };
  29.     },
  30.  
  31.     /**
  32.      * Returns the HTML contents of the emotions control.
  33.      */
  34.     getControlHTML : function(cn) {
  35.         switch (cn) {
  36.             case "emotions":
  37.                 return tinyMCE.getButtonHTML(cn, 'lang_emotions_desc', '{$pluginurl}/images/emotions.gif', 'mceEmotion');
  38.         }
  39.  
  40.         return "";
  41.     },
  42.  
  43.     /**
  44.      * Executes the mceEmotion command.
  45.      */
  46.     execCommand : function(editor_id, element, command, user_interface, value) {
  47.         // Handle commands
  48.         switch (command) {
  49.             case "mceEmotion":
  50.                 var template = new Array();
  51.  
  52.                 template['file'] = tinyMCE.baseURL + '/../../../wp-content/plugins/tinymce-advanced/mce/emotions/emotions.htm'; // Relative to theme
  53.                 template['width'] = 230;
  54.                 template['height'] = 140;
  55.  
  56.                 // Language specific width and height addons
  57.                 template['width'] += tinyMCE.getLang('lang_emotions_delta_width', 0);
  58.                 template['height'] += tinyMCE.getLang('lang_emotions_delta_height', 0);
  59.  
  60.                 tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
  61.  
  62.                 return true;
  63.         }
  64.  
  65.         // Pass to next handler in chain
  66.         return false;
  67.     }
  68. };
  69.  
  70. // Register plugin
  71. tinyMCE.addPlugin('emotions', TinyMCE_EmotionsPlugin);
  72.