biso24-editor 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/CKEditor4/.eslintrc.json +4 -0
  2. package/CKEditor4/CHANGES.md +2182 -0
  3. package/CKEditor4/LICENSE.md +1436 -0
  4. package/CKEditor4/README.md +39 -0
  5. package/CKEditor4/SECURITY.md +10 -0
  6. package/CKEditor4/adapters/jquery.js +158 -0
  7. package/CKEditor4/bender-runner.config.json +16 -0
  8. package/CKEditor4/build-config.js +100 -0
  9. package/CKEditor4/ckeditor.js +30065 -0
  10. package/CKEditor4/config.js +39 -0
  11. package/CKEditor4/contents.css +161 -0
  12. package/CKEditor4/lang/vi.js +475 -0
  13. package/CKEditor4/plugins/a11yhelp/dialogs/a11yhelp.js +143 -0
  14. package/CKEditor4/plugins/a11yhelp/dialogs/lang/vi.js +122 -0
  15. package/CKEditor4/plugins/ajax/plugin.js +241 -0
  16. package/CKEditor4/plugins/autocomplete/plugin.js +1655 -0
  17. package/CKEditor4/plugins/autocomplete/skins/default.css +38 -0
  18. package/CKEditor4/plugins/custompaste/plugin.js +57 -0
  19. package/CKEditor4/plugins/dialog/dialogDefinition.js +4 -0
  20. package/CKEditor4/plugins/dialog/styles/dialog.css +18 -0
  21. package/CKEditor4/plugins/font/lang/vi.js +14 -0
  22. package/CKEditor4/plugins/font/plugin.js +535 -0
  23. package/CKEditor4/plugins/icons.png +0 -0
  24. package/CKEditor4/plugins/icons_hidpi.png +0 -0
  25. package/CKEditor4/plugins/image2/dialogs/image2.js +558 -0
  26. package/CKEditor4/plugins/image2/icons/hidpi/image.png +0 -0
  27. package/CKEditor4/plugins/image2/icons/image.png +0 -0
  28. package/CKEditor4/plugins/image2/lang/vi.js +21 -0
  29. package/CKEditor4/plugins/image2/plugin.js +1708 -0
  30. package/CKEditor4/plugins/justify/icons/hidpi/justifyblock.png +0 -0
  31. package/CKEditor4/plugins/justify/icons/hidpi/justifycenter.png +0 -0
  32. package/CKEditor4/plugins/justify/icons/hidpi/justifyleft.png +0 -0
  33. package/CKEditor4/plugins/justify/icons/hidpi/justifyright.png +0 -0
  34. package/CKEditor4/plugins/justify/icons/justifyblock.png +0 -0
  35. package/CKEditor4/plugins/justify/icons/justifycenter.png +0 -0
  36. package/CKEditor4/plugins/justify/icons/justifyleft.png +0 -0
  37. package/CKEditor4/plugins/justify/icons/justifyright.png +0 -0
  38. package/CKEditor4/plugins/justify/plugin.js +266 -0
  39. package/CKEditor4/plugins/justify_group/icons/hidpi/justifycenter.png +0 -0
  40. package/CKEditor4/plugins/justify_group/icons/justifycenter.png +0 -0
  41. package/CKEditor4/plugins/justify_group/plugin.js +64 -0
  42. package/CKEditor4/plugins/lineheight/LICENSE +22 -0
  43. package/CKEditor4/plugins/lineheight/README.md +2 -0
  44. package/CKEditor4/plugins/lineheight/lang/vi.js +3 -0
  45. package/CKEditor4/plugins/lineheight/plugin.js +99 -0
  46. package/CKEditor4/plugins/lineheight/readme.txt +30 -0
  47. package/CKEditor4/plugins/link/dialogs/anchor.js +82 -0
  48. package/CKEditor4/plugins/link/dialogs/link.js +777 -0
  49. package/CKEditor4/plugins/link/images/anchor.png +0 -0
  50. package/CKEditor4/plugins/link/images/hidpi/anchor.png +0 -0
  51. package/CKEditor4/plugins/magicline/images/hidpi/icon-rtl.png +0 -0
  52. package/CKEditor4/plugins/magicline/images/hidpi/icon.png +0 -0
  53. package/CKEditor4/plugins/magicline/images/icon-rtl.png +0 -0
  54. package/CKEditor4/plugins/magicline/images/icon.png +0 -0
  55. package/CKEditor4/plugins/mentions/plugin.js +471 -0
  56. package/CKEditor4/plugins/menubutton/plugin.js +99 -0
  57. package/CKEditor4/plugins/pastefromword/filter/default.js +849 -0
  58. package/CKEditor4/plugins/pastetools/filter/common.js +445 -0
  59. package/CKEditor4/plugins/pastetools/filter/image.js +163 -0
  60. package/CKEditor4/plugins/pdffile/icons/exporttopdf.png +0 -0
  61. package/CKEditor4/plugins/pdffile/icons/hidpi/exporttopdf.png +0 -0
  62. package/CKEditor4/plugins/pdffile/plugin.js +36 -0
  63. package/CKEditor4/plugins/placeholder_button/plugin.js +31 -0
  64. package/CKEditor4/plugins/sourcedialog/dialogs/sourcedialog.js +88 -0
  65. package/CKEditor4/plugins/sourcedialog/icons/hidpi/sourcedialog-rtl.png +0 -0
  66. package/CKEditor4/plugins/sourcedialog/icons/hidpi/sourcedialog.png +0 -0
  67. package/CKEditor4/plugins/sourcedialog/icons/sourcedialog-rtl.png +0 -0
  68. package/CKEditor4/plugins/sourcedialog/icons/sourcedialog.png +0 -0
  69. package/CKEditor4/plugins/sourcedialog/lang/vi.js +9 -0
  70. package/CKEditor4/plugins/sourcedialog/plugin.js +30 -0
  71. package/CKEditor4/plugins/textmatch/plugin.js +331 -0
  72. package/CKEditor4/plugins/textwatcher/plugin.js +295 -0
  73. package/CKEditor4/plugins/widget/images/handle.png +0 -0
  74. package/CKEditor4/plugins/wordfile/icons/exporttoword.png +0 -0
  75. package/CKEditor4/plugins/wordfile/icons/hidpi/exporttoword.png +0 -0
  76. package/CKEditor4/plugins/wordfile/icons/hidpi/importfromword.png +0 -0
  77. package/CKEditor4/plugins/wordfile/icons/importfromword.png +0 -0
  78. package/CKEditor4/plugins/wordfile/plugin.js +161 -0
  79. package/CKEditor4/skins/moono-lisa/dialog.css +685 -0
  80. package/CKEditor4/skins/moono-lisa/dialog_ie.css +721 -0
  81. package/CKEditor4/skins/moono-lisa/dialog_ie8.css +746 -0
  82. package/CKEditor4/skins/moono-lisa/dialog_iequirks.css +724 -0
  83. package/CKEditor4/skins/moono-lisa/editor.css +1551 -0
  84. package/CKEditor4/skins/moono-lisa/editor_gecko.css +1556 -0
  85. package/CKEditor4/skins/moono-lisa/editor_ie.css +1588 -0
  86. package/CKEditor4/skins/moono-lisa/editor_ie8.css +1639 -0
  87. package/CKEditor4/skins/moono-lisa/editor_iequirks.css +1632 -0
  88. package/CKEditor4/skins/moono-lisa/icons.png +0 -0
  89. package/CKEditor4/skins/moono-lisa/icons_hidpi.png +0 -0
  90. package/CKEditor4/skins/moono-lisa/images/arrow.png +0 -0
  91. package/CKEditor4/skins/moono-lisa/images/close.png +0 -0
  92. package/CKEditor4/skins/moono-lisa/images/hidpi/close.png +0 -0
  93. package/CKEditor4/skins/moono-lisa/images/hidpi/lock-open.png +0 -0
  94. package/CKEditor4/skins/moono-lisa/images/hidpi/lock.png +0 -0
  95. package/CKEditor4/skins/moono-lisa/images/hidpi/refresh.png +0 -0
  96. package/CKEditor4/skins/moono-lisa/images/lock-open.png +0 -0
  97. package/CKEditor4/skins/moono-lisa/images/lock.png +0 -0
  98. package/CKEditor4/skins/moono-lisa/images/refresh.png +0 -0
  99. package/CKEditor4/skins/moono-lisa/images/spinner.gif +0 -0
  100. package/CKEditor4/skins/moono-lisa/readme.md +46 -0
  101. package/CKEditor4/styles.js +136 -0
  102. package/CKEditor4/vendor/promise.js +385 -0
  103. package/README.md +3 -0
  104. package/package.json +9 -0
