mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-29 01:05:32 +00:00
Added markers. Weird shit is happening when searching for "Win", see Letter 51
This commit is contained in:
@@ -23,7 +23,7 @@ public class Briefecontroller : Controller {
|
||||
|
||||
[Route("/HKB/Briefe")]
|
||||
[Route("/HKB/Briefe/{id?}")]
|
||||
public IActionResult Index(string? id) {
|
||||
public IActionResult Index(string? id, string? search = null) {
|
||||
// Setup settings and variables
|
||||
var lib = _lib.GetLibrary();
|
||||
var url = "/HKB/Briefe/";
|
||||
@@ -50,6 +50,9 @@ public class Briefecontroller : Controller {
|
||||
ViewData["Title"] = "Brief " + id.ToLower();
|
||||
ViewData["SEODescription"] = "Johann Georg Hamann: Kommentierte Briefausgabe. Brief " + id.ToLower();
|
||||
ViewData["Filename"] = "HKB_" + meta.Autopsic + ".pdf";
|
||||
if (!string.IsNullOrWhiteSpace(search)) {
|
||||
ViewData["Mark"] = "search";
|
||||
}
|
||||
|
||||
// Model creation
|
||||
var hasMarginals = false;
|
||||
|
||||
@@ -114,6 +114,7 @@ public class RegisterController : Controller {
|
||||
var title = "Forschungsbibliographie";
|
||||
ViewData["Title"] = "Forschungsbibliographie";
|
||||
ViewData["SEODescription"] = "Johann Georg Hamann: Kommentierte Briefausgabe. Forschungsbibliographie.";
|
||||
ViewData["Mark"] = "He";
|
||||
|
||||
// Normalisation and Validation
|
||||
if (String.IsNullOrWhiteSpace(id)) return Redirect(url + defaultLetter);
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
let pg = page.value;
|
||||
window.location.href = "/HKB/" + vol + "/" + pg;
|
||||
}
|
||||
|
||||
|
||||
window.addEventListener("load", () => {
|
||||
let vol = document.getElementById("ha-zhformvolume");
|
||||
let pg = document.getElementById("ha-zhformpage");
|
||||
@@ -147,8 +147,9 @@
|
||||
<div class="ha-filtertitle">
|
||||
Volltextsuche
|
||||
</div>
|
||||
<form class="ha-searchform" id="ha-searchform" asp-controller="Suche" asp-action="Briefe" method="get">
|
||||
<form class="ha-searchform" id="ha-searchform" asp-controller="Suche" asp-action="Briefe" asp-route-comments="true" method="get">
|
||||
<input id="ha-searchformtext" name="search" type="text" placeholder="Suchbegriff"/>
|
||||
<input type="hidden" name="comments" value="true"/>
|
||||
<button id="ha-searchformsubmit" type="submit">Suchen</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
ViewData["Title"] = "Briefauswahl & Suche";
|
||||
ViewData["SEODescription"] = "Johann Georg Hamann: Kommentierte Briefausgabe, Hg. v. Leonard Keidel und Janina Reibold. Durchsuchbare Online-Ausgabe der Briefe von und an Johann Georg Hamann.";
|
||||
ViewData["showCredits"] = "false";
|
||||
ViewData["Mark"] = Model.ActiveSearch;
|
||||
}
|
||||
|
||||
<div class="ha-search">
|
||||
@@ -110,12 +111,12 @@
|
||||
{
|
||||
<div class="ha-letterlistsearchresult">
|
||||
<div class="ha-searchresultlocation">
|
||||
<a asp-controller="Briefe" asp-action="Index" asp-route-id="@letter.Meta.Autopsic" asp-fragment="@sr.Page-@sr.Line">
|
||||
<a asp-controller="Briefe" asp-action="Index" asp-route-id="@letter.Meta.Autopsic" asp-route-search="@Model.ActiveSearch" asp-fragment="@sr.Page-@sr.Line">
|
||||
HKB @sr.Page/@sr.Line
|
||||
</a>
|
||||
</div>
|
||||
<div class="ha-searchresultpreview">
|
||||
<a asp-controller="Briefe" asp-action="Index" asp-route-id="@letter.Meta.Autopsic" asp-fragment="@sr.Page-@sr.Line">
|
||||
<a asp-controller="Briefe" asp-action="Index" asp-route-id="@letter.Meta.Autopsic" asp-route-search="@Model.ActiveSearch" asp-fragment="@sr.Page-@sr.Line">
|
||||
@sr.Preview
|
||||
</a>
|
||||
@if (Model.Marginals != null && Model.Marginals.Any()) {
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
<feature name="AdminService">
|
||||
<span> · <a asp-controller="Admin" asp-action="Index">Admin-Bereich</a></span>
|
||||
</feature>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@await Html.PartialAsync("/Views/Shared/_Javascript.cshtml")
|
||||
@@ -18,9 +18,4 @@
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/output.css" asp-append-version="true" />
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
|
||||
|
||||
<environment exclude="Development">
|
||||
@await Html.PartialAsync("/Views/Shared/_Javascript.cshtml")
|
||||
</environment>
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
@@ -1,6 +1,35 @@
|
||||
@* Javascript gets inlined because it ain't much (but it's honest work) *@
|
||||
@* Only put PRODUCTION JavaScript here *@
|
||||
|
||||
@* Mark searched term *@
|
||||
@if(ViewData.ContainsKey("Mark")) {
|
||||
<script src="~/js/mark.min.js" asp-append-version="true"></script>
|
||||
<script>
|
||||
var instance = new Mark(document.querySelectorAll(".ha-register-body, .ha-letterbody *, .ha-searchresultpreview, .ha-comment"));
|
||||
instance.mark('@ViewData["Mark"]', { "element": "span", "className": "ha-found", "acrossElements": true, "separateWordSearch": false, "exclude": [".ha-searchresultcommentpill", ".ha-letlink", ".ha-letlinks", ".ha-hkb"]});
|
||||
|
||||
</script>
|
||||
}
|
||||
<script>
|
||||
function markanchor() {
|
||||
var currentUrl = document.URL,
|
||||
urlParts = currentUrl.split('#');
|
||||
var anchor = (urlParts.length > 1) ? urlParts[1] : null;
|
||||
if (anchor != null) {
|
||||
var element = document.getElementById(anchor);
|
||||
if (element !== null && element.classList.contains("ha-linecount") && element.firstChild.classList.contains("ha-hiddenlinecount")) {
|
||||
element.classList.add("ha-found");
|
||||
element.classList.add("font-bold");
|
||||
element.classList.add("mr-3");
|
||||
element.prepend("● ");
|
||||
} else if (element !== null && element.classList.contains("ha-commenthead")) {
|
||||
element.classList.add("ha-found");
|
||||
element.classList.add("font-bold");
|
||||
element.prepend("● ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
window.addEventListener("load", function () {
|
||||
markanchor();
|
||||
});
|
||||
</script>
|
||||
@@ -37,7 +37,7 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (Model.Letter.Meta.isProofread != HaDocument.Models.OptionalBool.True) {
|
||||
@* @if (Model.Letter.Meta.isProofread != HaDocument.Models.OptionalBool.True) {
|
||||
<div class="ha-tooltip">
|
||||
<div class="ha-pill">
|
||||
<span class="ha-cross">geprüft</span>
|
||||
@@ -56,7 +56,7 @@
|
||||
Textkritisch geprüft
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
} *@
|
||||
|
||||
@if (Model.Letter.Meta.ZH != null && Model.Letter.Meta.ZH.dateChanged) {
|
||||
<div class="ha-tooltip">
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -57,6 +57,10 @@
|
||||
@apply !hidden
|
||||
}
|
||||
|
||||
.ha-found {
|
||||
@apply !text-hamannSlate-300
|
||||
}
|
||||
|
||||
.ha-zhbreak {
|
||||
@apply hidden sm:inline
|
||||
}
|
||||
|
||||
7
HaWeb/wwwroot/js/mark.min.js
vendored
Normal file
7
HaWeb/wwwroot/js/mark.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user