plugin.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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.3.0 (2020-05-21)
  8. */
  9. (function () {
  10. 'use strict';
  11. var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
  12. var register = function (editor) {
  13. editor.addCommand('InsertHorizontalRule', function () {
  14. editor.execCommand('mceInsertContent', false, '<hr />');
  15. });
  16. };
  17. var register$1 = function (editor) {
  18. editor.ui.registry.addButton('hr', {
  19. icon: 'horizontal-rule',
  20. tooltip: 'Horizontal line',
  21. onAction: function () {
  22. return editor.execCommand('InsertHorizontalRule');
  23. }
  24. });
  25. editor.ui.registry.addMenuItem('hr', {
  26. icon: 'horizontal-rule',
  27. text: 'Horizontal line',
  28. onAction: function () {
  29. return editor.execCommand('InsertHorizontalRule');
  30. }
  31. });
  32. };
  33. function Plugin () {
  34. global.add('hr', function (editor) {
  35. register(editor);
  36. register$1(editor);
  37. });
  38. }
  39. Plugin();
  40. }());