Fixed little things

This commit is contained in:
Simon Martens
2022-11-11 18:10:45 +01:00
parent 7247640b0e
commit 3eaa97390d
7 changed files with 34 additions and 18 deletions

View File

@@ -51,7 +51,7 @@ public class Briefecontroller : Controller {
ViewData["SEODescription"] = "Johann Georg Hamann: Kommentierte Briefausgabe. Brief " + id.ToLower(); ViewData["SEODescription"] = "Johann Georg Hamann: Kommentierte Briefausgabe. Brief " + id.ToLower();
ViewData["Filename"] = "HKB_" + meta.Autopsic + ".pdf"; ViewData["Filename"] = "HKB_" + meta.Autopsic + ".pdf";
if (!string.IsNullOrWhiteSpace(search)) { if (!string.IsNullOrWhiteSpace(search)) {
ViewData["Mark"] = "search"; ViewData["Mark"] = search;
} }
// Model creation // Model creation

View File

@@ -40,13 +40,15 @@ public class SearchRules {
} }
sb.Remove(0, sb.Length - sw.Length); sb.Remove(0, sb.Length - sw.Length);
} }
} else { }
if (t.ToUpperInvariant().Contains(sw)) { // Enable, if zou want unparsed context tto be conidered when searching.
if (reader.State.Results == null) // else {
reader.State.Results = new List<(string Page, string Line, string Identifier)>(); // if (t.ToUpperInvariant().Contains(sw)) {
reader.State.Results.Add((reader.CurrentPage, reader.CurrentLine, reader.State.CurrentIdentifier)); // if (reader.State.Results == null)
} // reader.State.Results = new List<(string Page, string Line, string Identifier)>();
} // reader.State.Results.Add((reader.CurrentPage, reader.CurrentLine, reader.State.CurrentIdentifier));
// }
// }
} }
}) })
}; };

View File

@@ -154,4 +154,12 @@
</div> </div>
} }
</div> </div>
</div> </div>
@* <script src="~/js/mark.min.js" asp-append-version="true"></script>
<script>
var instance = new Mark(document.querySelectorAll(".ha-letterbody"));
instance.mark('l', { "element": "span", "className": "ha-found", "acrossElements": true, "separateWordSearch": false, "exclude": [".ha-searchresultcommentpill", ".ha-letlink", ".ha-letlinks", ".ha-hkb"]});
</script> *@

View File

@@ -4,9 +4,10 @@
@if(ViewData.ContainsKey("Mark")) { @if(ViewData.ContainsKey("Mark")) {
<script src="~/js/mark.min.js" asp-append-version="true"></script> <script src="~/js/mark.min.js" asp-append-version="true"></script>
<script> <script>
var instance = new Mark(document.querySelectorAll(".ha-register-body, .ha-letterbody *, .ha-searchresultpreview, .ha-comment")); var instancesearch = new Mark(document.querySelectorAll(".ha-register-body, .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"]}); 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, "debug": true, "separateWordSearch": false, "exclude": [".ha-searchresultcommentpill", ".ha-letlink", ".ha-letlinks", ".ha-hkb"]});
</script> </script>
} }
<script> <script>
@@ -16,13 +17,13 @@
var anchor = (urlParts.length > 1) ? urlParts[1] : null; var anchor = (urlParts.length > 1) ? urlParts[1] : null;
if (anchor != null) { if (anchor != null) {
var element = document.getElementById(anchor); var element = document.getElementById(anchor);
if (element !== null && element.classList.contains("ha-linecount") && element.firstChild.classList.contains("ha-hiddenlinecount")) { if (element !== null && element.classList.contains("ha-linecount")) {
element.classList.add("ha-found"); element.classList.add("ha-location");
element.classList.add("font-bold"); element.classList.add("font-bold");
element.classList.add("mr-3"); element.classList.add("mr-3");
element.prepend("● "); element.prepend("● ");
} else if (element !== null && element.classList.contains("ha-commenthead")) { } else if (element !== null && element.classList.contains("ha-commenthead")) {
element.classList.add("ha-found"); element.classList.add("ha-location");
element.classList.add("font-bold"); element.classList.add("font-bold");
element.prepend("● "); element.prepend("● ");
} }

View File

@@ -261,7 +261,7 @@
} }
.ha-linecount { .ha-linecount {
@apply sm:absolute sm:right-full sm:mr-2 sm:text-right text-xs sm:mt-1 font-sans select-none @apply sm:absolute sm:right-full sm:mr-2 sm:text-right text-xs sm:mt-1 font-sans select-none whitespace-nowrap
} }
.ha-linecount .ha-zhline { .ha-linecount .ha-zhline {

File diff suppressed because one or more lines are too long

View File

@@ -58,9 +58,14 @@
} }
.ha-found { .ha-found {
@apply !text-hamannSlate-300 @apply !text-hamannHighlight
} }
.ha-location {
@apply !text-hamannHighlight
}
.ha-zhbreak { .ha-zhbreak {
@apply hidden sm:inline @apply hidden sm:inline
} }