mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-29 09:15:33 +00:00
HTMX add
This commit is contained in:
@@ -167,4 +167,8 @@
|
||||
}
|
||||
</div>
|
||||
</feature>
|
||||
<script defer src="/js/filelistform.js" asp-append-version="true"></script>
|
||||
|
||||
<script type="module">
|
||||
import { startup_filelistform } from "/dist/scripts.js";
|
||||
startup_filelistform();
|
||||
</script>
|
||||
|
||||
@@ -199,4 +199,7 @@
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<script defer src="/js/briefe.js" asp-append-version="true"></script>
|
||||
<script type="module">
|
||||
import { startup_briefe } from "/dist/scripts.js";
|
||||
startup_briefe();
|
||||
</script>
|
||||
|
||||
@@ -152,9 +152,11 @@
|
||||
}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var AvailableLetters = new Set(@Html.Raw(Json.Serialize(Model.AvailableLetters)))
|
||||
var AvailablePages = @Html.Raw(Json.Serialize(Model.AvailablePages))
|
||||
<script type="module">
|
||||
import { startup_index } from "/dist/scripts.js";
|
||||
startup_index(
|
||||
new Set(@Html.Raw(Json.Serialize(Model.AvailableLetters))),
|
||||
@Html.Raw(Json.Serialize(Model.AvailablePages))
|
||||
);
|
||||
</script>
|
||||
<script defer src="/js/index.js" asp-append-version="true"></script>
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
: "ha-bibel";
|
||||
}
|
||||
|
||||
<script defer src="/js/search.js" asp-append-version="true"></script>
|
||||
|
||||
<div class="ha-register">
|
||||
<div class="@commentClass">
|
||||
@@ -87,3 +86,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="module">
|
||||
import { startup_search } from "/dist/scripts.js";
|
||||
startup_search();
|
||||
</script>
|
||||
@@ -5,7 +5,6 @@
|
||||
ViewData["showCredits"] = "false";
|
||||
ViewData["Mark"] = Model.ActiveSearch;
|
||||
}
|
||||
<script defer src="/js/search.js" asp-append-version="true"></script>
|
||||
|
||||
<div class="ha-search">
|
||||
<div class="ha-searchhead">
|
||||
@@ -154,4 +153,9 @@
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="module">
|
||||
import { startup_search } from "/dist/scripts.js";
|
||||
startup_search();
|
||||
</script>
|
||||
@@ -20,5 +20,6 @@
|
||||
@await Html.PartialAsync("/Views/Shared/_Notifications.cshtml")
|
||||
</feature>
|
||||
@await RenderSectionAsync("JavaScript", false)
|
||||
@await Html.PartialAsync("/Views/Shared/_Scripts.cshtml")
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -17,5 +17,6 @@
|
||||
</div>
|
||||
@await Html.PartialAsync("/Views/Shared/_ScrollButton.cshtml")
|
||||
@await RenderSectionAsync("JavaScript", false)
|
||||
@await Html.PartialAsync("/Views/Shared/_Scripts.cshtml")
|
||||
</body>
|
||||
</html>
|
||||
@@ -20,25 +20,7 @@
|
||||
@* Styles *@
|
||||
<link rel="stylesheet" href="/dist/style.css" asp-append-version="true" />
|
||||
|
||||
<script type="module">
|
||||
import { startup_clipboard, startup_markanchor, startup_mobilemenu, startup_scrollbutton, startup_marginals, startup_theme, startup_menu } from "/dist/scripts.js";
|
||||
startup_marginals();
|
||||
startup_theme();
|
||||
startup_scrollbutton();
|
||||
startup_menu();
|
||||
startup_mobilemenu();
|
||||
startup_markanchor();
|
||||
startup_clipboard();
|
||||
</script>
|
||||
<script type="module">
|
||||
import "/js/mark.min.js";
|
||||
document.addEventListener("DOMContentLoaded", (event) => {
|
||||
var elements = document.querySelectorAll(".ha-register-body, .ha-searchresultpreview, .ha-commenthead, .ha-entry");
|
||||
if (elements.length < 1000) {
|
||||
var instancesearch = new Mark(elements);
|
||||
instancesearch.mark('@ViewData["Mark"]', { "element": "span", "className": "ha-found", "acrossElements": true, "separateWordSearch": false, "exclude": [".ha-searchresultcommentpill", ".ha-letlink", ".ha-letlinks", ".ha-hkb"] });
|
||||
}
|
||||
var instanceletter = new Mark(document.querySelectorAll(".ha-letterbody"));
|
||||
instanceletter.mark('@ViewData["Mark"]', { "element": "span", "className": "ha-found", "acrossElements": true, "separateWordSearch": false, "exclude": [".ha-searchresultcommentpill", ".ha-letlink", ".ha-letlinks", ".ha-hkb"] });
|
||||
});
|
||||
</script>
|
||||
@* Scripts *@
|
||||
<script src="/js/mark.min.js" asp-append-version="true"></script>
|
||||
<script src="/js/htmx.min.js" asp-append-version="true"></script>
|
||||
<script rel="preload" type="module" src="/dist/scripts.js" asp-append-version="true"></script>
|
||||
@@ -28,5 +28,6 @@
|
||||
</div>
|
||||
@await Html.PartialAsync("/Views/Shared/_ScrollButton.cshtml")
|
||||
@await RenderSectionAsync("JavaScript", false)
|
||||
@await Html.PartialAsync("/Views/Shared/_Scripts.cshtml")
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,24 +0,0 @@
|
||||
|
||||
@* Global Scripts -- These are not inside .cshtml to not loose deferred execution posibility *@
|
||||
<script defer src="/js/marginals.js" asp-append-version="true"></script>
|
||||
<script defer src="/js/theme.js" asp-append-version="true"></script>
|
||||
<script defer src="/js/active.js" asp-append-version="true"></script>
|
||||
<script defer src="/js/anchor.js" asp-append-version="true"></script>
|
||||
<script defer src="/js/mobilemenu.js" asp-append-version="true"></script>
|
||||
<script defer src="/js/scrollbutton.js" asp-append-version="true"></script>
|
||||
<script defer src="/js/clipboard.js" asp-append-version="true"></script>
|
||||
|
||||
<script src="/js/mark.min.js" asp-append-version="true"></script>
|
||||
@* This uses Razor Syntax so it is inlined into this razor file *@
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", (event) => {
|
||||
var elements = document.querySelectorAll(".ha-register-body, .ha-searchresultpreview, .ha-commenthead, .ha-entry");
|
||||
if (elements.length < 1000) {
|
||||
var instancesearch = new Mark(elements);
|
||||
instancesearch.mark('@ViewData["Mark"]', { "element": "span", "className": "ha-found", "acrossElements": true, "separateWordSearch": false, "exclude": [".ha-searchresultcommentpill", ".ha-letlink", ".ha-letlinks", ".ha-hkb"] });
|
||||
}
|
||||
var instanceletter = new Mark(document.querySelectorAll(".ha-letterbody"));
|
||||
instanceletter.mark('@ViewData["Mark"]', { "element": "span", "className": "ha-found", "acrossElements": true, "separateWordSearch": false, "exclude": [".ha-searchresultcommentpill", ".ha-letlink", ".ha-letlinks", ".ha-hkb"] });
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -7,4 +7,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script defer src="/js/websocket.js" asp-append-version="true"></script>
|
||||
|
||||
<script type="module">
|
||||
import { startup_websocket } from "/dist/scripts.js";
|
||||
startup_websocket();
|
||||
</script>
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
@model XMLStateViewModel;
|
||||
<script defer src="/js/publishform.js" asp-append-version="true"></script>
|
||||
|
||||
@* @if (Model. != null && Model..Any()) {
|
||||
<div class="ha-publishfilelisttitle">Aktuell geladene Dateien</div>
|
||||
<table class="ha-publishfilelistlist">
|
||||
@foreach (var (category, files) in Model..OrderBy(x => x.Key))
|
||||
{
|
||||
<tr>
|
||||
<td>@Model.AvailableRoots.Where(x => x.Prefix == category).First().Type:</td>
|
||||
<td>
|
||||
@foreach (var item in files)
|
||||
{
|
||||
if (item != files.Last()) {
|
||||
<span>@item.FileName,</span>
|
||||
}
|
||||
else {
|
||||
<span>@item.FileName</span>
|
||||
}
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
|
||||
<form class="ha-publishform" id="ha-publishform" asp-controller="API" asp-action="LocalPublish" method="post" enctype="multipart/form-data">
|
||||
<label class="ha-publishfilelabel" id="ha-publishfilelabel">
|
||||
<div class="ha-publishtext">Dateien Veröffentlichen</div>
|
||||
<div class="ha-lds-ellipsis-publish" id="ha-lds-ellipsis-publish"><div></div><div></div><div></div><div></div></div>
|
||||
</label>
|
||||
<div class="ha-publishmessage" id="ha-publishmessage">
|
||||
<output form="uploadForm" name="publish-result" id="publish-result"></output>
|
||||
</div>
|
||||
</form>
|
||||
} *@
|
||||
14
HaWeb/Views/Shared/_Scripts.cshtml
Normal file
14
HaWeb/Views/Shared/_Scripts.cshtml
Normal file
@@ -0,0 +1,14 @@
|
||||
<script type="module">
|
||||
import { startup_default } from "/dist/scripts.js"
|
||||
startup_default();
|
||||
</script>
|
||||
|
||||
<script type="module">
|
||||
var elements = document.querySelectorAll(".ha-register-body, .ha-searchresultpreview, .ha-commenthead, .ha-entry");
|
||||
if (elements.length < 1000) {
|
||||
var instancesearch = new Mark(elements);
|
||||
instancesearch.mark('@ViewData["Mark"]', { "element": "span", "className": "ha-found", "acrossElements": true, "separateWordSearch": false, "exclude": [".ha-searchresultcommentpill", ".ha-letlink", ".ha-letlinks", ".ha-hkb"] });
|
||||
}
|
||||
var instanceletter = new Mark(document.querySelectorAll(".ha-letterbody"));
|
||||
instanceletter.mark('@ViewData["Mark"]', { "element": "span", "className": "ha-found", "acrossElements": true, "separateWordSearch": false, "exclude": [".ha-searchresultcommentpill", ".ha-letlink", ".ha-letlinks", ".ha-hkb"] });
|
||||
</script>
|
||||
@@ -1,15 +0,0 @@
|
||||
@model XMLStateViewModel;
|
||||
|
||||
<script defer src="/js/uploadform.js" asp-append-version="true"></script>
|
||||
|
||||
<form class="ha-uploadform" id="uploadForm" asp-controller="API" asp-action="Upload" method="post" enctype="multipart/form-data">
|
||||
<label class="ha-uploadfilelabel" id="dropzone">
|
||||
<input class="hidden" id="file" type="file" accept=".xml" name="file" />
|
||||
<div class="ha-uploadtext">Upload</div>
|
||||
<div class="ha-lds-ellipsis" id="ha-lds-ellipsis-upload"><div></div><div></div><div></div><div></div></div>
|
||||
</label>
|
||||
<div class="ha-uploadmessage" id="ha-uploadmessage">
|
||||
Fehler!<br/>
|
||||
<output form="uploadForm" name="upload-result"></output>
|
||||
</div>
|
||||
</form>
|
||||
@@ -1,2 +0,0 @@
|
||||
rm .\bin\Release\net6.0\linux-x64\publish\appsettings.json
|
||||
scp -r -i C:\Users\simon\.ssh\id_tss .\bin\Release\net6.0\linux-x64\publish\* admin@astra.tss-hd.de:~/publish/
|
||||
@@ -1,9 +1,7 @@
|
||||
module.exports = {
|
||||
plugins: [
|
||||
require('postcss-import'),
|
||||
require('tailwindcss'),
|
||||
// Production:
|
||||
require('autoprefixer'),
|
||||
require('cssnano')({ preset: 'default' })
|
||||
],
|
||||
}
|
||||
|
||||
@@ -35,4 +35,4 @@ const startup_briefe = function () {
|
||||
tabbtnlist[0].click();
|
||||
};
|
||||
|
||||
startup_briefe();
|
||||
export { startup_briefe };
|
||||
@@ -94,7 +94,7 @@ const startup_filelistform = function () {
|
||||
}
|
||||
|
||||
var coll = document.getElementsByClassName("expandable");
|
||||
for (i = 0; i < coll.length; i++) {
|
||||
for (let i = 0; i < coll.length; i++) {
|
||||
let element = coll[i]
|
||||
coll[i].addEventListener("click", () => {
|
||||
element.classList.toggle("expanded");
|
||||
@@ -102,4 +102,4 @@ const startup_filelistform = function () {
|
||||
}
|
||||
};
|
||||
|
||||
startup_filelistform();
|
||||
export { startup_filelistform };
|
||||
@@ -1,8 +1,7 @@
|
||||
const startup_index = function () {
|
||||
|
||||
const startup_index = function (AvailableLetters, AvailablePages) {
|
||||
function encode(e) { return e.replace(/[^]/g, function (e) { return "&#" + e.charCodeAt(0) + ";" }) }
|
||||
|
||||
const ACTIVATEGOTOFILTER = function (filter, button) {
|
||||
const ACTIVATEGOTOFILTER = function (filter, button) {
|
||||
let f = filter.value;
|
||||
let gotoinfo = document.getElementById("ha-gotoinfo");
|
||||
|
||||
@@ -93,4 +92,4 @@ const startup_index = function () {
|
||||
searchfilter.addEventListener("input", () => ACTIVATESEARCHFILTER(searchfilter, searchsubmitbtn));
|
||||
};
|
||||
|
||||
startup_index();
|
||||
export { startup_index };
|
||||
@@ -1,10 +1,39 @@
|
||||
import "../css/site.css";
|
||||
import { startup_marginals } from "./marginals.mjs";
|
||||
import { startup_theme } from "./theme.mjs";
|
||||
import { startup_menu } from "./menu.js";
|
||||
import { startup_menu } from "./menu.mjs";
|
||||
import { startup_markanchor } from "./anchor.mjs";
|
||||
import { startup_mobilemenu } from "./mobilemenu.js";
|
||||
import { startup_mobilemenu } from "./mobilemenu.mjs";
|
||||
import { startup_scrollbutton } from "./scrollbutton.mjs";
|
||||
import { startup_clipboard } from "./clipboard.mjs";
|
||||
import { startup_filelistform } from "./filelistform.mjs";
|
||||
import { startup_index } from "./index.mjs";
|
||||
import { startup_briefe } from "./briefe.mjs";
|
||||
import { startup_websocket } from "./websocket.mjs";
|
||||
import { startup_search } from "./search.mjs";
|
||||
|
||||
export { startup_clipboard, startup_mobilemenu, startup_markanchor, startup_menu, startup_scrollbutton, startup_marginals, startup_theme };
|
||||
const startup_default = function () {
|
||||
startup_marginals();
|
||||
startup_theme();
|
||||
startup_scrollbutton();
|
||||
startup_menu();
|
||||
startup_mobilemenu();
|
||||
startup_markanchor();
|
||||
startup_clipboard();
|
||||
}
|
||||
|
||||
export {
|
||||
startup_search,
|
||||
startup_websocket,
|
||||
startup_briefe,
|
||||
startup_index,
|
||||
startup_filelistform,
|
||||
startup_default,
|
||||
startup_clipboard,
|
||||
startup_mobilemenu,
|
||||
startup_markanchor,
|
||||
startup_menu,
|
||||
startup_scrollbutton,
|
||||
startup_marginals,
|
||||
startup_theme
|
||||
};
|
||||
@@ -1,41 +0,0 @@
|
||||
const startup_publishform = function () {
|
||||
|
||||
const LOCALPUBLISHSubmit = async function (oFormElement) {
|
||||
var fd = new FormData();
|
||||
document.getElementById("ha-publishfilelabel").style.pointerEvents = "none";
|
||||
document.getElementById("ha-lds-ellipsis-publish").style.display = "inline-block";
|
||||
document.getElementById("ha-publishmessage").style.opacity = "0";
|
||||
await fetch(oFormElement.action, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'RequestVerificationToken': getCookie('RequestVerificationToken')
|
||||
}
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(json => {
|
||||
if ("Error" in json) {
|
||||
document.getElementById("ha-publishfilelabel").style.pointerEvents = "auto";
|
||||
document.getElementById("ha-lds-ellipsis-publish").style.display = "none";
|
||||
document.getElementById("ha-publishmessage").style.opacity = "1";
|
||||
document.getElementById("publish-result").value = json.Error;
|
||||
} else {
|
||||
document.getElementById("ha-publishfilelabel").style.pointerEvents = "auto";
|
||||
document.getElementById("ha-lds-ellipsis-publish").style.display = "none";
|
||||
document.getElementById("ha-publishmessage").style.opacity = "1";
|
||||
document.getElementById("publish-result").value = "Erfolg!";
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
document.getElementById("ha-publishfilelabel").style.pointerEvents = "auto";
|
||||
document.getElementById("ha-lds-ellipsis-publish").style.display = "none";
|
||||
document.getElementById("publish-result").value = "Keine Antwort. Bitte Seite neu laden!";
|
||||
})
|
||||
}
|
||||
|
||||
var publishelement = document.getElementById("ha-publishform");
|
||||
var publishbutton = document.getElementById("ha-publishfilelabel");
|
||||
publishbutton.addEventListener("click", () => LOCALPUBLISHSubmit(publishelement));
|
||||
};
|
||||
|
||||
startup_publishform();
|
||||
@@ -16,4 +16,4 @@ const startup_search = function () {
|
||||
searchfilter.addEventListener("input", () => ACTIVATESEARCHFILTER(searchfilter, searchsubmitbtn));
|
||||
}
|
||||
|
||||
startup_search();
|
||||
export { startup_search };
|
||||
@@ -147,4 +147,4 @@ const startup_websocket = function () {
|
||||
}
|
||||
};
|
||||
|
||||
startup_websocket();
|
||||
export { startup_websocket };
|
||||
Reference in New Issue
Block a user