tnx-shared 5.3.206 → 5.3.208

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.
@@ -15869,7 +15869,7 @@
15869
15869
  CrudFormComponent.prototype.ngAfterViewInit = function () {
15870
15870
  var _this = this;
15871
15871
  setTimeout(function () {
15872
- if (_this.autoFocus && !_this.rootContext.data.flags.hasFocusingControl) {
15872
+ if (_this.autoFocus && _this.rootContext.data.flags && !_this.rootContext.data.flags.hasFocusingControl) {
15873
15873
  _this.rootContext.data.flags.hasFocusingControl = true;
15874
15874
  _this.focusFirstControl();
15875
15875
  setTimeout(function () {
@@ -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 (this.equationLatex && this.equationLatex.trim() != '') {
46634
+ if (evt && typeof evt == 'string' && evt.trim() != '') {
46634
46635
  this.timeoutModelChange = setTimeout(function () {
46635
- _this.showPreview(_this.equationLatex.trim());
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-top:10px;padding:0 10px}.latexContent{resize:none;border-radius:0}"]
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: TemplateService },
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: 'non-breaking',
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 data = this.equationForm.preview.nativeElement.outerHTML;
51901
- this.editor.execCommand('mceInsertContent', true, data);
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\" (click)=\"handleOk($event)\"\n [label]=\"'Ok' | translate\"></button>\n <button icon=\"fas fa-undo\" [disabled]=\"model.submitting\" pButton class=\"ui-button-secondary\" type=\"button\"\n (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>",
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,