plugin.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 print = (function () {
  11. 'use strict';
  12. var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
  13. var register = function (editor) {
  14. editor.addCommand('mcePrint', function () {
  15. editor.getWin().print();
  16. });
  17. };
  18. var Commands = { register: register };
  19. var register$1 = function (editor) {
  20. editor.ui.registry.addButton('print', {
  21. icon: 'print',
  22. tooltip: 'Print',
  23. onAction: function () {
  24. return editor.execCommand('mcePrint');
  25. }
  26. });
  27. editor.ui.registry.addMenuItem('print', {
  28. text: 'Print...',
  29. icon: 'print',
  30. onAction: function () {
  31. return editor.execCommand('mcePrint');
  32. }
  33. });
  34. };
  35. var Buttons = { register: register$1 };
  36. global.add('print', function (editor) {
  37. Commands.register(editor);
  38. Buttons.register(editor);
  39. editor.addShortcut('Meta+P', '', 'mcePrint');
  40. });
  41. function Plugin () {
  42. }
  43. return Plugin;
  44. }());
  45. })();