diff --git a/build.gradle b/build.gradle index 8f0c72ec..5e95460f 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ plugins { } group = 'stirling.software' -version = '0.12.2' +version = '0.12.3' sourceCompatibility = '17' repositories { @@ -45,8 +45,9 @@ launch4j { } dependencies { + implementation 'org.yaml:snakeyaml:2.1' implementation 'org.springframework.boot:spring-boot-starter-web:3.1.2' - implementation 'org.springframework.boot:spring-boot-starter-thymeleaf:3.1.1' + implementation 'org.springframework.boot:spring-boot-starter-thymeleaf:3.1.2' testImplementation 'org.springframework.boot:spring-boot-starter-test:3.1.2' // https://mvnrepository.com/artifact/org.apache.pdfbox/jbig2-imageio implementation group: 'org.apache.pdfbox', name: 'jbig2-imageio', version: '3.0.4' diff --git a/src/main/java/stirling/software/SPDF/config/MetricsFilter.java b/src/main/java/stirling/software/SPDF/config/MetricsFilter.java index 87edc0f6..5b8ffd67 100644 --- a/src/main/java/stirling/software/SPDF/config/MetricsFilter.java +++ b/src/main/java/stirling/software/SPDF/config/MetricsFilter.java @@ -30,7 +30,7 @@ public class MetricsFilter extends OncePerRequestFilter { //System.out.println("uri="+uri + ", method=" + request.getMethod() ); // Ignore static resources - if (!(uri.startsWith("/js") || uri.startsWith("/images") || uri.endsWith(".ico") || uri.endsWith(".css") || uri.endsWith(".svg")|| uri.endsWith(".js") || uri.contains("swagger") || uri.startsWith("/api"))) { + if (!(uri.startsWith("/js") || uri.startsWith("api-docs") || uri.startsWith("/images") || uri.endsWith(".png") || uri.endsWith(".ico") || uri.endsWith(".css") || uri.endsWith(".svg")|| uri.endsWith(".js") || uri.contains("swagger") || uri.startsWith("/api"))) { Counter counter = Counter.builder("http.requests") .tag("uri", uri) .tag("method", request.getMethod()) diff --git a/src/main/resources/static/android-chrome-192x192.png b/src/main/resources/static/android-chrome-192x192.png new file mode 100644 index 00000000..0c199d03 Binary files /dev/null and b/src/main/resources/static/android-chrome-192x192.png differ diff --git a/src/main/resources/static/android-chrome-512x512.png b/src/main/resources/static/android-chrome-512x512.png new file mode 100644 index 00000000..011e5383 Binary files /dev/null and b/src/main/resources/static/android-chrome-512x512.png differ diff --git a/src/main/resources/static/apple-touch-icon-114x114.png b/src/main/resources/static/apple-touch-icon-114x114.png new file mode 100644 index 00000000..f777fe88 Binary files /dev/null and b/src/main/resources/static/apple-touch-icon-114x114.png differ diff --git a/src/main/resources/static/apple-touch-icon-120x120.png b/src/main/resources/static/apple-touch-icon-120x120.png new file mode 100644 index 00000000..20fa2148 Binary files /dev/null and b/src/main/resources/static/apple-touch-icon-120x120.png differ diff --git a/src/main/resources/static/apple-touch-icon-144x144.png b/src/main/resources/static/apple-touch-icon-144x144.png new file mode 100644 index 00000000..078bbb44 Binary files /dev/null and b/src/main/resources/static/apple-touch-icon-144x144.png differ diff --git a/src/main/resources/static/apple-touch-icon-152x152.png b/src/main/resources/static/apple-touch-icon-152x152.png new file mode 100644 index 00000000..643ac534 Binary files /dev/null and b/src/main/resources/static/apple-touch-icon-152x152.png differ diff --git a/src/main/resources/static/apple-touch-icon-180x180.png b/src/main/resources/static/apple-touch-icon-180x180.png new file mode 100644 index 00000000..debef0d7 Binary files /dev/null and b/src/main/resources/static/apple-touch-icon-180x180.png differ diff --git a/src/main/resources/static/apple-touch-icon-57x57.png b/src/main/resources/static/apple-touch-icon-57x57.png new file mode 100644 index 00000000..b2d881d0 Binary files /dev/null and b/src/main/resources/static/apple-touch-icon-57x57.png differ diff --git a/src/main/resources/static/apple-touch-icon-60x60.png b/src/main/resources/static/apple-touch-icon-60x60.png new file mode 100644 index 00000000..aa7ead3d Binary files /dev/null and b/src/main/resources/static/apple-touch-icon-60x60.png differ diff --git a/src/main/resources/static/apple-touch-icon-72x72.png b/src/main/resources/static/apple-touch-icon-72x72.png new file mode 100644 index 00000000..dd4dd5c3 Binary files /dev/null and b/src/main/resources/static/apple-touch-icon-72x72.png differ diff --git a/src/main/resources/static/apple-touch-icon-76x76.png b/src/main/resources/static/apple-touch-icon-76x76.png new file mode 100644 index 00000000..6c089459 Binary files /dev/null and b/src/main/resources/static/apple-touch-icon-76x76.png differ diff --git a/src/main/resources/static/apple-touch-icon.png b/src/main/resources/static/apple-touch-icon.png new file mode 100644 index 00000000..debef0d7 Binary files /dev/null and b/src/main/resources/static/apple-touch-icon.png differ diff --git a/src/main/resources/static/browserconfig.xml b/src/main/resources/static/browserconfig.xml new file mode 100644 index 00000000..a47e5a5b --- /dev/null +++ b/src/main/resources/static/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #2d89ef + + + diff --git a/src/main/resources/static/favicon-16x16.png b/src/main/resources/static/favicon-16x16.png new file mode 100644 index 00000000..982741bc Binary files /dev/null and b/src/main/resources/static/favicon-16x16.png differ diff --git a/src/main/resources/static/favicon-32x32.png b/src/main/resources/static/favicon-32x32.png new file mode 100644 index 00000000..c1f6a97d Binary files /dev/null and b/src/main/resources/static/favicon-32x32.png differ diff --git a/src/main/resources/static/favicon.ico b/src/main/resources/static/favicon.ico index 64fc4d07..90b100a4 100644 Binary files a/src/main/resources/static/favicon.ico and b/src/main/resources/static/favicon.ico differ diff --git a/src/main/resources/static/manifest.json b/src/main/resources/static/manifest.json new file mode 100644 index 00000000..a02fd87c --- /dev/null +++ b/src/main/resources/static/manifest.json @@ -0,0 +1,20 @@ +{ + "name": "Stirling-PDF", + "short_name": "Stirling-PDF", + "icons": [ + { + "src": "/android-icon-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-icon-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "start_url": "/", + "display": "standalone", + "background_color": "#ffffff", + "theme_color": "#000000" +} diff --git a/src/main/resources/static/mstile-150x150.png b/src/main/resources/static/mstile-150x150.png new file mode 100644 index 00000000..5aaa69ab Binary files /dev/null and b/src/main/resources/static/mstile-150x150.png differ diff --git a/src/main/resources/static/safari-pinned-tab.svg b/src/main/resources/static/safari-pinned-tab.svg new file mode 100644 index 00000000..f5a17f97 --- /dev/null +++ b/src/main/resources/static/safari-pinned-tab.svg @@ -0,0 +1,41 @@ + + + + +Created by potrace 1.14, written by Peter Selinger 2001-2017 + + + + + + + diff --git a/src/main/resources/static/site.webmanifest b/src/main/resources/static/site.webmanifest new file mode 100644 index 00000000..42f8bb0c --- /dev/null +++ b/src/main/resources/static/site.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "Stirling PDF", + "short_name": "Stirling PDF", + "icons": [ + { + "src": "/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} diff --git a/src/main/resources/templates/fragments/common.html b/src/main/resources/templates/fragments/common.html index 42477113..74536458 100644 --- a/src/main/resources/templates/fragments/common.html +++ b/src/main/resources/templates/fragments/common.html @@ -5,6 +5,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/templates/other/show-javascript.html b/src/main/resources/templates/other/show-javascript.html index 4ef2d700..ef9e014e 100644 --- a/src/main/resources/templates/other/show-javascript.html +++ b/src/main/resources/templates/other/show-javascript.html @@ -54,11 +54,22 @@ body: formData }).then(response => response.text()) .then(data => { - // Escape < and > characters + // Escape < and > characters let escapedData = data.replace(//g, '>'); - // Wrap the JavaScript content in a pre and code tag and add it to the div - document.querySelector('#script-content').innerHTML = '
' + escapedData + '
'; + // Create the elements manually + let preElement = document.createElement('pre'); + let codeElement = document.createElement('code'); + codeElement.classList.add('language-javascript'); + codeElement.textContent = escapedData; // Use textContent instead of innerHTML + preElement.appendChild(codeElement); + + let scriptContent = document.querySelector('#script-content'); + // Clear existing content, if any + while (scriptContent.firstChild) { + scriptContent.removeChild(scriptContent.firstChild); + } + scriptContent.appendChild(preElement); // Highlight the code using Prism.js Prism.highlightAll(); diff --git a/src/main/resources/templates/security/get-info-on-pdf.html b/src/main/resources/templates/security/get-info-on-pdf.html index 06cc1052..cf15ec4e 100644 --- a/src/main/resources/templates/security/get-info-on-pdf.html +++ b/src/main/resources/templates/security/get-info-on-pdf.html @@ -35,110 +35,120 @@