This commit is contained in:
Simon Martens
2024-01-25 18:20:18 +01:00
parent 065246acdc
commit 050784025c
25 changed files with 93 additions and 163 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>
} *@

View 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>

View File

@@ -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>