diff --git a/app/helpers/breadcrumbs.mts b/app/helpers/breadcrumbs.mts index 3580bdc4..f2586fea 100644 --- a/app/helpers/breadcrumbs.mts +++ b/app/helpers/breadcrumbs.mts @@ -1,4 +1,4 @@ export interface Breadcrumb { - title: string; - url: string; -} + title: string; + url: string; +} \ No newline at end of file diff --git a/app/page/glob-slash.mts b/app/page/glob-slash.mts index 6491d648..ac29d935 100644 --- a/app/page/glob-slash.mts +++ b/app/page/glob-slash.mts @@ -5,4 +5,4 @@ import path from 'path'; export const normalize = (value: string) => path.posix.normalize(path.posix.join('/', value));; -export default (value: string) => (value.charAt(0) === '!' ? `!${normalize(value.substr(1))}` : normalize(value)); +export default (value: string) => (value.charAt(0) === '!' ? `!${normalize(value.substr(1))}` : normalize(value)); \ No newline at end of file diff --git a/app/search/solr-doc.mts b/app/search/solr-doc.mts index 7c10e40a..f7f4de23 100644 --- a/app/search/solr-doc.mts +++ b/app/search/solr-doc.mts @@ -2,24 +2,24 @@ * Needed until the conversion is completed. */ export interface IncorrectStyleSolrDocument { - id: string; - sha256sum: string[]; - url: string[]; - content_length: number[]; - content_type: string[]; - text: string[]; - _version_?: number; + id: string; + sha256sum: string[]; + url: string[]; + content_length: number[]; + content_type: string[]; + text: string[]; + _version_?: number; } /** * Describes Solr full-text search properties for a document file in the public repository. */ export interface SolrDocument { - id: string; - sha256sum: string; - url: string; - content_length: number; - content_type: string; - text: string; - _version_?: number; + id: string; + sha256sum: string; + url: string; + content_length: number; + content_type: string; + text: string; + _version_?: number; } diff --git a/app/server.mts b/app/server.mts index 782ac3db..b90eaccf 100644 --- a/app/server.mts +++ b/app/server.mts @@ -38,5 +38,5 @@ app.listen(config.appHttpPort, () => { console.log(`To access your app, you can use the 127.0.0.1 host, http://127.0.0.1:${config.appHttpPort}.`); console.log(`To access your app, you can use the ::1 host, http://[::1]:${config.appHttpPort}.`); console.log(`To access your app, you might can use the app host name, ${config.appHttpUrl}.`); - console.log(`This app is configured to use the web site URL, ${config.siteUrl}.`); -}); + console.log(`This app is configured to use the web site URL for URL generation, as needed, ${config.siteUrl}. Certain site features won't work correctly unless this is on a publicly accessible URL.`); +}); \ No newline at end of file diff --git a/app/tika/client.mts b/app/tika/client.mts index 378d722d..80305f55 100644 --- a/app/tika/client.mts +++ b/app/tika/client.mts @@ -1,11 +1,11 @@ import { ReadStream } from 'fs' import fetch from 'node-fetch' let join = (...args: String[]) => { - let output = ""; - args.forEach((arg) => { - output += arg; - }) - return output; + let output = ""; + args.forEach((arg) => { + output += arg; + }) + return output; }; import { ContentResource, MetadataResource } from './types.mjs' import { Writable } from 'stream'; diff --git a/app/tika/types.mts b/app/tika/types.mts index 1ad11bb8..2b3ce2d4 100644 --- a/app/tika/types.mts +++ b/app/tika/types.mts @@ -1,81 +1,81 @@ export interface MetadataResource { - 'pdf:unmappedUnicodeCharsPerPage': string[] - 'pdf:PDFVersion': string - 'xmp:CreatorTool': string - 'pdf:hasXFA': string - 'access_permission:modify_annotations': string - 'access_permission:can_print_degraded': string - 'X-TIKA:Parsed-By-Full-Set': string[] - 'pdf:num3DAnnotations': string - 'dcterms:created': string - 'language': string - 'dcterms:modified': string - 'dc:format': string - 'pdf:docinfo:creator_tool': string - 'pdf:overallPercentageUnmappedUnicodeChars': string - 'access_permission:fill_in_form': string - 'pdf:docinfo:modified': string - 'pdf:hasCollection': string - 'pdf:encrypted': string - 'pdf:containsNonEmbeddedFont': string - 'Content-Length': string - 'pdf:hasMarkedContent': string - 'Content-Type': string - 'pdf:producer': string - 'pdf:totalUnmappedUnicodeChars': string - 'access_permission:extract_for_accessibility': string - 'access_permission:assemble_document': string - 'xmpTPg:NPages': string - 'pdf:hasXMP': string - 'pdf:charsPerPage': string[] - 'access_permission:extract_content': string - 'access_permission:can_print': string - 'X-TIKA:Parsed-By': string[] - 'pdf:annotationTypes': string - 'access_permission:can_modify': string - 'pdf:docinfo:producer': string - 'pdf:docinfo:created': string - 'pdf:annotationSubtypes': string - 'pdf:containsDamagedFont': string - } - - export interface ContentResource { - 'pdf:unmappedUnicodeCharsPerPage': string[] - 'pdf:PDFVersion': string - 'xmp:CreatorTool': string - 'pdf:hasXFA': string - 'access_permission:modify_annotations': string - 'access_permission:can_print_degraded': string - 'X-TIKA:Parsed-By-Full-Set': string[] - 'pdf:num3DAnnotations': string - 'dcterms:created': string - 'dcterms:modified': string - 'dc:format': string - 'pdf:docinfo:creator_tool': string - 'pdf:overallPercentageUnmappedUnicodeChars': string - 'access_permission:fill_in_form': string - 'pdf:docinfo:modified': string - 'pdf:hasCollection': string - 'pdf:encrypted': string - 'pdf:containsNonEmbeddedFont': string - 'Content-Length': string - 'pdf:hasMarkedContent': string - 'Content-Type': string - 'pdf:producer': string - 'pdf:totalUnmappedUnicodeChars': string - 'access_permission:extract_for_accessibility': string - 'access_permission:assemble_document': string - 'xmpTPg:NPages': string - 'pdf:hasXMP': string - 'pdf:charsPerPage': string[] - 'access_permission:extract_content': string - 'access_permission:can_print': string - 'X-TIKA:Parsed-By': string[] - 'X-TIKA:content': string - 'pdf:annotationTypes': string - 'access_permission:can_modify': string - 'pdf:docinfo:producer': string - 'pdf:docinfo:created': string - 'pdf:annotationSubtypes': string - 'pdf:containsDamagedFont': string - } \ No newline at end of file + 'pdf:unmappedUnicodeCharsPerPage': string[] + 'pdf:PDFVersion': string + 'xmp:CreatorTool': string + 'pdf:hasXFA': string + 'access_permission:modify_annotations': string + 'access_permission:can_print_degraded': string + 'X-TIKA:Parsed-By-Full-Set': string[] + 'pdf:num3DAnnotations': string + 'dcterms:created': string + 'language': string + 'dcterms:modified': string + 'dc:format': string + 'pdf:docinfo:creator_tool': string + 'pdf:overallPercentageUnmappedUnicodeChars': string + 'access_permission:fill_in_form': string + 'pdf:docinfo:modified': string + 'pdf:hasCollection': string + 'pdf:encrypted': string + 'pdf:containsNonEmbeddedFont': string + 'Content-Length': string + 'pdf:hasMarkedContent': string + 'Content-Type': string + 'pdf:producer': string + 'pdf:totalUnmappedUnicodeChars': string + 'access_permission:extract_for_accessibility': string + 'access_permission:assemble_document': string + 'xmpTPg:NPages': string + 'pdf:hasXMP': string + 'pdf:charsPerPage': string[] + 'access_permission:extract_content': string + 'access_permission:can_print': string + 'X-TIKA:Parsed-By': string[] + 'pdf:annotationTypes': string + 'access_permission:can_modify': string + 'pdf:docinfo:producer': string + 'pdf:docinfo:created': string + 'pdf:annotationSubtypes': string + 'pdf:containsDamagedFont': string +} + +export interface ContentResource { + 'pdf:unmappedUnicodeCharsPerPage': string[] + 'pdf:PDFVersion': string + 'xmp:CreatorTool': string + 'pdf:hasXFA': string + 'access_permission:modify_annotations': string + 'access_permission:can_print_degraded': string + 'X-TIKA:Parsed-By-Full-Set': string[] + 'pdf:num3DAnnotations': string + 'dcterms:created': string + 'dcterms:modified': string + 'dc:format': string + 'pdf:docinfo:creator_tool': string + 'pdf:overallPercentageUnmappedUnicodeChars': string + 'access_permission:fill_in_form': string + 'pdf:docinfo:modified': string + 'pdf:hasCollection': string + 'pdf:encrypted': string + 'pdf:containsNonEmbeddedFont': string + 'Content-Length': string + 'pdf:hasMarkedContent': string + 'Content-Type': string + 'pdf:producer': string + 'pdf:totalUnmappedUnicodeChars': string + 'access_permission:extract_for_accessibility': string + 'access_permission:assemble_document': string + 'xmpTPg:NPages': string + 'pdf:hasXMP': string + 'pdf:charsPerPage': string[] + 'access_permission:extract_content': string + 'access_permission:can_print': string + 'X-TIKA:Parsed-By': string[] + 'X-TIKA:content': string + 'pdf:annotationTypes': string + 'access_permission:can_modify': string + 'pdf:docinfo:producer': string + 'pdf:docinfo:created': string + 'pdf:annotationSubtypes': string + 'pdf:containsDamagedFont': string +} \ No newline at end of file diff --git a/app/views/error.ejs b/app/views/error.ejs index 91181817..4b9af003 100644 --- a/app/views/error.ejs +++ b/app/views/error.ejs @@ -1,122 +1,105 @@ - - + - - - + +
-
- <% if (typeof statusCode !== 'undefined') { %><%= statusCode %><% } %> -

