editor_plugin_src.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * editor_plugin_src.js
  3. *
  4. * Copyright 2009, Moxiecode Systems AB
  5. * Released under LGPL License.
  6. *
  7. * License: http://tinymce.moxiecode.com/license
  8. * Contributing: http://tinymce.moxiecode.com/contributing
  9. */
  10. (function() {
  11. tinymce.create('tinymce.plugins.AdvancedHRPlugin', {
  12. init : function(ed, url) {
  13. // Register commands
  14. ed.addCommand('mceAdvancedHr', function() {
  15. ed.windowManager.open({
  16. file : url + '/rule.htm',
  17. width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),
  18. height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),
  19. inline : 1
  20. }, {
  21. plugin_url : url
  22. });
  23. });
  24. // Register buttons
  25. ed.addButton('advhr', {
  26. title : 'advhr.advhr_desc',
  27. cmd : 'mceAdvancedHr'
  28. });
  29. ed.onNodeChange.add(function(ed, cm, n) {
  30. cm.setActive('advhr', n.nodeName == 'HR');
  31. });
  32. ed.onClick.add(function(ed, e) {
  33. e = e.target;
  34. if (e.nodeName === 'HR')
  35. ed.selection.select(e);
  36. });
  37. },
  38. getInfo : function() {
  39. return {
  40. longname : 'Advanced HR',
  41. author : 'Moxiecode Systems AB',
  42. authorurl : 'http://tinymce.moxiecode.com',
  43. infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
  44. version : tinymce.majorVersion + "." + tinymce.minorVersion
  45. };
  46. }
  47. });
  48. // Register plugin
  49. tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);
  50. })();