From 8464b5bb1d2aee0446d7239327f47662a8ea7f05 Mon Sep 17 00:00:00 2001 From: Joaquin Rivero Date: Thu, 12 Dec 2024 20:06:46 -0800 Subject: [PATCH] Adding multiple attribute and increasing max file size in compress pdf --- acrobat/blocks/verb-widget/limits.js | 4 ++-- acrobat/blocks/verb-widget/verb-widget.js | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/acrobat/blocks/verb-widget/limits.js b/acrobat/blocks/verb-widget/limits.js index 4457b30b..cc74a06c 100644 --- a/acrobat/blocks/verb-widget/limits.js +++ b/acrobat/blocks/verb-widget/limits.js @@ -17,9 +17,9 @@ const LIMITS = { maxNumFiles: 1, }, 'compress-pdf': { - maxFileSize: 100000000, + maxFileSize: 2000000000, acceptedFiles: '.pdf', - maxNumFiles: 1, + maxFileSizeFriendly: '2 GB', }, }; diff --git a/acrobat/blocks/verb-widget/verb-widget.js b/acrobat/blocks/verb-widget/verb-widget.js index 6d559290..dbc69271 100644 --- a/acrobat/blocks/verb-widget/verb-widget.js +++ b/acrobat/blocks/verb-widget/verb-widget.js @@ -130,7 +130,14 @@ export default async function init(element) { } const widgetMobileButton = createTag('a', { class: 'verb-mobile-cta', href: mobileLink }, window.mph['verb-widget-cta-mobile']); - const button = createTag('input', { type: 'file', accept: LIMITS[VERB].acceptedFiles, id: 'file-upload', class: 'hide', 'aria-hidden': true }); + const button = createTag('input', { + type: 'file', + accept: LIMITS[VERB]?.acceptedFiles, + id: 'file-upload', + class: 'hide', + 'aria-hidden': true, + ...(LIMITS[VERB]?.multipleFiles && { multiple: '' }), + }); const widgetImage = createTag('div', { class: 'verb-image' }); const verbIconName = `${VERB}`; const verbImageSvg = createSvgElement(verbIconName);