<% if (typeof message !== 'undefined') { %><%= message %><% } %>

-
+
+ <% if (typeof statusCode !== 'undefined') { %><%= statusCode %><% } %> +

<% if (typeof message !== 'undefined') { %><%= message %><% } %>

+
- - - + + \ No newline at end of file diff --git a/app/views/includes/bottom-navbar.ejs b/app/views/includes/bottom-navbar.ejs index 5d2df91c..ae233c08 100644 --- a/app/views/includes/bottom-navbar.ejs +++ b/app/views/includes/bottom-navbar.ejs @@ -9,4 +9,4 @@ Your use of this search feature constitutes your agreement with the Search Policy.

- + \ No newline at end of file diff --git a/app/views/includes/breadcrumbs.ejs b/app/views/includes/breadcrumbs.ejs index 06e8165d..267d8d2a 100644 --- a/app/views/includes/breadcrumbs.ejs +++ b/app/views/includes/breadcrumbs.ejs @@ -9,4 +9,4 @@ <%=breadcrumb.title%> <% } %> <% }) %> - + \ No newline at end of file diff --git a/app/views/includes/no-trash-svg.ejs b/app/views/includes/no-trash-svg.ejs index 8a32995e..e333a91d 100644 --- a/app/views/includes/no-trash-svg.ejs +++ b/app/views/includes/no-trash-svg.ejs @@ -1,18 +1,18 @@ \ No newline at end of file diff --git a/app/views/includes/top-navbar.ejs b/app/views/includes/top-navbar.ejs index e2430a77..fcba03bd 100644 --- a/app/views/includes/top-navbar.ejs +++ b/app/views/includes/top-navbar.ejs @@ -13,4 +13,4 @@ - + \ No newline at end of file diff --git a/app/views/page.ejs b/app/views/page.ejs index be4d05d1..6fc892a9 100644 --- a/app/views/page.ejs +++ b/app/views/page.ejs @@ -4,18 +4,13 @@ <%= (typeof fm.title !== 'undefined') ? `${fm.title} - ${h.getSiteName()}` : h.getSiteName() %> <%- include('./includes/common-head.ejs') %> - - <%- include('./includes/top-navbar.ejs') %> - <%- include('./includes/no-trash-svg.ejs') %> -
<%- include('./includes/breadcrumbs.ejs') %>
- <% if (typeof content !== 'undefined') {%>
@@ -29,7 +24,6 @@
<% } %> -
- <%- include('./includes/bottom-navbar.ejs') %> <%- include('./includes/bottom-scripts.ejs') %> diff --git a/app/views/search-error.ejs b/app/views/search-error.ejs index 54adcd00..89578bcd 100644 --- a/app/views/search-error.ejs +++ b/app/views/search-error.ejs @@ -1,35 +1,34 @@ - - Search Error for <%- query %> - <%- h.getSiteName() %> - <%- include('./includes/common-head.ejs') %> - - - <%- include('./includes/top-navbar.ejs') %> - <%- include('./includes/no-trash-svg.ejs') %> -
-
- <%- include('./includes/breadcrumbs.ejs') %> -
-
-

