PageRenderTime 79ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/BlogEngine/BlogEngine.NET/editors/tiny_mce_3_4_3_1/plugins/advhr/editor_plugin_src.js

#
JavaScript | 57 lines | 38 code | 7 blank | 12 comment | 2 complexity | a7fda2e674f15a33baf53cea2e23ec66 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause
  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. })();