Subversion Repositories oidplus

Rev

Rev 637 | Rev 759 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 637 Rev 679
Line 2... Line 2...
2
 * Copyright (c) Tiny Technologies, Inc. All rights reserved.
2
 * Copyright (c) Tiny Technologies, Inc. All rights reserved.
3
 * Licensed under the LGPL or a commercial license.
3
 * Licensed under the LGPL or a commercial license.
4
 * For LGPL see License.txt in the project root for license information.
4
 * For LGPL see License.txt in the project root for license information.
5
 * For commercial licenses see https://www.tiny.cloud/
5
 * For commercial licenses see https://www.tiny.cloud/
6
 *
6
 *
7
 * Version: 5.9.2 (2021-09-08)
7
 * Version: 5.10.2 (2021-11-17)
8
 */
8
 */
9
(function () {
9
(function () {
10
    'use strict';
10
    'use strict';
11
 
11
 
12
    var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
12
    var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
Line 94... Line 94...
94
        editor.insertContent(getDateTime(editor, format));
94
        editor.insertContent(getDateTime(editor, format));
95
      }
95
      }
96
    };
96
    };
97
 
97
 
98
    var register$1 = function (editor) {
98
    var register$1 = function (editor) {
99
      editor.addCommand('mceInsertDate', function () {
99
      editor.addCommand('mceInsertDate', function (_ui, value) {
100
        insertDateTime(editor, getDateFormat(editor));
100
        insertDateTime(editor, value !== null && value !== void 0 ? value : getDateFormat(editor));
101
      });
101
      });
102
      editor.addCommand('mceInsertTime', function () {
102
      editor.addCommand('mceInsertTime', function (_ui, value) {
103
        insertDateTime(editor, getTimeFormat(editor));
103
        insertDateTime(editor, value !== null && value !== void 0 ? value : getTimeFormat(editor));
104
      });
104
      });
105
    };
105
    };
106
 
106
 
107
    var Cell = function (initial) {
107
    var Cell = function (initial) {
108
      var value = initial;
108
      var value = initial;
Line 121... Line 121...
121
    var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
121
    var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
122
 
122
 
123
    var register = function (editor) {
123
    var register = function (editor) {
124
      var formats = getFormats(editor);
124
      var formats = getFormats(editor);
125
      var defaultFormat = Cell(getDefaultDateTime(editor));
125
      var defaultFormat = Cell(getDefaultDateTime(editor));
-
 
126
      var insertDateTime = function (format) {
-
 
127
        return editor.execCommand('mceInsertDate', false, format);
-
 
128
      };
126
      editor.ui.registry.addSplitButton('insertdatetime', {
129
      editor.ui.registry.addSplitButton('insertdatetime', {
127
        icon: 'insert-time',
130
        icon: 'insert-time',
128
        tooltip: 'Insert date/time',
131
        tooltip: 'Insert date/time',
129
        select: function (value) {
132
        select: function (value) {
130
          return value === defaultFormat.get();
133
          return value === defaultFormat.get();
Line 137... Line 140...
137
              value: format
140
              value: format
138
            };
141
            };
139
          }));
142
          }));
140
        },
143
        },
141
        onAction: function (_api) {
144
        onAction: function (_api) {
142
          insertDateTime(editor, defaultFormat.get());
145
          insertDateTime(defaultFormat.get());
143
        },
146
        },
144
        onItemAction: function (_api, value) {
147
        onItemAction: function (_api, value) {
145
          defaultFormat.set(value);
148
          defaultFormat.set(value);
146
          insertDateTime(editor, value);
149
          insertDateTime(value);
147
        }
150
        }
148
      });
151
      });
149
      var makeMenuItemHandler = function (format) {
152
      var makeMenuItemHandler = function (format) {
150
        return function () {
153
        return function () {
151
          defaultFormat.set(format);
154
          defaultFormat.set(format);
152
          insertDateTime(editor, format);
155
          insertDateTime(format);
153
        };
156
        };
154
      };
157
      };
155
      editor.ui.registry.addNestedMenuItem('insertdatetime', {
158
      editor.ui.registry.addNestedMenuItem('insertdatetime', {
156
        icon: 'insert-time',
159
        icon: 'insert-time',
157
        text: 'Date/time',
160
        text: 'Date/time',