tnx-shared 5.3.206 → 5.3.207
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 +46 -23
- 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/equation-editor/equation-editor.component.d.ts +2 -2
- package/components/equation-editor/equation-editor.component.d.ts.map +1 -1
- package/components/tn-tinymce/tn-tinymce.component.d.ts.map +1 -1
- package/esm2015/components/equation-editor/equation-editor.component.js +9 -7
- package/esm2015/components/tn-tinymce/tn-tinymce.component.js +42 -20
- package/fesm2015/tnx-shared.js +47 -24
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
- package/tnx-shared.metadata.json +1 -1
|
@@ -46629,10 +46629,11 @@
|
|
|
46629
46629
|
};
|
|
46630
46630
|
EquationEditorComponent.prototype.onModelChange = function (evt) {
|
|
46631
46631
|
var _this = this;
|
|
46632
|
+
console.log(evt);
|
|
46632
46633
|
clearTimeout(this.timeoutModelChange);
|
|
46633
|
-
if (
|
|
46634
|
+
if (evt && typeof evt == 'string' && evt.trim() != '') {
|
|
46634
46635
|
this.timeoutModelChange = setTimeout(function () {
|
|
46635
|
-
_this.showPreview(
|
|
46636
|
+
_this.showPreview(evt.trim());
|
|
46636
46637
|
}, 500);
|
|
46637
46638
|
}
|
|
46638
46639
|
};
|
|
@@ -46684,12 +46685,12 @@
|
|
|
46684
46685
|
selector: 'equation-editor',
|
|
46685
46686
|
template: "<div class=\"ui-fluid\">\n <textarea #textarea class=\"latexContent\" placeholder=\"G\u00F5 c\u00F4ng th\u1EE9c to\u00E1n h\u1ECDc t\u1EA1i \u0111\u00E2y...\" rows=\"6\" pInputTextarea\n (ngModelChange)=\"onModelChange($event)\" [(ngModel)]=\"equationLatex\"></textarea>\n</div>\n<div class=\"preview\">\n <img #preview latex=\"true\" *ngIf=\"imageSrc\" [attr.height]=\"data.height != 0 ? data.height : null\"\n class=\"latex\" [style]=\"data.style | safeStyle\" [src]=\"imageSrc\" [alt]=\"equationLatex\" />\n</div>",
|
|
46686
46687
|
providers: [ComponentContextService],
|
|
46687
|
-
styles: [".btn-equation{width:30px;height:30px;cursor:pointer}.preview{text-align:center;margin
|
|
46688
|
+
styles: [".btn-equation{width:30px;height:30px;cursor:pointer}.preview{text-align:center;margin:20px 10px}.latexContent{resize:none;border-radius:0}textarea{width:100%}"]
|
|
46688
46689
|
},] }
|
|
46689
46690
|
];
|
|
46690
46691
|
EquationEditorComponent.ctorParameters = function () { return [
|
|
46691
46692
|
{ type: i0.Injector },
|
|
46692
|
-
{ type:
|
|
46693
|
+
{ type: TemplateInstanceService },
|
|
46693
46694
|
{ type: platformBrowser.DomSanitizer }
|
|
46694
46695
|
]; };
|
|
46695
46696
|
EquationEditorComponent.propDecorators = {
|
|
@@ -51697,6 +51698,21 @@
|
|
|
51697
51698
|
TnTinymceComponent.prototype.getTinyMceConfigByMode = function (mode) {
|
|
51698
51699
|
var _this = this;
|
|
51699
51700
|
var $this = this;
|
|
51701
|
+
tinymce.PluginManager.add('equation', function (editor) {
|
|
51702
|
+
var openDialog = function () {
|
|
51703
|
+
$this.header = 'Công thức toán học (dùng laTex)';
|
|
51704
|
+
$this.equationFormModel.show = true;
|
|
51705
|
+
$this.popupSize = { width: 1200, height: 700 };
|
|
51706
|
+
};
|
|
51707
|
+
editor.ui.registry.addButton('equation', {
|
|
51708
|
+
tooltip: 'Công thức toán học vào nội dung',
|
|
51709
|
+
// icon: 'insert-character',
|
|
51710
|
+
icon: 'ltr',
|
|
51711
|
+
onAction: function () {
|
|
51712
|
+
openDialog();
|
|
51713
|
+
}
|
|
51714
|
+
});
|
|
51715
|
+
});
|
|
51700
51716
|
tinymce.PluginManager.add('addNews', function (editor) {
|
|
51701
51717
|
var openDialog = function () {
|
|
51702
51718
|
$this.header = 'Thêm/Chọn tin bài';
|
|
@@ -51720,7 +51736,7 @@
|
|
|
51720
51736
|
};
|
|
51721
51737
|
editor.ui.registry.addButton('template', {
|
|
51722
51738
|
tooltip: 'Template',
|
|
51723
|
-
icon: '
|
|
51739
|
+
icon: 'template',
|
|
51724
51740
|
onAction: function () {
|
|
51725
51741
|
openDialog();
|
|
51726
51742
|
}
|
|
@@ -51848,33 +51864,34 @@
|
|
|
51848
51864
|
},
|
|
51849
51865
|
mobile: {
|
|
51850
51866
|
theme: 'silver',
|
|
51851
|
-
plugins: ['advlist autolink lists link image charmap print preview anchor textcolor searchreplace visualblocks code fullscreen insertdatetime media table media code lists colorpicker imagetools tabfocus textcolor'],
|
|
51867
|
+
plugins: ['advlist autolink lists link image charmap print preview anchor textcolor searchreplace visualblocks code fullscreen insertdatetime media table media code lists colorpicker imagetools tabfocus textcolor equation'],
|
|
51852
51868
|
}
|
|
51853
51869
|
};
|
|
51854
51870
|
if (mode == 'full') {
|
|
51855
51871
|
config.plugins = [
|
|
51856
|
-
'advlist autolink lists link image charmap print preview anchor textcolor searchreplace visualblocks code fullscreen insertdatetime media table media code lists colorpicker imagetools tabfocus editFileNew addNews'
|
|
51872
|
+
'advlist autolink lists link image charmap print preview anchor textcolor searchreplace visualblocks code fullscreen insertdatetime media table media code lists colorpicker imagetools tabfocus editFileNew addNews equation'
|
|
51857
51873
|
];
|
|
51858
|
-
config.toolbar = 'formatselect | bold italic Strikethrough forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table link editFileNew addNews | print removeformat undo redo | fullscreen ';
|
|
51859
|
-
config.mobile.toolbar = 'bold italic Strikethrough forecolor backcolor | bullist numlist | fullscreen';
|
|
51860
|
-
config.paste_data_images = true;
|
|
51874
|
+
config.toolbar = 'formatselect | bold italic Strikethrough forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table link editFileNew addNews | print removeformat undo redo | equation | fullscreen ';
|
|
51875
|
+
config.mobile.toolbar = 'bold italic Strikethrough forecolor backcolor | bullist numlist | equation | fullscreen';
|
|
51861
51876
|
return config;
|
|
51862
51877
|
}
|
|
51863
51878
|
else if (mode == 'medium') {
|
|
51864
|
-
config.plugins = ['advlist autolink lists link image charmap print preview anchor textcolor searchreplace visualblocks code fullscreen insertdatetime media table media code lists colorpicker imagetools tabfocus textcolor'];
|
|
51865
|
-
config.toolbar = 'formatselect | bold italic Strikethrough forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table link | print removeformat undo redo | fullscreen';
|
|
51866
|
-
config.mobile.toolbar = 'bold italic Strikethrough forecolor backcolor | bullist numlist | fullscreen';
|
|
51867
|
-
config.paste_data_images = true;
|
|
51879
|
+
config.plugins = ['advlist autolink lists link image charmap print preview anchor textcolor searchreplace visualblocks code fullscreen insertdatetime media table media code lists colorpicker imagetools tabfocus textcolor equation'];
|
|
51880
|
+
config.toolbar = 'formatselect | bold italic Strikethrough forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | table link | print removeformat undo redo | equation | fullscreen';
|
|
51881
|
+
config.mobile.toolbar = 'bold italic Strikethrough forecolor backcolor | bullist numlist | equation | fullscreen';
|
|
51868
51882
|
return config;
|
|
51869
51883
|
}
|
|
51870
51884
|
else if (mode == 'simple') {
|
|
51871
|
-
config.plugins = ['advlist autolink lists link image charmap print preview anchor textcolor searchreplace visualblocks code fullscreen insertdatetime media table media code lists colorpicker imagetools tabfocus textcolor'];
|
|
51872
|
-
config.toolbar = 'bold italic Strikethrough forecolor backcolor | bullist numlist | fullscreen';
|
|
51873
|
-
config.mobile.toolbar = 'fullscreen | bold italic Strikethrough forecolor backcolor | bullist numlist';
|
|
51885
|
+
config.plugins = ['advlist autolink lists link image charmap print preview anchor textcolor searchreplace visualblocks code fullscreen insertdatetime media table media code lists colorpicker imagetools tabfocus textcolor equation'];
|
|
51886
|
+
config.toolbar = 'bold italic Strikethrough forecolor backcolor | bullist numlist | equation | fullscreen';
|
|
51887
|
+
config.mobile.toolbar = 'fullscreen | bold italic Strikethrough forecolor backcolor | bullist numlist | equation';
|
|
51888
|
+
return config;
|
|
51889
|
+
}
|
|
51890
|
+
else {
|
|
51891
|
+
config.plugins = ['advlist autolink lists link image charmap print preview anchor textcolor searchreplace visualblocks code fullscreen insertdatetime media table media code lists colorpicker imagetools tabfocus textcolor equation'];
|
|
51892
|
+
config.toolbar = 'formatselect | bold italic Strikethrough forecolor backcolor| alignleft aligncenter alignright alignjustify | bullist numlist | equation';
|
|
51893
|
+
config.toolbar = 'bold italic Strikethrough forecolor backcolor | bullist numlist | equation | fullscreen';
|
|
51874
51894
|
}
|
|
51875
|
-
config.plugins = ['advlist autolink lists link image charmap print preview anchor textcolor searchreplace visualblocks code fullscreen insertdatetime media table media code lists colorpicker imagetools tabfocus textcolor'];
|
|
51876
|
-
config.toolbar = 'formatselect | bold italic Strikethrough forecolor backcolor| alignleft aligncenter alignright alignjustify | bullist numlist';
|
|
51877
|
-
config.toolbar = 'bold italic Strikethrough forecolor backcolor | bullist numlist | fullscreen';
|
|
51878
51895
|
config.paste_data_images = true;
|
|
51879
51896
|
return config;
|
|
51880
51897
|
};
|
|
@@ -51897,8 +51914,14 @@
|
|
|
51897
51914
|
this.keydown.next({ event: e, topic: topic });
|
|
51898
51915
|
};
|
|
51899
51916
|
TnTinymceComponent.prototype.handleOk = function (evt) {
|
|
51900
|
-
var
|
|
51901
|
-
|
|
51917
|
+
var html = this.equationForm.preview.nativeElement;
|
|
51918
|
+
html.height = 41;
|
|
51919
|
+
var data = html.outerHTML;
|
|
51920
|
+
if (data) {
|
|
51921
|
+
data = data.replace(/width\s*=\s*"(.+?)"/g, '');
|
|
51922
|
+
this.editor.insertContent(data);
|
|
51923
|
+
}
|
|
51924
|
+
this.equationFormModel.show = false;
|
|
51902
51925
|
};
|
|
51903
51926
|
TnTinymceComponent.prototype.focusTrap = function (event) {
|
|
51904
51927
|
if (this.editor) {
|
|
@@ -52067,7 +52090,7 @@
|
|
|
52067
52090
|
TnTinymceComponent.decorators = [
|
|
52068
52091
|
{ type: i0.Component, args: [{
|
|
52069
52092
|
selector: 'tn-tinymce',
|
|
52070
|
-
template: "<input *ngIf=\"!_deviceDetectorService.isDesktop()\" class=\"input-tab-trap\" (focus)=\"focusTrap($event)\" />\n<textarea class=\"tinymce-control\" id={{id}} [ngStyle]=\"{height: height+'px'}\"></textarea>\n<tn-dialog #dialog *ngIf=\"equationFormModel.show\" [closeOnEscape]=\"false\"\n [header]=\"'C\u00F4ng th\u1EE9c to\u00E1n h\u1ECDc (d\u00F9ng laTex)' | translate\" [popupSize]=\"popupSize\">\n <tn-custom-scrollbar #scrollbar>\n <equation-editor [data]=\"dataEquation\">\n </equation-editor>\n </tn-custom-scrollbar>\n <ng-template #footer>\n <button icon=\"fas fa-check\" [disabled]=\"model.submitting\" pButton type=\"button\"
|
|
52093
|
+
template: "<input *ngIf=\"!_deviceDetectorService.isDesktop()\" class=\"input-tab-trap\" (focus)=\"focusTrap($event)\" />\n<textarea class=\"tinymce-control\" id={{id}} [ngStyle]=\"{height: height+'px'}\"></textarea>\n<tn-dialog #dialog *ngIf=\"equationFormModel.show\" [closeOnEscape]=\"false\"\n [header]=\"'C\u00F4ng th\u1EE9c to\u00E1n h\u1ECDc (d\u00F9ng laTex)' | translate\" [popupSize]=\"popupSize\"\n (onHide)=\"equationFormModel.show = false\">\n <tn-custom-scrollbar #scrollbar>\n <equation-editor [data]=\"dataEquation\">\n </equation-editor>\n </tn-custom-scrollbar>\n <ng-template #footer>\n <button icon=\"fas fa-check\" class=\"p-button-text\" [disabled]=\"model.submitting\" pButton type=\"button\"\n (click)=\"handleOk($event)\" [label]=\"'X\u00E1c nh\u1EADn' | translate\"></button>\n <button icon=\"fas fa-undo\" [disabled]=\"model.submitting\" pButton class=\"p-button-text p-button-secondary\"\n type=\"button\" (click)=\"equationFormModel.show = false\" [label]=\"'FORM.CANCEL' | translate\"></button>\n </ng-template>\n</tn-dialog>\n\n<tn-dialog *ngIf=\"isAddNews\" #dialog [styleClass]=\"'address-form'\" [header]=\"header | translate\" [popupSize]=\"popupSize\"\n (onHide)=\"isAddNews = false\">\n <add-news #listBase [languageCode]=\"languageCode\" (showChange)=\"showChanged($event)\"></add-news>\n</tn-dialog>\n\n<tn-dialog *ngIf=\"showTemplate\" #dialog [styleClass]=\"'address-form'\" [header]=\"header | translate\"\n [popupSize]=\"popupSize\" (onHide)=\"showTemplate = false\">\n <tn-template (onChanged)=\"addTemplate($event)\"></tn-template>\n</tn-dialog>\n\n<tn-dialog *ngIf=\"isAddFile\" #dialog [styleClass]=\"'address-form'\" [header]=\"header | translate\" [popupSize]=\"popupSize\"\n (onHide)=\"isAddFile = false\">\n <file-picker-dialog #formBase [parentModel]=\" model\" [parentContext]=\"context\" (closeForm)=\"isAddFile = false\"\n (onCancel)=\"handleRFCancel($event)\" (onChanged)=\"showChanged($event)\">\n </file-picker-dialog>\n</tn-dialog>",
|
|
52071
52094
|
providers: [
|
|
52072
52095
|
{
|
|
52073
52096
|
provide: forms.NG_VALUE_ACCESSOR,
|