Compare commits

...

2 Commits
main ... main

5 changed files with 32 additions and 12 deletions

View File

@ -187,6 +187,9 @@ import dotenv from 'dotenv';
import dotenvExpand from 'dotenv-expand';
import process from 'process';
import { fileURLToPath } from 'url';
export const trimSlashes = (dirPath: string) => {
return dirPath.replace(/^[\/\\]|[\/\\]$/g, '');
};
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
@ -212,7 +215,7 @@ export const getAppHttpUrl = () => {
export const getSiteName = () => env.SITE_NAME||"(dev) No Moss 3 Carbo Landfill Online Localhost";
export const getSiteWelcomeMessage = () => env.SITE_WELCOME_MESSAGE||"Devel' It Up, Developer!";
export const getSiteHost = () => env.SITE_HOST||"localhost";
export const getSiteUrl = () => env.SITE_URL||getAppHttpUrl();
export const getSiteUrl = () => trimSlashes(env.SITE_URL||getAppHttpUrl());
// Note the difference: PUBLIC_PATH is expected to be one level above the project folder and PAGES_PATH, STATIC_PATH, and VIEWS_PATH are all copied from src/ to dist/.
export const getPublicPath = () => path.join(__dirname, '..', '..', (env.PUBLIC_PATH||path.join('..', 'nm3clol-public')).replaceAll('\\', path.sep).replaceAll('/', path.sep));
@ -223,16 +226,16 @@ export const getViewsPath = () => path.join(__dirname, '..', '..', 'dist', 'view
export const getSolrDocsHost = () => env.SOLR_DOCS_HOST||'solr';
export const getSolrDocsPort = () => parseInt(env.SOLR_DOCS_PORT||'8983');
export const getSolrDocsCore = () => env.SOLR_DOCS_CORE||'nm3clol_core';
export const getSolrDocsUrl = () => env.SOLR_DOCS_URL||`http://${getSolrDocsHost()}:${getSolrDocsPort()}/solr/${getSolrDocsCore()}`;
export const getSolrDocsUrl = () => trimSlashes(env.SOLR_DOCS_URL||`http://${getSolrDocsHost()}:${getSolrDocsPort()}/solr/${getSolrDocsCore()}`);
export const getSolrLawHost = () => env.SOLR_LAW_HOST||getSolrDocsHost();
export const getSolrLawPort = () => env.SOLR_LAW_PORT ? parseInt(env.SOLR_LAW_PORT) : getSolrDocsPort();
export const getSolrLawCore = () => env.SOLR_LAW_CORE||'vacode_core';
export const getSolrLawUrl = () => env.SOLR_LAW_URL||`http://${getSolrLawHost()}:${getSolrLawPort()}/solr/${getSolrLawCore()}`;
export const getSolrLawUrl = () => trimSlashes(env.SOLR_LAW_URL||`http://${getSolrLawHost()}:${getSolrLawPort()}/solr/${getSolrLawCore()}`);
export const getTikaHost = () => env.TIKA_HOST||'tika';
export const getTikaPort = () => parseInt(env.TIKA_PORT||'9998');
export const getTikaUrl = () => env.TIKA_URL||`http://${getTikaHost()}:${getTikaPort()}`;
export const getTikaUrl = () => trimSlashes(env.TIKA_URL||`http://${getTikaHost()}:${getTikaPort()}`);
export const config: Config = {
appHttpHost: getAppHttpHost(),

View File

@ -49,7 +49,7 @@
<div class="tab-content">
<% if (h.isMsOfficeViewerSupported(h.readmeFm(directory).file)) { %>
<div class="tab-pane<%=h.defaultViewerForFile(h.readmeFm(directory).file) == 'ms-office-viewer' ? ' active' : ''%>" id="ms-office-viewer" role="tabpanel" aria-labelledby="ms-office-viewer-tab" tabindex="0">
<iframe src="<%=h.defaultViewerForFile(h.readmeFm(directory).file) == 'ms-office-viewer' ? `https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(h.trimSlashes(config.siteUrl) + path.posix.join(breadcrumbs[breadcrumbs.length-1].url, (h.readmeFm(directory).file.replaceAll('\\', '/'))))}` : 'about:blank'%>" style="width: 100%; height: 85vh; border: solid 1px #dfd7ca; border-top: 0px; border-bottom-left-radius: 0.25rem; border-bottom-right-radius: 0.25rem;" frameborder="0"></iframe>
<iframe class="resizable" src="<%=h.defaultViewerForFile(h.readmeFm(directory).file) == 'ms-office-viewer' ? `https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(h.trimSlashes(config.siteUrl) + path.posix.join(breadcrumbs[breadcrumbs.length-1].url, (h.readmeFm(directory).file.replaceAll('\\', '/'))))}` : 'about:blank'%>" style="min-width: 80%; width: 100%; max-width: 100%; min-height: 50vh; height: 82vh; max-height: 90vh; border: solid 1px #dfd7ca; border-top: 0px; border-bottom-left-radius: 0.25rem; border-bottom-right-radius: 0.25rem; resize: both;" frameborder="0" allowfullscreen></iframe>
</div>
<% if (h.defaultViewerForFile(h.readmeFm(directory).file) != 'ms-office-viewer') { %>
<script>
@ -70,7 +70,7 @@
<% } %>
<% if (h.isGoogleDocsViewerSupported(h.readmeFm(directory).file)) { %>
<div class="tab-pane<%=h.defaultViewerForFile(h.readmeFm(directory).file) == 'google-docs-viewer' ? ' active' : ''%>" id="google-docs-viewer" role="tabpanel" aria-labelledby="google-docs-viewer-tab" tabindex="0">
<iframe src="<%=h.defaultViewerForFile(h.readmeFm(directory).file) == 'google-docs-viewer' ? `https://docs.google.com/gview?embedded=true&url=${encodeURIComponent(h.trimSlashes(config.siteUrl) + path.posix.join(breadcrumbs[breadcrumbs.length-1].url, (h.readmeFm(directory).file.replaceAll('\\', '/'))))}` : 'about:blank'%>" style="width: 100%; height: 85vh; border: solid 1px #dfd7ca; border-top: 0px; border-bottom-left-radius: 0.25rem; border-bottom-right-radius: 0.25rem;" frameborder="0"></iframe>
<iframe class="resizable" src="<%=h.defaultViewerForFile(h.readmeFm(directory).file) == 'google-docs-viewer' ? `https://docs.google.com/gview?embedded=true&url=${encodeURIComponent(h.trimSlashes(config.siteUrl) + path.posix.join(breadcrumbs[breadcrumbs.length-1].url, (h.readmeFm(directory).file.replaceAll('\\', '/'))))}` : 'about:blank'%>" style="min-width: 80%; width: 100%; max-width: 100%; min-height: 50vh; height: 82vh; max-height: 90vh; border: solid 1px #dfd7ca; border-top: 0px; border-bottom-left-radius: 0.25rem; border-bottom-right-radius: 0.25rem; resize: both;" frameborder="0" allowfullscreen></iframe>
</div>
<% if (h.defaultViewerForFile(h.readmeFm(directory).file) != 'google-docs-viewer') { %>
<script>
@ -90,7 +90,7 @@
<% } %>
<% } %>
<div class="tab-pane<%=(h.defaultViewerForFile(h.readmeFm(directory).file) == 'built-in') ? ' active' : ''%>" id="view-download" role="tabpanel" aria-labelledby="view-download-tab" tabindex="0">
<iframe src="<%=(h.defaultViewerForFile(h.readmeFm(directory).file) == 'built-in') ? encodeURI(h.readmeFm(directory).file) : 'about:blank'%>" style="width: 100%; height: 85vh; border: solid 1px #dfd7ca; border-top: 0px; border-bottom-left-radius: 0.25rem; border-bottom-right-radius: 0.25rem;" frameborder="0"></iframe>
<iframe class="resizable" src="<%=(h.defaultViewerForFile(h.readmeFm(directory).file) == 'built-in') ? encodeURI(h.readmeFm(directory).file) : 'about:blank'%>" style="min-width: 80%; width: 100%; max-width: 100%; min-height: 50vh; height: 82vh; max-height: 90vh; border: solid 1px #dfd7ca; border-top: 0px; border-bottom-left-radius: 0.25rem; border-bottom-right-radius: 0.25rem; resize: both;" frameborder="0" allowfullscreen></iframe>
</div>
<% if (h.defaultViewerForFile(h.readmeFm(directory).file) != 'built-in') { %>
<script>
@ -109,7 +109,7 @@
</script>
<% } %>
<div class="tab-pane" id="ocr-scan" role="tabpanel" aria-labelledby="ocr-scan-tab" tabindex="0">
<div style="overflow-y: scroll; width: 100%; height: 85vh; min-height: 85vh; max-height: 85vh; border: solid 1px #dfd7ca; border-top: 0px; border-bottom-left-radius: 0.25rem; border-bottom-right-radius: 0.25rem;">
<div class="resizable" style="overflow-y: scroll; width: 100%; min-width: 80%; max-width: 100%; height: 85vh; min-height: 50vh; max-height: 100vh; border: solid 1px #dfd7ca; border-top: 0px; border-bottom-left-radius: 0.25rem; border-bottom-right-radius: 0.25rem; resize: both;">
<div class="col-lg-12 p-3 p-lg-5 pt-lg-3">
<h2 class="title">OCR Scan (approximately)</h1>
<p>

View File

@ -2,4 +2,16 @@
<script src="https://daball.me/vendor/popper.js/dist/popper.min.js"></script>
<script src="https://daball.me/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="https://daball.me/vendor/jquery-easing/jquery.easing.min.js"></script>
<script src="https://daball.me/layouts/blog/js/blog.min.js"></script>
<script src="https://daball.me/layouts/blog/js/blog.min.js"></script>
<script>
$(function () {
var resizables = $('.resizable');
resizables.each(function (index, resizable) {
resizable.resizable({
animate: true,
helper: 'ui-resizable-helper',
ghost: true,
});
});
})
</script>

View File

@ -11,7 +11,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8937572456576531" crossorigin="anonymous"></script>
<!-- Bootstrap CSS -->
<link href="https://daball.me/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Saira+Extra+Condensed:100,200,300,400,500,600,700,800,900" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Cinzel+Decorative:100,200,300,400,500,600,700,800,900" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Alegreya+SC:100,200,300,400,500,600,700,800,900" rel="stylesheet" />
@ -25,4 +25,7 @@
<link href="https://daball.me/vendor/simple-line-icons/css/simple-line-icons.css" rel="stylesheet" />
<link href="https://daball.me/layouts/blog/css/blog.min.css" rel="stylesheet" />
<link href="/css/nm3clol.css" rel="stylesheet" />
<script src="https://daball.me/vendor/jquery/jquery.min.js"></script>
<link href="https://code.jquery.com/ui/1.13.3/themes/cupertino/jquery-ui.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js" integrity="sha384-BBtl+eGJRgqQAUMxJ7pMwbEyER4l1g+O15P+16Ep7Q9Q+zqX6gSbd85u4mG4QzX+" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/ui/1.13.3/jquery-ui.min.js" integrity="sha256-sw0iNNXmOJbQhYFuC9OF2kOlD5KQKe1y5lfBn4C9Sjg=" crossorigin="anonymous"></script>

View File

@ -320,4 +320,6 @@ tr.write-in td:first-child {
.nmc3clol-navbar-brand { color: #f44336; }
.daball-navbar-brand { color: #000; }
.pt-1500 { padding-top: 150px;}
}
}
.ui-resizable-helper { border: 2px dotted #f44336; }