Subversion Repositories oidplus

Rev

Rev 1042 | Go to most recent revision | View as "text/javascript" | Blame | Compare with Previous | Last modification | View Log | RSS feed

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