From d9d3cdf0921a98f55e6311a1994b0c047a978ed5 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 21 Sep 2021 17:10:00 +0530 Subject: [PATCH 1/4] minor UX fixes for demo purposes --- www/convert/app-convert.less | 4 ++++ www/convert/inner.js | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/www/convert/app-convert.less b/www/convert/app-convert.less index c5813641a..2815230da 100644 --- a/www/convert/app-convert.less +++ b/www/convert/app-convert.less @@ -13,4 +13,8 @@ flex-flow: column; background-color: @cp_app-bg; + input[type="file"] { + padding: 5px !important; + margin-bottom: 5px; + } } diff --git a/www/convert/inner.js b/www/convert/inner.js index a3b244a8a..08ac8a7fc 100644 --- a/www/convert/inner.js +++ b/www/convert/inner.js @@ -120,8 +120,10 @@ define([ type: 'file' }); APP.$rightside.append([hint, picker]); + Messages.convert_unsupported = "UNSUPPORTED FILE TYPE :("; // XXX $(picker).on('change', function () { + APP.$rightside.find('button, div.notice').remove(); var file = picker.files[0]; var name = file && file.name; var reader = new FileReader(); @@ -140,6 +142,9 @@ define([ }).appendTo(APP.$rightside); }); + } else { + var notice = h('div.notice', Messages.convert_unsupported); + APP.$rightside.append(notice); } }; reader.readAsArrayBuffer(file, 'application/octet-stream'); From a9e9ee6c7a95438c79cc82955064d775526f7df4 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 27 Sep 2021 14:43:46 +0530 Subject: [PATCH 2/4] guard against typeError when importing sheets --- www/common/media-tag.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/www/common/media-tag.js b/www/common/media-tag.js index a99a74f8f..133e64805 100644 --- a/www/common/media-tag.js +++ b/www/common/media-tag.js @@ -82,7 +82,11 @@ var factory = function () { plainText.innerText = e.srcElement.result; cb(void 0, plainText); }); - reader.readAsText(content); + try { + reader.readAsText(content); + } catch (err) { + cb(err); + } }, image: function (metadata, url, content, cfg, cb) { var img = document.createElement('img'); From 3e9b00077bbff546a7248ddfc14aa7c02823290b Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 27 Sep 2021 14:44:28 +0530 Subject: [PATCH 3/4] allow ods and odp export directly from OnlyOffice --- www/common/onlyoffice/inner.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index caa3e39e4..79a6cfd56 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -1803,9 +1803,9 @@ define([ var type = common.getMetadataMgr().getPrivateData().ooType; var warning = ''; if (type==="presentation") { - ext = ['.pptx', /*'.odp',*/ '.bin']; + ext = ['.pptx', '.odp', '.bin']; } else if (type==="doc") { - ext = ['.docx', /*'.odt',*/ '.bin']; + ext = ['.docx', '.odt', '.bin']; } if (!supportsXLSX()) { From ce8f108437603a79729471afcf8c5b12fb618dd8 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 27 Sep 2021 16:49:33 +0530 Subject: [PATCH 4/4] apply our usual button styles to the calendar export dropdown --- www/calendar/inner.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/calendar/inner.js b/www/calendar/inner.js index fbc910bdb..80b5606f2 100644 --- a/www/calendar/inner.js +++ b/www/calendar/inner.js @@ -513,7 +513,8 @@ define([ options: types, // Entries displayed in the menu isSelect: true, initialValue: '.ics', - common: common + common: common, + buttonCls: 'btn', }; var $select = UIElements.createDropdown(dropdownConfig); UI.prompt(Messages.exportPrompt,