A tumblelog CMS built on AJAX, PHP and MySQL.

editor_plugin_src.js 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. /* Import plugin specific language pack */
  8. tinyMCE.importPluginLanguagePack('emotions');
  9. // Plucin static class
  10. var TinyMCE_EmotionsPlugin = {
  11. getInfo : function() {
  12. return {
  13. longname : 'Emotions',
  14. author : 'Moxiecode Systems AB',
  15. authorurl : 'http://tinymce.moxiecode.com',
  16. infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',
  17. version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
  18. };
  19. },
  20. /**
  21. * Returns the HTML contents of the emotions control.
  22. */
  23. getControlHTML : function(cn) {
  24. switch (cn) {
  25. case "emotions":
  26. return tinyMCE.getButtonHTML(cn, 'lang_emotions_desc', '{$pluginurl}/images/emotions.gif', 'mceEmotion');
  27. }
  28. return "";
  29. },
  30. /**
  31. * Executes the mceEmotion command.
  32. */
  33. execCommand : function(editor_id, element, command, user_interface, value) {
  34. // Handle commands
  35. switch (command) {
  36. case "mceEmotion":
  37. var template = new Array();
  38. template['file'] = '../../plugins/emotions/emotions.htm'; // Relative to theme
  39. template['width'] = 250;
  40. template['height'] = 160;
  41. // Language specific width and height addons
  42. template['width'] += tinyMCE.getLang('lang_emotions_delta_width', 0);
  43. template['height'] += tinyMCE.getLang('lang_emotions_delta_height', 0);
  44. tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
  45. return true;
  46. }
  47. // Pass to next handler in chain
  48. return false;
  49. }
  50. };
  51. // Register plugin
  52. tinyMCE.addPlugin('emotions', TinyMCE_EmotionsPlugin);