Merge remote-tracking branch 'origin/main' into redesign

This commit is contained in:
Anthony Stirling 2024-05-18 13:53:34 +01:00
commit f203e07f55
9 changed files with 1105 additions and 42 deletions

View File

@ -190,6 +190,7 @@ Stirling PDF currently supports 27!
| Bulgarian (Български) (bg_BG) | ![98%](https://geps.dev/progress/98) | | Bulgarian (Български) (bg_BG) | ![98%](https://geps.dev/progress/98) |
| Sebian Latin alphabet (Srpski) (sr_LATN_RS) | ![84%](https://geps.dev/progress/84) | | Sebian Latin alphabet (Srpski) (sr_LATN_RS) | ![84%](https://geps.dev/progress/84) |
| Ukrainian (Українська) (uk_UA) | ![90%](https://geps.dev/progress/90) | | Ukrainian (Українська) (uk_UA) | ![90%](https://geps.dev/progress/90) |
| Slovakian (Slovensky) (sk_SK) | ![98%](https://geps.dev/progress/98) |
## Contributing (creating issues, translations, fixing bugs, etc.) ## Contributing (creating issues, translations, fixing bugs, etc.)

View File

@ -123,6 +123,11 @@ ignore = [
'language.direction', 'language.direction',
] ]
[sk_SK]
ignore = [
'language.direction',
]
[sr_LATN_RS] [sr_LATN_RS]
ignore = [ ignore = [
'language.direction', 'language.direction',

File diff suppressed because it is too large Load Diff

View File

@ -11,23 +11,6 @@
/* Adjust this to your desired max height */ /* Adjust this to your desired max height */
} }
#searchForm {
width: 200px;
/* Adjust this value as needed */
}
/* Style the search results to match the navbar */
#searchResults {
max-height: 200px;
/* Adjust this value as needed */
overflow-y: auto;
width: 100%;
max-width: 300px;
/* Adjust to your preferred width */
transition: height 0.3s ease;
/* Smooth height transition */
}
#searchResults .dropdown-item { #searchResults .dropdown-item {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-sk" viewBox="0 0 640 480">
<path fill="#ee1c25" d="M0 0h640v480H0z"/>
<path fill="#0b4ea2" d="M0 0h640v320H0z"/>
<path fill="#fff" d="M0 0h640v160H0z"/>
<path fill="#fff" d="M233 370.8c-43-20.7-104.6-61.9-104.6-143.2 0-81.4 4-118.4 4-118.4h201.3s3.9 37 3.9 118.4S276 350 233 370.8"/>
<path fill="#ee1c25" d="M233 360c-39.5-19-96-56.8-96-131.4s3.6-108.6 3.6-108.6h184.8s3.5 34 3.5 108.6C329 303.3 272.5 341 233 360"/>
<path fill="#fff" d="M241.4 209c10.7.2 31.6.6 50.1-5.6 0 0-.4 6.7-.4 14.4s.5 14.4.5 14.4c-17-5.7-38.1-5.8-50.2-5.7v41.2h-16.8v-41.2c-12-.1-33.1 0-50.1 5.7 0 0 .5-6.7.5-14.4 0-7.8-.5-14.4-.5-14.4 18.5 6.2 39.4 5.8 50 5.6v-25.9c-9.7 0-23.7.4-39.6 5.7 0 0 .5-6.6.5-14.4 0-7.7-.5-14.4-.5-14.4 15.9 5.3 29.9 5.8 39.6 5.7-.5-16.4-5.3-37-5.3-37s9.9.7 13.8.7c4 0 13.8-.7 13.8-.7s-4.8 20.6-5.3 37c9.7.1 23.7-.4 39.6-5.7 0 0-.5 6.7-.5 14.4 0 7.8.5 14.4.5 14.4a119 119 0 0 0-39.7-5.7v26z"/>
<path fill="#0b4ea2" d="M233 263.3c-19.9 0-30.5 27.5-30.5 27.5s-6-13-22.2-13c-11 0-19 9.7-24.2 18.8 20 31.7 51.9 51.3 76.9 63.4 25-12 57-31.7 76.9-63.4-5.2-9-13.2-18.8-24.2-18.8-16.2 0-22.2 13-22.2 13S253 263.3 233 263.3"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1,4 +1,3 @@
// Toggle search bar when the search icon is clicked
window.onload = function () { window.onload = function () {
var items = document.querySelectorAll(".dropdown-item, .nav-link"); var items = document.querySelectorAll(".dropdown-item, .nav-link");
@ -28,43 +27,45 @@ window.onload = function () {
// Show search results as user types in search box // Show search results as user types in search box
document.querySelector("#navbarSearchInput").addEventListener("input", function (e) { document.querySelector("#navbarSearchInput").addEventListener("input", function (e) {
var searchText = e.target.value.toLowerCase(); var searchText = e.target.value.trim().toLowerCase(); // Trim whitespace and convert to lowercase
var items = document.querySelectorAll(".dropdown-item, .nav-link"); var items = document.querySelectorAll(".dropdown-item, .nav-link");
var resultsBox = document.querySelector("#searchResults"); var resultsBox = document.querySelector("#searchResults");
// Clear any previous results // Clear any previous results
resultsBox.innerHTML = ""; resultsBox.innerHTML = "";
if (searchText !== "") {
items.forEach(function (item) { items.forEach(function (item) {
var titleElement = item.querySelector(".icon-text"); var titleElement = item.querySelector(".icon-text");
var iconElement = item.querySelector(".material-symbols-rounded, .icon"); var iconElement = item.querySelector(".material-symbols-rounded, .icon");
var itemHref = item.getAttribute("href"); var itemHref = item.getAttribute("href");
var tags = item.getAttribute("data-bs-tags") || ""; // If no tags, default to empty string var tags = item.getAttribute("data-bs-tags") || ""; // If no tags, default to empty string
if (titleElement && iconElement && itemHref !== "#") {
var title = titleElement.innerText; if (titleElement && iconElement && itemHref !== "#") {
if ( var title = titleElement.innerText;
(title.toLowerCase().indexOf(searchText) !== -1 || tags.toLowerCase().indexOf(searchText) !== -1) && if (
!resultsBox.querySelector(`a[href="${item.getAttribute("href")}"]`) (title.toLowerCase().indexOf(searchText) !== -1 || tags.toLowerCase().indexOf(searchText) !== -1) &&
) { !resultsBox.querySelector(`a[href="${itemHref}"]`)
var result = document.createElement("a"); ) {
result.href = itemHref; var result = document.createElement("a");
result.classList.add("dropdown-item"); result.href = itemHref;
result.classList.add("dropdown-item");
var resultIcon = document.createElement("span"); var resultIcon = document.createElement("span");
resultIcon.classList.add("material-symbols-rounded"); resultIcon.classList.add("material-symbols-rounded");
resultIcon.textContent = iconElement.textContent; resultIcon.textContent = iconElement.textContent;
result.appendChild(resultIcon); result.appendChild(resultIcon);
var resultText = document.createElement("span"); var resultText = document.createElement("span");
resultText.textContent = title; resultText.textContent = title;
resultText.classList.add("icon-text"); resultText.classList.add("icon-text");
result.appendChild(resultText); result.appendChild(resultText);
resultsBox.appendChild(result); resultsBox.appendChild(result);
}
} }
} });
}); }
// Set the width of the search results box to the maximum width // Set the width of the search results box to the maximum width
resultsBox.style.width = window.navItemMaxWidth + "px"; resultsBox.style.width = window.navItemMaxWidth + "px";

View File

@ -17,6 +17,7 @@
<a class="dropdown-item lang_dropdown-item" href="" data-bs-language-code="pt_BR"> <img src="images/flags/pt_br.svg" alt="icon" width="20" height="15"> Português (BR)</a> <a class="dropdown-item lang_dropdown-item" href="" data-bs-language-code="pt_BR"> <img src="images/flags/pt_br.svg" alt="icon" width="20" height="15"> Português (BR)</a>
<a class="dropdown-item lang_dropdown-item" href="" data-bs-language-code="pt_PT"> <img src="images/flags/pt_pt.svg" alt="icon" width="20" height="15"> Português (PT)</a> <a class="dropdown-item lang_dropdown-item" href="" data-bs-language-code="pt_PT"> <img src="images/flags/pt_pt.svg" alt="icon" width="20" height="15"> Português (PT)</a>
<a class="dropdown-item lang_dropdown-item" href="" data-bs-language-code="ro_RO"> <img src="images/flags/ro.svg" alt="icon" width="20" height="15"> Romanian</a> <a class="dropdown-item lang_dropdown-item" href="" data-bs-language-code="ro_RO"> <img src="images/flags/ro.svg" alt="icon" width="20" height="15"> Romanian</a>
<a class="dropdown-item lang_dropdown-item" href="" data-bs-language-code="sk_SK"> <img src="images/flags/sk.svg" alt="icon" width="20" height="15"> Slovensky</a>
<a class="dropdown-item lang_dropdown-item" href="" data-bs-language-code="sv_SE"> <img src="images/flags/se.svg" alt="icon" width="20" height="15"> Svenska</a> <a class="dropdown-item lang_dropdown-item" href="" data-bs-language-code="sv_SE"> <img src="images/flags/se.svg" alt="icon" width="20" height="15"> Svenska</a>
<a class="dropdown-item lang_dropdown-item" href="" data-bs-language-code="tr_TR"> <img src="images/flags/tr.svg" alt="icon" width="20" height="15"> Türkçe</a> <a class="dropdown-item lang_dropdown-item" href="" data-bs-language-code="tr_TR"> <img src="images/flags/tr.svg" alt="icon" width="20" height="15"> Türkçe</a>
<a class="dropdown-item lang_dropdown-item" href="" data-bs-language-code="ru_RU"> <img src="images/flags/ru.svg" alt="icon" width="20" height="15"> Русский</a> <a class="dropdown-item lang_dropdown-item" href="" data-bs-language-code="ru_RU"> <img src="images/flags/ru.svg" alt="icon" width="20" height="15"> Русский</a>

View File

@ -58,7 +58,11 @@
console.log("loading pdf"); console.log("loading pdf");
document.querySelector("#editSection").style.display = ""; document.querySelector("#editSection").style.display = "";
const existingPreview = document.getElementById("pdf-preview");
if (existingPreview) {
existingPreview.remove();
}
var url = URL.createObjectURL(fileInput.files[0]) var url = URL.createObjectURL(fileInput.files[0])
pdfjsLib.GlobalWorkerOptions.workerSrc = 'pdfjs/pdf.worker.js' pdfjsLib.GlobalWorkerOptions.workerSrc = 'pdfjs/pdf.worker.js'
const pdf = await pdfjsLib.getDocument(url).promise; const pdf = await pdfjsLib.getDocument(url).promise;

View File

@ -185,11 +185,6 @@ See https://github.com/adobe-type-tools/cmap-resources
<div id="secondaryToolbar" class="secondaryToolbar hidden doorHangerRight"> <div id="secondaryToolbar" class="secondaryToolbar hidden doorHangerRight">
<div id="secondaryToolbarButtonContainer"> <div id="secondaryToolbarButtonContainer">
<a id="secondaryBackToHome" class="secondaryToolbarButton visibleLargeView" title="Back to Main Page"
tabindex="50"
data-l10n-id="back_to_home" th:href="@{/}">
<span data-l10n-id="back_to_home_label">Back to Main Page</span>
</a>
<button id="secondaryOpenFile" class="secondaryToolbarButton visibleLargeView" title="Open File" <button id="secondaryOpenFile" class="secondaryToolbarButton visibleLargeView" title="Open File"
tabindex="51" tabindex="51"
data-l10n-id="open_file"> data-l10n-id="open_file">