- Disclaimer: Use of the search feature is subject to both the Search - Policy and the Privacy Policy. -

-
-
- <% if (typeof error !== 'undefined') {%> -

An error occurred while attempting to perform a search.

- <% if (typeof query !== 'undefined') {%>

Search Query: <%= query %>

<% } %> - <% if (typeof error.code !== 'undefined') {%>

Error Code: <%= error.code %>

<% } %> - <% if (typeof error.message !== 'undefined') {%>

Error Message: <%= error.message %>

<% } %> - <% if (typeof error.innerError !== 'undefined' && typeof error.innerError.error !== 'undefined') { %> - <% if (typeof error.innerError.error.msg !== 'undefined') {%>

Inner Error Message: <%- error.innerError.error.msg.replaceAll("<", "<").replaceAll(">", ">").replaceAll("\n", '
') %>

<% } %> + + Search Error for <%- query %> - <%- h.getSiteName() %> + <%- include('./includes/common-head.ejs') %> + + + <%- include('./includes/top-navbar.ejs') %> + <%- include('./includes/no-trash-svg.ejs') %> +
+
+ <%- include('./includes/breadcrumbs.ejs') %> +
+
+

+ Disclaimer: Use of the search feature is subject to both the Search + Policy and the Privacy Policy. +

+
+
+ <% if (typeof error !== 'undefined') {%> +

An error occurred while attempting to perform a search.

+ <% if (typeof query !== 'undefined') {%>

Search Query: <%= query %>

<% } %> + <% if (typeof error.code !== 'undefined') {%>

Error Code: <%= error.code %>

<% } %> + <% if (typeof error.message !== 'undefined') {%>

Error Message: <%= error.message %>

<% } %> + <% if (typeof error.innerError !== 'undefined' && typeof error.innerError.error !== 'undefined') { %> + <% if (typeof error.innerError.error.msg !== 'undefined') {%>

Inner Error Message: <%- error.innerError.error.msg.replaceAll("<", "<").replaceAll(">", ">").replaceAll("\n", '
') %>

<% } %> + <% } %> <% } %> - <% } %> -
- - <%- include('./includes/bottom-navbar.ejs') %> - <%- include('./includes/bottom-scripts.ejs') %> - - +
+ <%- include('./includes/bottom-navbar.ejs') %> + <%- include('./includes/bottom-scripts.ejs') %> + + \ No newline at end of file diff --git a/app/views/search-results.ejs b/app/views/search-results.ejs index 0ac46ae9..f3cad141 100644 --- a/app/views/search-results.ejs +++ b/app/views/search-results.ejs @@ -1,73 +1,72 @@ - - Search Results for <%- query %> - <%- h.getSiteName() %> - <%- include('./includes/common-head.ejs') %> - - - <%- include('./includes/top-navbar.ejs') %> - <%- include('./includes/no-trash-svg.ejs') %> -
-
- <%- include('./includes/breadcrumbs.ejs') %> -
-
-

- Disclaimer: Use of the search feature is subject to both the Search - Policy and the Privacy Policy. -

-
- <% if (typeof response !== "undefined" && typeof response.numFound !== "undefined" && typeof response.docs !== "undefined" && typeof highlighting !== "undefined") { %> -
- - <% if (response.numFound == 0) { %> -

No documents found matching the search query.

- <% } else { %> -
    - <% response.docs.forEach(doc => { %> -
  • -
    <%= doc.title %>
    - <% if (highlighting[doc.id] && highlighting[doc.id].text) { %> - <% highlighting[doc.id].text.forEach(snippet => { %> -
    <%- h.stripWebVTT(snippet) %>
    - <% }); %> - <% } else { %> - - <% } %> - <%= doc.url %> -
  • - <% }); %> -
- <% } %> -
+ + Search Results for <%- query %> - <%- h.getSiteName() %> + <%- include('./includes/common-head.ejs') %> + + + <%- include('./includes/top-navbar.ejs') %> + <%- include('./includes/no-trash-svg.ejs') %> +
+
+ <%- include('./includes/breadcrumbs.ejs') %> +
+
+

+ Disclaimer: Use of the search feature is subject to both the Search + Policy and the Privacy Policy. +

- <% } %> - - <% if (typeof totalPages !== "undefined" && totalPages) { %> - -

Page <%= page %> out of <%= totalPages %>. Displaying results <%= (page-1)*pageSize+1 %> through <%= Math.min(page*pageSize, totalResults) %> out of <%= totalResults %> total results.

- <% } %> -
- - <%- include('./includes/bottom-navbar.ejs') %> - <%- include('./includes/bottom-scripts.ejs') %> - - + <% if (typeof response !== "undefined" && typeof response.numFound !== "undefined" && typeof response.docs !== "undefined" && typeof highlighting !== "undefined") { %> +
+ + <% if (response.numFound == 0) { %> +

No documents found matching the search query.

+ <% } else { %> +
    + <% response.docs.forEach(doc => { %> +
  • +
    <%= doc.title %>
    + <% if (highlighting[doc.id] && highlighting[doc.id].text) { %> + <% highlighting[doc.id].text.forEach(snippet => { %> +
    <%- h.stripWebVTT(snippet) %>
    + <% }); %> + <% } else { %> + + <% } %> + <%= doc.url %> +
  • + <% }); %> +
+ <% } %> +
+ + <% } %> + + <% if (typeof totalPages !== "undefined" && totalPages) { %> + +

Page <%= page %> out of <%= totalPages %>. Displaying results <%= (page-1)*pageSize+1 %> through <%= Math.min(page*pageSize, totalResults) %> out of <%= totalResults %> total results.

+ <% } %> +
+ <%- include('./includes/bottom-navbar.ejs') %> + <%- include('./includes/bottom-scripts.ejs') %> + + \ No newline at end of file diff --git a/app/views/video-player.ejs b/app/views/video-player.ejs index fb47e710..1e87e13c 100644 --- a/app/views/video-player.ejs +++ b/app/views/video-player.ejs @@ -4,17 +4,13 @@ <%=h.getDirectoryTitle(directory)%> <%- include('./includes/common-head.ejs') %> - - <%- include('./includes/top-navbar.ejs') %> <%- include('./includes/no-trash-svg.ejs') %> -
<%- include('./includes/breadcrumbs.ejs') %>
- <% if (typeof videoURL !== 'undefined') {%>
@@ -49,7 +45,6 @@
<% } %> - <% if (typeof subtitleVTT !== 'undefined') {%>
@@ -65,9 +60,7 @@
<% } %> -
- <%- include('./includes/bottom-navbar.ejs') %> <%- include('./includes/bottom-scripts.ejs') %>