Skip to content

Commit

Permalink
Merge pull request #920 from adobecom/MWPW-164239
Browse files Browse the repository at this point in the history
MWPW-164239: Unity - Adding multiple attribute & limits update
  • Loading branch information
TsayAdobe authored Dec 20, 2024
2 parents e8bd6e8 + 3b76d83 commit 8722570
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
26 changes: 19 additions & 7 deletions acrobat/blocks/verb-widget/limits.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,37 @@
const LIMITS = {
fillsign: {
maxFileSize: 100000000, // 100 MB
maxFileSize: 104857600, // 100 MB
maxFileSizeFriendly: '100 MB', // 100 MB
acceptedFiles: '.pdf',
acceptedFiles: ['application/pdf'],
maxNumFiles: 1,
multipleFiles: false,
mobileApp: true,
},
'delete-pages': {
maxFileSize: 100000000, // 1 MB
acceptedFiles: '.pdf',
acceptedFiles: ['application/pdf'],
maxNumFiles: 1,
},
'number-pages': {
maxFileSize: 100000000, // 1 MB
acceptedFiles: '.pdf',
acceptedFiles: ['application/pdf'],
maxNumFiles: 1,
},
'compress-pdf': {
maxFileSize: 100000000,
acceptedFiles: '.pdf',
maxNumFiles: 1,
maxFileSize: 2147483648,
maxFileSizeFriendly: '2 GB',
acceptedFiles: [
'application/pdf',
'application/msword',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/vnd.ms-powerpoint',
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'application/vnd.ms-excel',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'image/jpeg',
'image/png',
],
multipleFiles: true,
},
};

Expand Down
9 changes: 8 additions & 1 deletion acrobat/blocks/verb-widget/verb-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,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);
Expand Down

0 comments on commit 8722570

Please sign in to comment.