From cbb4ccd4b743deaaba5039c35e28327cc7a2a6d9 Mon Sep 17 00:00:00 2001 From: Ludy87 Date: Sat, 25 May 2024 21:10:12 +0200 Subject: [PATCH] add: multi OAuth2 option README.md, small cosmetic repairs --- CONTRIBUTING.md | 2 +- README.md | 22 ++++++++- .../converters/ConvertImgPDFController.java | 7 ++- .../SPDF/model/ApplicationProperties.java | 3 -- .../resources/static/js/languageSelection.js | 32 ++++++------- src/main/resources/static/js/search.js | 1 - .../templates/convert/pdf-to-pdfa.html | 14 +++--- .../fragments/errorBannerPerPage.html | 18 ++++---- .../resources/templates/fragments/navbar.html | 46 ++++++++----------- .../resources/templates/misc/flatten.html | 2 +- .../resources/templates/misc/print-file.html | 4 +- 11 files changed, 78 insertions(+), 73 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 646bdddb..dad8928d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,7 +29,7 @@ If you would like to add or modify a translation, please see [How to add new lan ## Docs -Documentation for Stirling-PDF is handled in a seperate repository. Please see [Docs repository](https://github.com/Stirling-Tools/Stirling-Tools.github.io) or use "edit this page"-button at the bottom of each page at [https://stirlingtools.com/docs/](https://stirlingtools.com/docs/). +Documentation for Stirling-PDF is handled in a separate repository. Please see [Docs repository](https://github.com/Stirling-Tools/Stirling-Tools.github.io) or use "edit this page"-button at the bottom of each page at [https://stirlingtools.com/docs/](https://stirlingtools.com/docs/). ## Fixing Bugs or Adding a New Feature diff --git a/README.md b/README.md index a6bf84b1..748bfb1b 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,7 @@ Please view https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToUseOCR ## Supported Languages -Stirling PDF currently supports 27! +Stirling PDF currently supports 28! | Language | Progress | | ------------------------------------------- | -------------------------------------- | @@ -191,6 +191,7 @@ Stirling PDF currently supports 27! | Sebian Latin alphabet (Srpski) (sr_LATN_RS) | ![82%](https://geps.dev/progress/82) | | Ukrainian (Українська) (uk_UA) | ![88%](https://geps.dev/progress/88) | | Slovakian (Slovensky) (sk_SK) | ![96%](https://geps.dev/progress/96) | +| Czech (Česky) (cs_CZ) | ![96%](https://geps.dev/progress/96) | ## Contributing (creating issues, translations, fixing bugs, etc.) @@ -226,7 +227,7 @@ security: loginAttemptCount: 5 # lock user account after 5 tries loginResetTimeMinutes: 120 # lock account for 2 hours after x attempts # initialLogin: -# username: "admin" # Initial username for the first login (these are defaulted) +# username: "admin" # Initial username for the first login # password: "stirling" # Initial password for the first login # oauth2: # enabled: false # set to 'true' to enable login (Note: enableLogin must also be 'true' for this to work) @@ -237,6 +238,23 @@ security: # useAsUsername: "email" # Default is 'email'; custom fields can be used as the username # scopes: "openid, profile, email" # Specify the scopes for which the application will request permissions # provider: "google" # Set this to your OAuth provider's name, e.g., 'google' or 'keycloak' +# client: +# google: +# clientId: "" # Client ID for Google OAuth2 +# clientSecret: "" # Client Secret for Google OAuth2 +# scopes: "https://www.googleapis.com/auth/userinfo.email, https://www.googleapis.com/auth/userinfo.profile" # Scopes for Google OAuth2 +# useAsUsername: "email" # Field to use as the username for Google OAuth2 +# github: +# clientId: "" # Client ID for GitHub OAuth2 +# clientSecret: "" # Client Secret for GitHub OAuth2 +# scopes: "read:user" # Scope for GitHub OAuth2 +# useAsUsername: "login" # Field to use as the username for GitHub OAuth2 +# keycloak: +# issuer: "http://192.168.0.123:8888/realms/stirling-pdf" # URL of the Keycloak realm's OpenID Connect Discovery endpoint +# clientId: "stirling-pdf" # Client ID for Keycloak OAuth2 +# clientSecret: "" # Client Secret for Keycloak OAuth2 +# scopes: "openid, profile, email" # Scopes for Keycloak OAuth2 +# useAsUsername: "email" # Field to use as the username for Keycloak OAuth2 system: defaultLocale: 'en-US' # Set the default language (e.g. 'de-DE', 'fr-FR', etc) diff --git a/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertImgPDFController.java b/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertImgPDFController.java index 3f880a80..25c37aad 100644 --- a/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertImgPDFController.java +++ b/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertImgPDFController.java @@ -56,7 +56,7 @@ public class ConvertImgPDFController { String filename = Filenames.toSimpleFileName(file.getOriginalFilename()) .replaceFirst("[.][^.]+$", ""); - + result = PdfUtils.convertFromPdf( pdfBytes, @@ -65,10 +65,9 @@ public class ConvertImgPDFController { singleImage, Integer.valueOf(dpi), filename); - - if(result == null || result.length == 0) { - logger.error("resultant bytes for {} is null, error converting ", filename); + if (result == null || result.length == 0) { + logger.error("resultant bytes for {} is null, error converting ", filename); } if (singleImage) { String docName = filename + "." + imageFormat; diff --git a/src/main/java/stirling/software/SPDF/model/ApplicationProperties.java b/src/main/java/stirling/software/SPDF/model/ApplicationProperties.java index c8e74e40..c2253b21 100644 --- a/src/main/java/stirling/software/SPDF/model/ApplicationProperties.java +++ b/src/main/java/stirling/software/SPDF/model/ApplicationProperties.java @@ -750,9 +750,6 @@ public class ApplicationProperties { this.googlevisibility = googlevisibility; } - - - @Override public String toString() { return "System [defaultLocale=" diff --git a/src/main/resources/static/js/languageSelection.js b/src/main/resources/static/js/languageSelection.js index 55f0647e..788a3420 100644 --- a/src/main/resources/static/js/languageSelection.js +++ b/src/main/resources/static/js/languageSelection.js @@ -60,22 +60,22 @@ function handleDropdownItemClick(event) { } document.addEventListener("DOMContentLoaded", function () { - -document.querySelectorAll(".col-lg-2.col-sm-6").forEach((element) => { - const dropdownItems = element.querySelectorAll(".dropdown-item"); - const items = Array.from(dropdownItems).filter(item => !item.querySelector("hr.dropdown-divider")); - - if (items.length <= 2) { - if ( - element.previousElementSibling && - element.previousElementSibling.classList.contains("col-lg-2") && - element.previousElementSibling.classList.contains("nav-item-separator") - ) { - element.previousElementSibling.remove(); - } - element.remove(); - } -}); + + document.querySelectorAll(".col-lg-2.col-sm-6").forEach((element) => { + const dropdownItems = element.querySelectorAll(".dropdown-item"); + const items = Array.from(dropdownItems).filter(item => !item.querySelector("hr.dropdown-divider")); + + if (items.length <= 2) { + if ( + element.previousElementSibling && + element.previousElementSibling.classList.contains("col-lg-2") && + element.previousElementSibling.classList.contains("nav-item-separator") + ) { + element.previousElementSibling.remove(); + } + element.remove(); + } + }); //Sort languages by alphabet const list = Array.from(document.querySelector('.dropdown-menu[aria-labelledby="languageDropdown"]').children).filter( diff --git a/src/main/resources/static/js/search.js b/src/main/resources/static/js/search.js index a5b9d70f..aec3e6c1 100644 --- a/src/main/resources/static/js/search.js +++ b/src/main/resources/static/js/search.js @@ -40,7 +40,6 @@ document.querySelector("#navbarSearchInput").addEventListener("input", function var itemHref = item.getAttribute("href"); var tags = item.getAttribute("data-bs-tags") || ""; // If no tags, default to empty string - if (titleElement && iconElement && itemHref !== "#") { var title = titleElement.innerText; if ( diff --git a/src/main/resources/templates/convert/pdf-to-pdfa.html b/src/main/resources/templates/convert/pdf-to-pdfa.html index 49257511..654d58fe 100644 --- a/src/main/resources/templates/convert/pdf-to-pdfa.html +++ b/src/main/resources/templates/convert/pdf-to-pdfa.html @@ -20,13 +20,13 @@

-
- - -
+
+ + +

diff --git a/src/main/resources/templates/fragments/errorBannerPerPage.html b/src/main/resources/templates/fragments/errorBannerPerPage.html index eb74361e..9121f1b3 100644 --- a/src/main/resources/templates/fragments/errorBannerPerPage.html +++ b/src/main/resources/templates/fragments/errorBannerPerPage.html @@ -6,10 +6,10 @@ + + close + +
@@ -23,11 +23,11 @@
diff --git a/src/main/resources/templates/misc/print-file.html b/src/main/resources/templates/misc/print-file.html index 16dc5c3f..e665139c 100644 --- a/src/main/resources/templates/misc/print-file.html +++ b/src/main/resources/templates/misc/print-file.html @@ -19,8 +19,8 @@

Select Printer

- - + +