plugin.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * Copyright (c) Tiny Technologies, Inc. All rights reserved.
  3. * Licensed under the LGPL or a commercial license.
  4. * For LGPL see License.txt in the project root for license information.
  5. * For commercial licenses see https://www.tiny.cloud/
  6. *
  7. * Version: 5.0.1 (2019-02-21)
  8. */
  9. (function () {
  10. var hr = (function () {
  11. 'use strict';
  12. var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
  13. var register = function (editor) {
  14. editor.addCommand('InsertHorizontalRule', function () {
  15. editor.execCommand('mceInsertContent', false, '<hr />');
  16. });
  17. };
  18. var Commands = { register: register };
  19. var register$1 = function (editor) {
  20. editor.ui.registry.addButton('hr', {
  21. icon: 'horizontal-rule',
  22. tooltip: 'Horizontal line',
  23. onAction: function () {
  24. return editor.execCommand('InsertHorizontalRule');
  25. }
  26. });
  27. editor.ui.registry.addMenuItem('hr', {
  28. icon: 'horizontal-rule',
  29. text: 'Horizontal line',
  30. onAction: function () {
  31. return editor.execCommand('InsertHorizontalRule');
  32. }
  33. });
  34. };
  35. var Buttons = { register: register$1 };
  36. global.add('hr', function (editor) {
  37. Commands.register(editor);
  38. Buttons.register(editor);
  39. });
  40. function Plugin () {
  41. }
  42. return Plugin;
  43. }());
  44. })();