tnx-shared 5.1.574 → 5.1.575
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.
- package/bundles/tnx-shared.umd.js +19 -17
- package/bundles/tnx-shared.umd.js.map +1 -1
- package/bundles/tnx-shared.umd.min.js +1 -1
- package/bundles/tnx-shared.umd.min.js.map +1 -1
- package/components/tn-tinymce/tn-tinymce.component.d.ts.map +1 -1
- package/esm2015/components/tn-tinymce/tn-tinymce.component.js +20 -17
- package/fesm2015/tnx-shared.js +19 -16
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
|
@@ -60337,10 +60337,10 @@
|
|
|
60337
60337
|
this.equationFormModel.data = data;
|
|
60338
60338
|
};
|
|
60339
60339
|
TnTinymceComponent.prototype.getTinyMceConfigByMode = function (mode) {
|
|
60340
|
-
var _this = this;
|
|
60341
60340
|
var $this = this;
|
|
60342
60341
|
tinymce.PluginManager.add('addNews', function (editor) {
|
|
60343
60342
|
var openDialog = function () {
|
|
60343
|
+
$this.editor = editor;
|
|
60344
60344
|
$this.header = 'Thêm/Chọn tin bài';
|
|
60345
60345
|
$this.isAddNews = true;
|
|
60346
60346
|
$this.isAddFile = false;
|
|
@@ -60356,6 +60356,7 @@
|
|
|
60356
60356
|
});
|
|
60357
60357
|
tinymce.PluginManager.add('template', function (editor) {
|
|
60358
60358
|
var openDialog = function () {
|
|
60359
|
+
$this.editor = editor;
|
|
60359
60360
|
$this.header = 'Thêm/Chọn template';
|
|
60360
60361
|
$this.showTemplate = true;
|
|
60361
60362
|
$this.popupSize = { width: 1200, height: 700 };
|
|
@@ -60370,6 +60371,7 @@
|
|
|
60370
60371
|
});
|
|
60371
60372
|
tinymce.PluginManager.add('editFileNew', function (editor) {
|
|
60372
60373
|
var openDialog = function () {
|
|
60374
|
+
$this.editor = editor;
|
|
60373
60375
|
$this.header = 'Thêm/Chỉnh sửa file cá nhân';
|
|
60374
60376
|
$this.isAddNews = false;
|
|
60375
60377
|
$this.isAddFile = true;
|
|
@@ -60384,13 +60386,13 @@
|
|
|
60384
60386
|
});
|
|
60385
60387
|
});
|
|
60386
60388
|
var callbackFunc = function (editor) {
|
|
60387
|
-
|
|
60388
|
-
if (
|
|
60389
|
+
$this.editor = editor;
|
|
60390
|
+
if ($this.disabled) {
|
|
60389
60391
|
editor.setMode('readonly');
|
|
60390
60392
|
}
|
|
60391
60393
|
var edBody = jQuery(editor.iframeElement).contents().find('body');
|
|
60392
60394
|
var editorHolder = editor.iframeElement.parentElement;
|
|
60393
|
-
if (
|
|
60395
|
+
if (!$this._deviceDetectorService.isDesktop()) {
|
|
60394
60396
|
edBody.addClass('mobile');
|
|
60395
60397
|
}
|
|
60396
60398
|
edBody.on('blur', function (e) {
|
|
@@ -60401,7 +60403,7 @@
|
|
|
60401
60403
|
var begin = new Date();
|
|
60402
60404
|
var types = e.originalEvent.clipboardData.types;
|
|
60403
60405
|
if (((types instanceof DOMStringList) && types.contains('text/html')) || (types.indexOf && (types.indexOf('text/html') !== -1) || types.indexOf('Files') !== -1)) {
|
|
60404
|
-
|
|
60406
|
+
$this._notifierService.showSuccess('Đang tiến hành xử lý nội dung, vui lòng chờ trong giây lát!');
|
|
60405
60407
|
e.originalEvent.stopPropagation();
|
|
60406
60408
|
e.originalEvent.preventDefault();
|
|
60407
60409
|
var types_1 = e.originalEvent.clipboardData.types;
|
|
@@ -60415,13 +60417,13 @@
|
|
|
60415
60417
|
}
|
|
60416
60418
|
}
|
|
60417
60419
|
setTimeout(function () {
|
|
60418
|
-
|
|
60420
|
+
$this.handlePaste(types_1, pastedData_1, pastedRtfData_1, files_1).then(function (content) {
|
|
60419
60421
|
var end = new Date();
|
|
60420
60422
|
console.log('Time to run handlePaste is ' + (end.getTime() - begin.getTime()) + 'ms');
|
|
60421
60423
|
if (content) {
|
|
60422
60424
|
// content = content.replace(/<!\[if[\s\S]*?>/gm, '').replace(/<!\[endif[\s\S]*?>/gm, '');
|
|
60423
|
-
content =
|
|
60424
|
-
content =
|
|
60425
|
+
content = $this.normalizeHTML(content, '<![if !supportLists]>', '<![endif]>');
|
|
60426
|
+
content = $this.normalizeHTML(content, '<![if !msEquation]>', '<![endif]>');
|
|
60425
60427
|
editor.execCommand('mceInsertContent', false, content);
|
|
60426
60428
|
}
|
|
60427
60429
|
});
|
|
@@ -60432,32 +60434,32 @@
|
|
|
60432
60434
|
if (e.ctrlKey || e.metaKey) {
|
|
60433
60435
|
switch (String.fromCharCode(e.which).toLowerCase()) {
|
|
60434
60436
|
case 's':
|
|
60435
|
-
|
|
60437
|
+
$this.onKeyDown(e, ComCtxConstants.ROOT.KEY_DOWN_CTRL_S);
|
|
60436
60438
|
e.preventDefault();
|
|
60437
60439
|
break;
|
|
60438
60440
|
}
|
|
60439
60441
|
}
|
|
60440
60442
|
else if (e.which == 27) {
|
|
60441
|
-
|
|
60443
|
+
$this.onKeyDown(e, ComCtxConstants.ROOT.KEY_DOWN_ESC);
|
|
60442
60444
|
e.preventDefault();
|
|
60443
60445
|
}
|
|
60444
60446
|
}).on('dblclick', function (e) {
|
|
60445
60447
|
if (e.target.nodeName.toLowerCase() == 'img' && e.target.classList.contains('latex')) {
|
|
60446
|
-
|
|
60448
|
+
$this.openDialog({ content: e.target.getAttribute('alt'), style: e.target.getAttribute('style'), height: e.target.getAttribute('height') });
|
|
60447
60449
|
}
|
|
60448
60450
|
});
|
|
60449
60451
|
editor.on('blur', function (e) {
|
|
60450
|
-
|
|
60452
|
+
$this.handleBlur();
|
|
60451
60453
|
}).on('change', function (e) {
|
|
60452
60454
|
var content = editor.getContent();
|
|
60453
|
-
|
|
60454
|
-
|
|
60455
|
+
$this.onChange(content);
|
|
60456
|
+
$this.onChanged.emit(content);
|
|
60455
60457
|
});
|
|
60456
|
-
editor.setContent(
|
|
60458
|
+
editor.setContent($this.model);
|
|
60457
60459
|
};
|
|
60458
60460
|
var config = {
|
|
60459
|
-
selector: '#' + this.id,
|
|
60460
|
-
height: this.height,
|
|
60461
|
+
selector: '#' + $this.id,
|
|
60462
|
+
height: $this.height,
|
|
60461
60463
|
content_css: [
|
|
60462
60464
|
'/assets/vendor/tinymce/custom.css'
|
|
60463
60465
|
],
|