Rev 1422 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
597 | daniel-mar | 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 | * |
||
1434 | daniel-mar | 7 | * Version: 5.10.9 (2023-11-15) |
597 | daniel-mar | 8 | */ |
9 | (function () { |
||
10 | 'use strict'; |
||
11 | |||
637 | daniel-mar | 12 | var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
597 | daniel-mar | 13 | |
637 | daniel-mar | 14 | var global = tinymce.util.Tools.resolve('tinymce.Env'); |
597 | daniel-mar | 15 | |
637 | daniel-mar | 16 | var register$1 = function (editor) { |
597 | daniel-mar | 17 | editor.addCommand('mcePrint', function () { |
637 | daniel-mar | 18 | if (global.browser.isIE()) { |
597 | daniel-mar | 19 | editor.getDoc().execCommand('print', false, null); |
20 | } else { |
||
21 | editor.getWin().print(); |
||
22 | } |
||
23 | }); |
||
24 | }; |
||
25 | |||
637 | daniel-mar | 26 | var register = function (editor) { |
27 | var onAction = function () { |
||
28 | return editor.execCommand('mcePrint'); |
||
29 | }; |
||
597 | daniel-mar | 30 | editor.ui.registry.addButton('print', { |
31 | icon: 'print', |
||
32 | tooltip: 'Print', |
||
637 | daniel-mar | 33 | onAction: onAction |
597 | daniel-mar | 34 | }); |
35 | editor.ui.registry.addMenuItem('print', { |
||
36 | text: 'Print...', |
||
37 | icon: 'print', |
||
637 | daniel-mar | 38 | onAction: onAction |
597 | daniel-mar | 39 | }); |
40 | }; |
||
41 | |||
42 | function Plugin () { |
||
637 | daniel-mar | 43 | global$1.add('print', function (editor) { |
44 | register$1(editor); |
||
597 | daniel-mar | 45 | register(editor); |
46 | editor.addShortcut('Meta+P', '', 'mcePrint'); |
||
47 | }); |
||
48 | } |
||
49 | |||
50 | Plugin(); |
||
51 | |||
52 | }()); |