@@ -0,0 +1,558 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ /**
7
+ * @fileOverview Image plugin based on Widgets API
8
+ */
9
+
10
+ 'use strict';
11
+
12
+ CKEDITOR.dialog.add('image2', function (editor) {
13
+ // RegExp: 123, 123px, empty string ""
14
+ var regexGetSizeOrEmpty = /(^\s*(\d+)(px)?\s*$)|^$/i,
15
+ lockButtonId = CKEDITOR.tools.getNextId(),
16
+ resetButtonId = CKEDITOR.tools.getNextId(),
17
+ lang = editor.lang.image2,
18
+ commonLang = editor.lang.common,
19
+ lockResetStyle = 'margin-top:18px;width:40px;height:20px;',
20
+ lockResetHtml = new CKEDITOR.template(
21
+ '<div>' +
22
+ '<a href="javascript:void(0)" tabindex="-1" title="' +
23
+ lang.lockRatio +
24
+ '" class="cke_btn_locked" id="{lockButtonId}" role="checkbox">' +
25
+ '<span class="cke_icon"></span>' +
26
+ '<span class="cke_label">' +
27
+ lang.lockRatio +
28
+ '</span>' +
29
+ '</a>' +
30
+ '<a href="javascript:void(0)" tabindex="-1" title="' +
31
+ lang.resetSize +
32
+ '" class="cke_btn_reset" id="{resetButtonId}" role="button">' +
33
+ '<span class="cke_label">' +
34
+ lang.resetSize +
35
+ '</span>' +
36
+ '</a>' +
37
+ '</div>',
38
+ ).output({
39
+ lockButtonId: lockButtonId,
40
+ resetButtonId: resetButtonId,
41
+ }),
42
+ helpers = CKEDITOR.plugins.image2,
43
+ // Editor instance configuration.
44
+ config = editor.config,
45
+ hasFileBrowser = !!(config.filebrowserImageBrowseUrl || config.filebrowserBrowseUrl),
46
+ // Content restrictions defined by the widget which
47
+ // impact on dialog structure and presence of fields.
48
+ features = editor.widgets.registered.image.features,
49
+ // Functions inherited from image2 plugin.
50
+ getNatural = helpers.getNatural,
51
+ // Global variables referring to the dialog's context.
52
+ doc,
53
+ widget,
54
+ image,
55
+ // Global variable referring to this dialog's image pre-loader.
56
+ preLoader,
57
+ // Global variables holding the original size of the image.
58
+ domWidth,
59
+ domHeight,
60
+ // Global variables related to image pre-loading.
61
+ preLoadedWidth,
62
+ preLoadedHeight,
63
+ srcChanged,
64
+ // Global variables related to size locking.
65
+ lockRatio,
66
+ userDefinedLock,
67
+ // Global variables referring to dialog fields and elements.
68
+ lockButton,
69
+ resetButton,
70
+ widthField,
71
+ heightField,
72
+ natural;
73
+
74
+ // Validates dimension. Allowed values are:
75
+ // "123px", "123", "" (empty string)
76
+ function validateDimension() {
77
+ var match = this.getValue().match(regexGetSizeOrEmpty),
78
+ isValid = !!(match && parseInt(match[1], 10) !== 0);
79
+
80
+ if (!isValid) alert(commonLang['invalidLength'].replace('%1', commonLang[this.id]).replace('%2', 'px')); // jshint ignore:line
81
+
82
+ return isValid;
83
+ }
84
+
85
+ // Creates a function that pre-loads images. The callback function passes
86
+ // [image, width, height] or null if loading failed.
87
+ //
88
+ // @returns {Function}
89
+ function createPreLoader() {
90
+ var image = doc.createElement('img'),
91
+ listeners = [];
92
+
93
+ function addListener(event, callback) {
94
+ listeners.push(
95
+ image.once(event, function (evt) {
96
+ removeListeners();
97
+ callback(evt);
98
+ }),
99
+ );
100
+ }
101
+
102
+ function removeListeners() {
103
+ var l;
104
+
105
+ while ((l = listeners.pop())) l.removeListener();
106
+ }
107
+
108
+ // @param {String} src.
109
+ // @param {Function} callback.
110
+ return function (src, callback, scope) {
111
+ addListener('load', function () {
112
+ // Don't use image.$.(width|height) since it's buggy in IE9-10 (https://dev.ckeditor.com/ticket/11159)
113
+ var dimensions = getNatural(image);
114
+
115
+ callback.call(scope, image, dimensions.width, dimensions.height);
116
+ });
117
+
118
+ addListener('error', function () {
119
+ callback(null);
120
+ });
121
+
122
+ addListener('abort', function () {
123
+ callback(null);
124
+ });
125
+
126
+ image.setAttribute('src', (config.baseHref || '') + src + '?' + Math.random().toString(16).substring(2));
127
+ };
128
+ }
129
+
130
+ // This function updates width and height fields once the
131
+ // "src" field is altered. Along with dimensions, also the
132
+ // dimensions lock is adjusted.
133
+ function onChangeSrc() {
134
+ var value = this.getValue();
135
+
136
+ toggleDimensions(false);
137
+
138
+ // Remember that src is different than default.
139
+ if (value !== widget.data.src) {
140
+ // Update dimensions of the image once it's preloaded.
141
+ preLoader(value, function (image, width, height) {
142
+ // Re-enable width and height fields.
143
+ toggleDimensions(true);
144
+
145
+ // There was problem loading the image. Unlock ratio.
146
+ if (!image) return toggleLockRatio(false);
147
+
148
+ // Fill width field with the width of the new image.
149
+ widthField.setValue(editor.config.image2_prefillDimensions === false ? 0 : width);
150
+
151
+ // Fill height field with the height of the new image.
152
+ heightField.setValue(editor.config.image2_prefillDimensions === false ? 0 : height);
153
+
154
+ // Cache the new width and update initial cache (#1348).
155
+ preLoadedWidth = domWidth = width;
156
+
157
+ // Cache the new height and update initial cache (#1348).
158
+ preLoadedHeight = domHeight = height;
159
+
160
+ // Check for new lock value if image exist.
161
+ toggleLockRatio(helpers.checkHasNaturalRatio(image));
162
+ });
163
+
164
+ srcChanged = true;
165
+ }
166
+
167
+ // Value is the same as in widget data but is was
168
+ // modified back in time. Roll back dimensions when restoring
169
+ // default src.
170
+ else if (srcChanged) {
171
+ // Re-enable width and height fields.
172
+ toggleDimensions(true);
173
+
174
+ // Restore width field with cached width.
175
+ widthField.setValue(domWidth);
176
+
177
+ // Restore height field with cached height.
178
+ heightField.setValue(domHeight);
179
+
180
+ // Src equals default one back again.
181
+ srcChanged = false;
182
+ }
183
+
184
+ // Value is the same as in widget data and it hadn't
185
+ // been modified.
186
+ else {
187
+ // Re-enable width and height fields.
188
+ toggleDimensions(true);
189
+ }
190
+ }
191
+
192
+ function onChangeDimension() {
193
+ // If ratio is un-locked, then we don't care what's next.
194
+ if (!lockRatio) return;
195
+
196
+ var value = this.getValue();
197
+
198
+ // No reason to auto-scale or unlock if the field is empty.
199
+ if (!value) return;
200
+
201
+ // If the value of the field is invalid (e.g. with %), unlock ratio.
202
+ if (!value.match(regexGetSizeOrEmpty)) toggleLockRatio(false);
203
+
204
+ // No automatic re-scale when dimension is '0'.
205
+ if (value === '0') return;
206
+
207
+ var isWidth = this.id == 'width',
208
+ // If dialog opened for the new image, domWidth and domHeight
209
+ // will be empty. Use dimensions from pre-loader in such case instead.
210
+ width = domWidth || preLoadedWidth,
211
+ height = domHeight || preLoadedHeight;
212
+
213
+ // If changing width, then auto-scale height.
214
+ if (isWidth) value = Math.round(height * (value / width));
215
+ // If changing height, then auto-scale width.
216
+ else value = Math.round(width * (value / height));
217
+
218
+ // If the value is a number, apply it to the other field.
219
+ if (!isNaN(value)) (isWidth ? heightField : widthField).setValue(value);
220
+ }
221
+
222
+ // Set-up function for lock and reset buttons:
223
+ // * Adds lock and reset buttons to focusables. Check if button exist first
224
+ // because it may be disabled e.g. due to ACF restrictions.
225
+ // * Register mouseover and mouseout event listeners for UI manipulations.
226
+ // * Register click event listeners for buttons.
227
+ function onLoadLockReset() {
228
+ var dialog = this.getDialog();
229
+
230
+ function setupMouseClasses(el) {
231
+ el.on(
232
+ 'mouseover',
233
+ function () {
234
+ this.addClass('cke_btn_over');
235
+ },
236
+ el,
237
+ );
238
+
239
+ el.on(
240
+ 'mouseout',
241
+ function () {
242
+ this.removeClass('cke_btn_over');
243
+ },
244
+ el,
245
+ );
246
+ }
247
+
248
+ // Create references to lock and reset buttons for this dialog instance.
249
+ lockButton = doc.getById(lockButtonId);
250
+ resetButton = doc.getById(resetButtonId);
251
+
252
+ // Activate (Un)LockRatio button
253
+ if (lockButton) {
254
+ // Consider that there's an additional focusable field
255
+ // in the dialog when the "browse" button is visible.
256
+ dialog.addFocusable(lockButton, 4 + hasFileBrowser);
257
+
258
+ lockButton.on(
259
+ 'click',
260
+ function (evt) {
261
+ toggleLockRatio();
262
+ evt.data && evt.data.preventDefault();
263
+ },
264
+ this.getDialog(),
265
+ );
266
+
267
+ setupMouseClasses(lockButton);
268
+ }
269
+
270
+ // Activate the reset size button.
271
+ if (resetButton) {
272
+ // Consider that there's an additional focusable field
273
+ // in the dialog when the "browse" button is visible.
274
+ dialog.addFocusable(resetButton, 5 + hasFileBrowser);
275
+
276
+ // Fills width and height fields with the original dimensions of the
277
+ // image (stored in widget#data since widget#init).
278
+ resetButton.on(
279
+ 'click',
280
+ function (evt) {
281
+ // If there's a new image loaded, reset button should revert
282
+ // cached dimensions of pre-loaded DOM element.
283
+ if (srcChanged) {
284
+ widthField.setValue(preLoadedWidth);
285
+ heightField.setValue(preLoadedHeight);
286
+ }
287
+
288
+ // If the old image remains, reset button should revert
289
+ // dimensions as loaded when the dialog was first shown.
290
+ else {
291
+ widthField.setValue(domWidth);
292
+ heightField.setValue(domHeight);
293
+ }
294
+
295
+ evt.data && evt.data.preventDefault();
296
+ },
297
+ this,
298
+ );
299
+
300
+ setupMouseClasses(resetButton);
301
+ }
302
+ }
303
+
304
+ function toggleLockRatio(enable) {
305
+ // No locking if there's no radio (i.e. due to ACF).
306
+ if (!lockButton) return;
307
+
308
+ if (typeof enable == 'boolean') {
309
+ // If user explicitly wants to decide whether
310
+ // to lock or not, don't do anything.
311
+ if (userDefinedLock) return;
312
+
313
+ lockRatio = enable;
314
+ }
315
+
316
+ // Undefined. User changed lock value.
317
+ else {
318
+ var width = widthField.getValue(),
319
+ height;
320
+
321
+ userDefinedLock = true;
322
+ lockRatio = !lockRatio;
323
+
324
+ // Automatically adjust height to width to match
325
+ // the original ratio (based on dom- dimensions).
326
+ if (lockRatio && width) {
327
+ height = (domHeight / domWidth) * width;
328
+
329
+ if (!isNaN(height)) heightField.setValue(Math.round(height));
330
+ }
331
+ }
332
+
333
+ lockButton[lockRatio ? 'removeClass' : 'addClass']('cke_btn_unlocked');
334
+ lockButton.setAttribute('aria-checked', lockRatio);
335
+
336
+ // Ratio button hc presentation - WHITE SQUARE / BLACK SQUARE
337
+ if (CKEDITOR.env.hc) {
338
+ var icon = lockButton.getChild(0);
339
+ icon.setHtml(lockRatio ? (CKEDITOR.env.ie ? '\u25A0' : '\u25A3') : CKEDITOR.env.ie ? '\u25A1' : '\u25A2');
340
+ }
341
+ }
342
+
343
+ function toggleDimensions(enable) {
344
+ var method = enable ? 'enable' : 'disable';
345
+
346
+ widthField[method]();
347
+ heightField[method]();
348
+ }
349
+
350
+ var srcBoxChildren = [
351
+ {
352
+ id: 'src',
353
+ type: 'text',
354
+ label: commonLang.url,
355
+ onKeyup: onChangeSrc,
356
+ onChange: onChangeSrc,
357
+ setup: function (widget) {
358
+ this.setValue(widget.data.src);
359
+ },
360
+ commit: function (widget) {
361
+ widget.setData('src', this.getValue());
362
+ },
363
+ validate: CKEDITOR.dialog.validate.notEmpty(lang.urlMissing),
364
+ },
365
+ ];
366
+
367
+ // Render the "Browse" button on demand to avoid an "empty" (hidden child)
368
+ // space in dialog layout that distorts the UI.
369
+ if (hasFileBrowser) {
370
+ srcBoxChildren.push({
371
+ type: 'button',
372
+ id: 'browse',
373
+ // v-align with the 'txtUrl' field.
374
+ // TODO: We need something better than a fixed size here.
375
+ style: 'display:inline-block;margin-top:14px;',
376
+ align: 'center',
377
+ label: editor.lang.common.browseServer,
378
+ hidden: true,
379
+ filebrowser: 'info:src',
380
+ });
381
+ }
382
+
383
+ return {
384
+ title: lang.title,
385
+ minWidth: 250,
386
+ minHeight: 100,
387
+ onLoad: function () {
388
+ // Create a "global" reference to the document for this dialog instance.
389
+ doc = this._.element.getDocument();
390
+
391
+ // Create a pre-loader used for determining dimensions of new images.
392
+ preLoader = createPreLoader();
393
+ },
394
+ onShow: function () {
395
+ // Create a "global" reference to edited widget.
396
+ widget = this.getModel();
397
+
398
+ // Create a "global" reference to widget's image.
399
+ image = widget.parts.image;
400
+
401
+ // Reset global variables.
402
+ srcChanged = userDefinedLock = lockRatio = false;
403
+
404
+ // Natural dimensions of the image.
405
+ natural = getNatural(image);
406
+
407
+ // Get the natural width of the image.
408
+ preLoadedWidth = domWidth = natural.width;
409
+
410
+ // Get the natural height of the image.
411
+ preLoadedHeight = domHeight = natural.height;
412
+ },
413
+ contents: [
414
+ {
415
+ id: 'info',
416
+ label: lang.infoTab,
417
+ elements: [
418
+ {
419
+ type: 'vbox',
420
+ padding: 0,
421
+ children: [
422
+ {
423
+ type: 'hbox',
424
+ widths: ['100%'],
425
+ className: 'cke_dialog_image_url',
426
+ children: srcBoxChildren,
427
+ },
428
+ ],
429
+ },
430
+ {
431
+ id: 'alt',
432
+ type: 'text',
433
+ label: lang.alt,
434
+ setup: function (widget) {
435
+ this.setValue(widget.data.alt);
436
+ },
437
+ commit: function (widget) {
438
+ widget.setData('alt', this.getValue());
439
+ },
440
+ validate:
441
+ editor.config.image2_altRequired === true ? CKEDITOR.dialog.validate.notEmpty(lang.altMissing) : null,
442
+ },
443
+ {
444
+ type: 'hbox',
445
+ widths: ['25%', '25%', '50%'],
446
+ requiredContent: features.dimension.requiredContent,
447
+ children: [
448
+ {
449
+ type: 'text',
450
+ width: '45px',
451
+ id: 'width',
452
+ label: commonLang.width,
453
+ validate: validateDimension,
454
+ onKeyUp: onChangeDimension,
455
+ onLoad: function () {
456
+ widthField = this;
457
+ },
458
+ setup: function (widget) {
459
+ this.setValue(widget.data.width);
460
+ },
461
+ commit: function (widget) {
462
+ widget.setData('width', this.getValue());
463
+ },
464
+ },
465
+ {
466
+ type: 'text',
467
+ id: 'height',
468
+ width: '45px',
469
+ label: commonLang.height,
470
+ validate: validateDimension,
471
+ onKeyUp: onChangeDimension,
472
+ onLoad: function () {
473
+ heightField = this;
474
+ },
475
+ setup: function (widget) {
476
+ this.setValue(widget.data.height);
477
+ },
478
+ commit: function (widget) {
479
+ widget.setData('height', this.getValue());
480
+ },
481
+ },
482
+ {
483
+ id: 'lock',
484
+ type: 'html',
485
+ style: lockResetStyle,
486
+ onLoad: onLoadLockReset,
487
+ setup: function (widget) {
488
+ toggleLockRatio(widget.data.lock);
489
+ },
490
+ commit: function (widget) {
491
+ widget.setData('lock', lockRatio);
492
+ },
493
+ html: lockResetHtml,
494
+ },
495
+ ],
496
+ },
497
+ {
498
+ type: 'hbox',
499
+ id: 'alignment',
500
+ requiredContent: features.align.requiredContent,
501
+ children: [
502
+ {
503
+ id: 'align',
504
+ type: 'radio',
505
+ items: [
506
+ [commonLang.alignNone, 'none'],
507
+ [commonLang.left, 'left'],
508
+ [commonLang.center, 'center'],
509
+ [commonLang.right, 'right'],
510
+ ],
511
+ label: commonLang.align,
512
+ setup: function (widget) {
513
+ this.setValue(widget.data.align);
514
+ },
515
+ commit: function (widget) {
516
+ widget.setData('align', this.getValue());
517
+ },
518
+ },
519
+ ],
520
+ },
521
+ {
522
+ id: 'hasCaption',
523
+ type: 'checkbox',
524
+ label: lang.captioned,
525
+ requiredContent: features.caption.requiredContent,
526
+ setup: function (widget) {
527
+ this.setValue(widget.data.hasCaption);
528
+ },
529
+ commit: function (widget) {
530
+ widget.setData('hasCaption', this.getValue());
531
+ },
532
+ },
533
+ ],
534
+ },
535
+ {
536
+ id: 'Upload',
537
+ hidden: true,
538
+ filebrowser: 'uploadButton',
539
+ label: lang.uploadTab,
540
+ elements: [
541
+ {
542
+ type: 'file',
543
+ id: 'upload',
544
+ label: lang.btnUpload,
545
+ style: 'height:40px',
546
+ },
547
+ {
548
+ type: 'fileButton',
549
+ id: 'uploadButton',
550
+ filebrowser: 'info:src',
551
+ label: lang.btnUpload,
552
+ for: ['Upload', 'upload'],
553
+ },
554
+ ],
555
+ },
556
+ ],
557
+ };
558
+ });
@@ -0,0 +1,21 @@
1
+ /*
2
+ Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
+ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ CKEDITOR.plugins.setLang('image2', 'vi', {
6
+ alt: 'Chú thích ảnh',
7
+ btnUpload: 'Tải lên máy chủ',
8
+ captioned: 'Ảnh có chú thích',
9
+ captionPlaceholder: 'Nhãn',
10
+ infoTab: 'Thông tin của ảnh',
11
+ lockRatio: 'Giữ nguyên tỷ lệ',
12
+ menu: 'Thuộc tính của ảnh',
13
+ pathName: 'ảnh',
14
+ pathNameCaption: 'chú thích',
15
+ resetSize: 'Kích thước gốc',
16
+ resizer: 'Kéo rê để thay đổi kích cỡ',
17
+ title: 'Thuộc tính của ảnh',
18
+ uploadTab: 'Tải lên',
19
+ urlMissing: 'Thiếu đường dẫn hình ảnh',
20
+ altMissing: 'Alternative text is missing.', // MISSING
21
+ });