nuxeo-development-framework 4.5.2 → 4.5.3

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.
@@ -6924,7 +6924,7 @@
6924
6924
  };
6925
6925
  VersionsComponent.prototype.getFileSize = function (version) {
6926
6926
  var file = version.properties['file:content'] || version.properties.content;
6927
- if (file.length) {
6927
+ if (file && file.length) {
6928
6928
  var length = +file.length;
6929
6929
  if (length < 1000000) {
6930
6930
  // trnasfer to KB
@@ -29868,64 +29868,66 @@
29868
29868
  var _this = this;
29869
29869
  return __generator(this, function (_a) {
29870
29870
  this.recivedSearchStringsArray = this.searchString.trim() ? this.searchString.split(',') : [];
29871
- if (this.fileTitle.endsWith('.ppt')) {
29872
- this.DOCUMENT_TYPE = 'application/vnd.ms-powerpoint';
29873
- }
29874
- else if (this.fileTitle.endsWith('.pptx')) {
29875
- this.DOCUMENT_TYPE =
29876
- 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
29877
- }
29878
- else if (this.fileTitle.endsWith('.doc')) {
29879
- this.DOCUMENT_TYPE = 'application/msword';
29880
- }
29881
- else if (this.fileTitle.endsWith('.docx')) {
29882
- this.DOCUMENT_TYPE =
29883
- 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
29884
- }
29885
- WebViewer__default["default"]({
29886
- path: this.baseHref + '/assets/pdftrons',
29887
- forceClientSideInit: true,
29888
- streaming: true,
29889
- licenseKey: this.environment.pdftronLicenceKey,
29890
- css: this.isArabic ? (this.baseHref + '/assets/styles/ar-mypdftron.css') : (this.baseHref + '/assets/styles/en-mypdftron.css'),
29891
- annotationUser: this.nuxeo.nuxeoClient.user.properties.firstName + ' ' + this.nuxeo.nuxeoClient.user.properties.lastName,
29892
- disabledElements: ['downloadButton', 'printButton'],
29893
- }, this.viewerRef.nativeElement).then(function (instance) { return __awaiter(_this, void 0, void 0, function () {
29894
- return __generator(this, function (_a) {
29895
- this.isArabic ? instance.setLanguage('ar') : instance.setLanguage('en');
29896
- this.pdftronService.instance = this.webViewerInstance = instance;
29897
- if (this.correspondance.facets.indexOf('ctocr') > -1) {
29898
- this.fileWithOcr = true;
29899
- this.pages = JSON.parse(this.correspondance.properties['ctocr:recognizedJson']);
29900
- // override search funtion to use our search in ocr not defult search
29901
- instance.overrideSearchExecution(this.searchFn);
29902
- }
29903
- else {
29904
- // if no ocr then add search lisner to lisne to internal search and catch results
29905
- this.addSearchListner();
29906
- }
29907
- this.addPrintButton();
29908
- this.addDownloadButton();
29909
- this.importSignature();
29910
- this.exportingSignature();
29911
- this.deleteAnnotation();
29912
- this.exportingSavedSignature();
29913
- if (this.useOutsideAnotations) {
29914
- this.importAnotationsFromOutside();
29915
- this.exportAnotationsToOutside();
29916
- }
29917
- this.webViewerInstance.docViewer.setSearchHighlightColors({
29918
- // setSearchHighlightColors accepts both Annotations.Color objects or 'rgba' strings
29919
- searchResult: new this.webViewerInstance.Annotations.Color(250, 206, 0, 0.50196),
29920
- activeSearchResult: new this.webViewerInstance.Annotations.Color(250, 206, 0, 0.50196),
29871
+ if (this.fileTitle) {
29872
+ if (this.fileTitle.endsWith('.ppt')) {
29873
+ this.DOCUMENT_TYPE = 'application/vnd.ms-powerpoint';
29874
+ }
29875
+ else if (this.fileTitle.endsWith('.pptx')) {
29876
+ this.DOCUMENT_TYPE =
29877
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
29878
+ }
29879
+ else if (this.fileTitle.endsWith('.doc')) {
29880
+ this.DOCUMENT_TYPE = 'application/msword';
29881
+ }
29882
+ else if (this.fileTitle.endsWith('.docx')) {
29883
+ this.DOCUMENT_TYPE =
29884
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
29885
+ }
29886
+ WebViewer__default["default"]({
29887
+ path: this.baseHref + '/assets/pdftrons',
29888
+ forceClientSideInit: true,
29889
+ streaming: true,
29890
+ licenseKey: this.environment.pdftronLicenceKey,
29891
+ css: this.isArabic ? (this.baseHref + '/assets/styles/ar-mypdftron.css') : (this.baseHref + '/assets/styles/en-mypdftron.css'),
29892
+ annotationUser: this.nuxeo.nuxeoClient.user.properties.firstName + ' ' + this.nuxeo.nuxeoClient.user.properties.lastName,
29893
+ disabledElements: ['downloadButton', 'printButton'],
29894
+ }, this.viewerRef.nativeElement).then(function (instance) { return __awaiter(_this, void 0, void 0, function () {
29895
+ return __generator(this, function (_a) {
29896
+ this.isArabic ? instance.setLanguage('ar') : instance.setLanguage('en');
29897
+ this.pdftronService.instance = this.webViewerInstance = instance;
29898
+ if (this.correspondance.facets.indexOf('ctocr') > -1) {
29899
+ this.fileWithOcr = true;
29900
+ this.pages = JSON.parse(this.correspondance.properties['ctocr:recognizedJson']);
29901
+ // override search funtion to use our search in ocr not defult search
29902
+ instance.overrideSearchExecution(this.searchFn);
29903
+ }
29904
+ else {
29905
+ // if no ocr then add search lisner to lisne to internal search and catch results
29906
+ this.addSearchListner();
29907
+ }
29908
+ this.addPrintButton();
29909
+ this.addDownloadButton();
29910
+ this.importSignature();
29911
+ this.exportingSignature();
29912
+ this.deleteAnnotation();
29913
+ this.exportingSavedSignature();
29914
+ if (this.useOutsideAnotations) {
29915
+ this.importAnotationsFromOutside();
29916
+ this.exportAnotationsToOutside();
29917
+ }
29918
+ this.webViewerInstance.docViewer.setSearchHighlightColors({
29919
+ // setSearchHighlightColors accepts both Annotations.Color objects or 'rgba' strings
29920
+ searchResult: new this.webViewerInstance.Annotations.Color(250, 206, 0, 0.50196),
29921
+ activeSearchResult: new this.webViewerInstance.Annotations.Color(250, 206, 0, 0.50196),
29922
+ });
29923
+ if (this.recivedSearchStringsArray.length !== 0) {
29924
+ this.automaticSearch(this.recivedSearchStringsArray);
29925
+ }
29926
+ this.loadDocument();
29927
+ return [2 /*return*/];
29921
29928
  });
29922
- if (this.recivedSearchStringsArray.length !== 0) {
29923
- this.automaticSearch(this.recivedSearchStringsArray);
29924
- }
29925
- this.loadDocument();
29926
- return [2 /*return*/];
29927
- });
29928
- }); });
29929
+ }); });
29930
+ }
29929
29931
  return [2 /*return*/];
29930
29932
  });
29931
29933
  });