From 63a9e40aa90b01c5fced7d36223c3da332d2e4ad Mon Sep 17 00:00:00 2001 From: albanobattistella <34811668+albanobattistella@users.noreply.github.com> Date: Mon, 14 Apr 2025 23:37:51 +0200 Subject: [PATCH 1/9] Update messages_it_IT.properties (#3350) # Description of Changes Please provide a summary of the changes, including: - What was changed - Why the change was made - Any challenges encountered Closes #(issue_number) --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing) for more details. --- src/main/resources/messages_it_IT.properties | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/messages_it_IT.properties b/src/main/resources/messages_it_IT.properties index 62b8b096..30368524 100644 --- a/src/main/resources/messages_it_IT.properties +++ b/src/main/resources/messages_it_IT.properties @@ -10,9 +10,9 @@ multiPdfPrompt=Scegli 2 o più PDF multiPdfDropPrompt=Scegli (o trascina e rilascia) uno o più PDF imgPrompt=Scegli immagine/i genericSubmit=Invia -uploadLimit=Maximum file size: -uploadLimitExceededSingular=is too large. Maximum allowed size is -uploadLimitExceededPlural=are too large. Maximum allowed size is +uploadLimit=Dimensione massima del file: +uploadLimitExceededSingular=è troppo grande. La dimensione massima consentita è +uploadLimitExceededPlural=sono troppo grandi. La dimensione massima consentita è processTimeWarning=Nota: Questo processo potrebbe richiedere fino a un minuto in base alla dimensione dei file pageOrderPrompt=Ordine delle pagine (inserisci una lista di numeri separati da virgola): pageSelectionPrompt=Selezione pagina personalizzata (inserisci un elenco separato da virgole di numeri di pagina 1,5,6 o funzioni come 2n+1) : @@ -93,7 +93,7 @@ legal.terms=Termini e Condizioni legal.accessibility=Accessibilità legal.cookie=Informativa sui cookie legal.impressum=Informazioni legali -legal.showCookieBanner=Cookie Preferences +legal.showCookieBanner=Preferenze sui cookie ############### # Pipeline # From 5a0567cf6a316c686cd4d91302235878c110c9e3 Mon Sep 17 00:00:00 2001 From: ConnorYoh <40631091+ConnorYoh@users.noreply.github.com> Date: Mon, 14 Apr 2025 23:33:40 +0100 Subject: [PATCH 2/9] Error reductions found via analytics (#3351) # Description of Changes Please provide a summary of the changes, including: - What was changed - Why the change was made - Any challenges encountered Closes #(issue_number) --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing) for more details. --- src/main/resources/static/js/downloader.js | 4 +++- src/main/resources/static/js/fileInput.js | 2 +- src/main/resources/static/js/homecard-legacy.js | 7 +++++++ src/main/resources/static/js/homecard.js | 7 +------ src/main/resources/static/js/languageSelection.js | 10 +++++++--- .../static/js/multitool/commands/delete-page.js | 7 ------- src/main/resources/static/js/pages/home.js | 2 +- src/main/resources/templates/fragments/navbar.html | 2 +- src/main/resources/templates/login.html | 2 +- src/main/resources/templates/misc/add-image.html | 2 +- 10 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/main/resources/static/js/downloader.js b/src/main/resources/static/js/downloader.js index 3b325b59..7bdcd83d 100644 --- a/src/main/resources/static/js/downloader.js +++ b/src/main/resources/static/js/downloader.js @@ -132,7 +132,9 @@ } } catch (error) { clearTimeout(timeoutId); - showGameBtn.style.display = 'none'; + if(showGameBtn){ + showGameBtn.style.display = 'none'; + } submitButton.textContent = originalButtonText; submitButton.disabled = false; handleDownloadError(error); diff --git a/src/main/resources/static/js/fileInput.js b/src/main/resources/static/js/fileInput.js index a67ff1fd..b24563c0 100644 --- a/src/main/resources/static/js/fileInput.js +++ b/src/main/resources/static/js/fileInput.js @@ -170,7 +170,7 @@ function setupFileInput(chooser) { inputContainer.querySelector('#fileInputText').innerHTML = window.fileInput.loading; async function checkZipFile() { - const hasZipFiles = allFiles.some(file => zipTypes.includes(file.type)); + const hasZipFiles = allFiles.some(file => file.type && zipTypes.includes(file.type)); // Only change to extractPDF message if we actually have zip files if (hasZipFiles) { diff --git a/src/main/resources/static/js/homecard-legacy.js b/src/main/resources/static/js/homecard-legacy.js index 02789efd..a43453f1 100644 --- a/src/main/resources/static/js/homecard-legacy.js +++ b/src/main/resources/static/js/homecard-legacy.js @@ -255,5 +255,12 @@ document.addEventListener('DOMContentLoaded', function () { }); }, 500); + Array.from(document.querySelectorAll('.feature-group-header')).forEach((header) => { + const parent = header.parentNode; + header.onclick = () => { + expandCollapseToggle(parent); + }; + }); + showFavoritesOnly(); }); diff --git a/src/main/resources/static/js/homecard.js b/src/main/resources/static/js/homecard.js index 33d49a78..8f5a92f0 100644 --- a/src/main/resources/static/js/homecard.js +++ b/src/main/resources/static/js/homecard.js @@ -241,10 +241,5 @@ document.addEventListener('DOMContentLoaded', async function () { console.error('Material Symbols Rounded font failed to load.'); }); - Array.from(document.querySelectorAll('.feature-group-header')).forEach((header) => { - const parent = header.parentNode; - header.onclick = () => { - expandCollapseToggle(parent); - }; - }); + }); diff --git a/src/main/resources/static/js/languageSelection.js b/src/main/resources/static/js/languageSelection.js index 2c7e0406..7d4b8bc0 100644 --- a/src/main/resources/static/js/languageSelection.js +++ b/src/main/resources/static/js/languageSelection.js @@ -57,11 +57,15 @@ function initLanguageSettings() { function sortLanguageDropdown() { document.addEventListener('DOMContentLoaded', function () { - const dropdownMenu = document.querySelector('.dropdown-menu .dropdown-item.lang_dropdown-item').parentElement; + const dropdownMenu = document.getElementById('languageSelection'); if (dropdownMenu) { - const items = Array.from(dropdownMenu.children).filter((child) => child.matches('a')); + const items = Array.from(dropdownMenu.children).filter((child) => child.querySelector('a')); items - .sort((a, b) => a.dataset.bsLanguageCode.localeCompare(b.dataset.bsLanguageCode)) + .sort((wrapperA, wrapperB) => { + const a = wrapperA.querySelector('a'); + const b = wrapperB.querySelector('a'); + return a.dataset.bsLanguageCode.localeCompare(b.dataset.bsLanguageCode); + }) .forEach((node) => dropdownMenu.appendChild(node)); } }); diff --git a/src/main/resources/static/js/multitool/commands/delete-page.js b/src/main/resources/static/js/multitool/commands/delete-page.js index 89fbe8a2..751b115e 100644 --- a/src/main/resources/static/js/multitool/commands/delete-page.js +++ b/src/main/resources/static/js/multitool/commands/delete-page.js @@ -21,12 +21,10 @@ export class DeletePageCommand extends Command { this.pagesContainer.removeChild(this.element); if (this.pagesContainer.childElementCount === 0) { const filenameInput = document.getElementById("filename-input"); - const filenameParagraph = document.getElementById("filename"); const downloadBtn = document.getElementById("export-button"); filenameInput.disabled = true; filenameInput.value = ""; - filenameParagraph.innerText = ""; downloadBtn.disabled = true; } @@ -43,13 +41,10 @@ export class DeletePageCommand extends Command { } const filenameInput = document.getElementById("filename-input"); - const filenameParagraph = document.getElementById("filename"); const downloadBtn = document.getElementById("export-button"); filenameInput.disabled = false; filenameInput.value = this.filenameInputValue; - if (this.filenameParagraph) - filenameParagraph.innerText = this.filenameParagraphText; downloadBtn.disabled = false; } @@ -63,12 +58,10 @@ export class DeletePageCommand extends Command { this.pagesContainer.removeChild(this.element); if (this.pagesContainer.childElementCount === 0) { const filenameInput = document.getElementById("filename-input"); - const filenameParagraph = document.getElementById("filename"); const downloadBtn = document.getElementById("export-button"); filenameInput.disabled = true; filenameInput.value = ""; - filenameParagraph.innerText = ""; downloadBtn.disabled = true; } diff --git a/src/main/resources/static/js/pages/home.js b/src/main/resources/static/js/pages/home.js index 8565c44a..7872374e 100644 --- a/src/main/resources/static/js/pages/home.js +++ b/src/main/resources/static/js/pages/home.js @@ -112,10 +112,10 @@ function setAsDefault(value) { function adjustVisibleElements() { const container = document.querySelector('.recent-features'); + if(!container) return; const subElements = Array.from(container.children); let totalWidth = 0; - const containerWidth = container.offsetWidth; subElements.forEach((element) => { totalWidth += 12 * parseFloat(getComputedStyle(document.documentElement).fontSize); diff --git a/src/main/resources/templates/fragments/navbar.html b/src/main/resources/templates/fragments/navbar.html index b338f3f7..593d8c21 100644 --- a/src/main/resources/templates/fragments/navbar.html +++ b/src/main/resources/templates/fragments/navbar.html @@ -143,7 +143,7 @@