Stirling-PDF/src/main/resources
Omar Ahmed Hassan de4637e8d4
Fix drag and drop area for file choosers by adding separate ones (#2368)
* Add separate drag and drop area for file choosers

 - Add separate drag and drop area for file choosers

### Why?
Previously, when there were multiple file choosers in the same page, if you attempted to drag and drop any files, they would be added to both file choosers as it was designed at first to handle 1 file chooser present, now that we have multiple ones, it is necessary to adapt our design to match the changing functionality.

### Can you not preserve the old overlay when there's only one file chooser present?
Yes, we can, but imagine as a user, you try to drag and drop a file in one page and the fields turn into drag and drop areas then you go to another page and try to drag and drop again but you encounter the old overlay instead, as a user you might get confused and ask yourself "What changed?" or if a user is telling another user the steps to drag and drop files and he didn't know about this case, then it would still be confusing, thus consistency is preferred in this case.

* Update file chooser UI

* Add support for listing and removing selected files and their file icons

- Selected files are listed below the file chooser in a selected files container.
- Users can now remove uploaded/selected files.
- Hide selected files container/box unless there are files selected/uploaded.
- Add separate overlay for each drag & drop area.

## FAQ:
- Why did you assign a unique id to each file? isn't the filename enough?
= Because a user might upload multiple files with the same name, if the user wanted to remove one of them, how would we differentiate between them? we won't be able to unless we assign an identifier, you might argue "we remove based on the filename and size", then what if the user uploaded the same file more than once (intentionally), then we would accidentally remove all the files even though that is not what the user wanted, so going with unique ID approach would prevent this issue/problem from occurring in the first place.

* Rename remove-file css class to remove-selected-file

- Rename remove-file css class to remove-selected-file to avoid css conflict with remove-file in merge.css

* Use input element to dispatch event on file removal

Use the correct element to dispatch "file-input-change" (input element is the correct one).

* Adapt file chooser UI to themes

- Adapt file chooser UI to themes by adjusting their font colors and background colors.
- Make text more visible in overlay by increasing the font size by 0.1rem and setting font weight to 550.

* Remove extra overlay border

- Removing overlay's border as it is unnecessary and only causing a double border issue on the file input container.

* Remove Browse button, highlight file chooser and make it clickable

- Remove browse button.
- Make the entire file chooser container clickable.
- Add glowing effect on hover for file chooser.
- Change color of file chooser on hover.

* Replace crypto.randomUUID() with UUID.uuidv4()

- Replace crypto.randomUUID() with UUID.uuidv4() as crypto.randomUUID() is only supported in secured contexts such as localhost 127.0.0.1 and over HTTPS

* Fix merge file removal not being reflected in file chooser

- Files removed from the list in merge page would now be reflected in the file chooser's container.

* Make inputElement optional in removeFileById

- Make inputElement optional in removeFileById, this way we could control changing inputElements files.

* Add translation support to file chooser

---------

Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com>
2024-12-02 18:10:12 +00:00
..
static Fix drag and drop area for file choosers by adding separate ones (#2368) 2024-12-02 18:10:12 +00:00
templates Fix drag and drop area for file choosers by adding separate ones (#2368) 2024-12-02 18:10:12 +00:00
application.properties fixes and other changes and debug of WIP SAML (#2360) 2024-11-29 15:11:59 +00:00
banner.txt refactor: normalize files 2024-02-11 11:47:00 -05:00
logback.xml fix for #531 plus seperated out some things 2023-12-18 14:52:18 +00:00
messages_ar_AR.properties Fix drag and drop area for file choosers by adding separate ones (#2368) 2024-12-02 18:10:12 +00:00
messages_az_AZ.properties Update translation files (#2354) 2024-11-28 14:42:29 +00:00
messages_bg_BG.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_ca_CA.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_cs_CZ.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_da_DK.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_de_DE.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_el_GR.properties Fix translations for watermark spacers (#2369) 2024-12-02 17:01:19 +00:00
messages_en_GB.properties Fix drag and drop area for file choosers by adding separate ones (#2368) 2024-12-02 18:10:12 +00:00
messages_en_US.properties Fix translations for watermark spacers (#2369) 2024-12-02 17:01:19 +00:00
messages_es_ES.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_eu_ES.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_fr_FR.properties Fix translations for watermark spacers (#2369) 2024-12-02 17:01:19 +00:00
messages_ga_IE.properties Fix translations for watermark spacers (#2369) 2024-12-02 17:01:19 +00:00
messages_hi_IN.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_hr_HR.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_hu_HU.properties Fix translations for watermark spacers (#2369) 2024-12-02 17:01:19 +00:00
messages_id_ID.properties Fix translations for watermark spacers (#2369) 2024-12-02 17:01:19 +00:00
messages_it_IT.properties Update messages_it_IT.properties (#2355) 2024-11-28 14:42:55 +00:00
messages_ja_JP.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_ko_KR.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_nl_NL.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_no_NB.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_pl_PL.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_pt_BR.properties Fix translations for watermark spacers (#2369) 2024-12-02 17:01:19 +00:00
messages_pt_PT.properties Fix translations for watermark spacers (#2369) 2024-12-02 17:01:19 +00:00
messages_ro_RO.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_ru_RU.properties Fix translations for watermark spacers (#2369) 2024-12-02 17:01:19 +00:00
messages_sk_SK.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_sr_LATN_RS.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_sv_SE.properties Fix translations for watermark spacers (#2369) 2024-12-02 17:01:19 +00:00
messages_th_TH.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_tr_TR.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_uk_UA.properties Fix translations for watermark spacers (#2369) 2024-12-02 17:01:19 +00:00
messages_vi_VN.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_zh_CN.properties Feature: Undo Redo options multi tool #2297 (#2348) 2024-11-28 14:25:13 +00:00
messages_zh_TW.properties Fix translations for watermark spacers (#2369) 2024-12-02 17:01:19 +00:00
messages.properties Number of fixes and making pipline LIVE ! (#907) 2024-03-13 19:15:10 +00:00
settings.yml.template fixes and other changes and debug of WIP SAML (#2360) 2024-11-29 15:11:59 +00:00