- Commentboxes work (marginals) + mouseover

- Basic Briefe Controller
- Generic XML reader
This commit is contained in:
schnulller
2022-05-19 01:09:49 +02:00
parent f1743fcf39
commit 2ed7265869
23 changed files with 1179 additions and 193 deletions

View File

@@ -0,0 +1,2 @@
@model BriefeViewModel;

View File

@@ -11,12 +11,12 @@
Dr. Gregor Babelotzky (seit 2019)<br/>
Konrad Bucher (seit 2019)<br/>
Christian Großmann (20182019)<br/>
Carl Friedrich Haak (20132018)<br/>
Carl Friedrich Haak (20142018)<br/>
Leonard Keidel (seit 2018)<br/>
Luca Klopfer (seit 2016)<br/>
Johannes Knüchel (20162020)<br/>
Isabel Langkabel (20132019)<br/>
Simon Martens (20132018)<br/>
Isabel Langkabel (20142019)<br/>
Simon Martens (20142018)<br/>
Dr. Janina Reibold (Leitung seit 2013)
<h3>Technische Umsetzung</h3>

View File

@@ -1,5 +1,4 @@
@model RegisterViewModel;
@using System.Diagnostics;
@* Generated classes by CommentHelper.cs:
- .ha-letlink .ha-wwwlink .ha-reflink: Links to letters, the web, the reference
@@ -9,7 +8,14 @@
- .ha-commenthead: Class containing the head of a comment, lemma and backlinks
- .ha-commentbody: Body of a comment, containing the comments text
- .ha-letlinks: Collection of references in the comment within the marginals
- .ha-hkb: HKB that is in front of those links
- .ha-insertedlemma: automatically generated and inserted lemma
Generated classes by JavaScript:
- .ha-collapsed-box, .ha-expanded-box: for an expanded or collapsed comment box
- .ha-open-btn-collapsed-box, ha-close-btn-collapsed-box: for open- & close buttons for the boxes
- .ha-btn-collapsed-box: for the button itself
- .ha-collapsed-box-manually-toggled: for a manually (not on mousehover) toggled button
*@
@{

View File

@@ -0,0 +1,101 @@
@* Javascript gets inlined because it ain't much (but it's honest work) *@
@* Only put PRODUCTION JavaScript here *@
<script>
const openmenu = function () {
var x = document.getElementById("ha-topnav");
if (x !== null) x.className += " ha-topnav-collapsed";
let oldbutton = document.getElementById("openmenubutton");
if (oldbutton !== null) oldbutton.setAttribute('class', 'hidden');
let newbutton = document.getElementById("closemenubutton");
if (newbutton !== null) newbutton.setAttribute('class', '');
}
const closemenu = function () {
var x = document.getElementById("ha-topnav");
if (x !== null) x.className = "ha-topnav";
let oldbutton = document.getElementById("closemenubutton");
if (oldbutton !== null) oldbutton.setAttribute('class', 'hidden');
let newbutton = document.getElementById("openmenubutton");
if (newbutton !== null) newbutton.setAttribute('class', '');
}
const markactive_startswith = function (element) {
// Marks links as active which target URL starts with the current URL
var all_links = element.getElementsByTagName("a"),
i = 0, len = all_links.length,
full_path = location.href.split('#')[0].toLowerCase(); //Ignore hashes
for (; i < len; i++) {
if (full_path.startsWith(all_links[i].href.toLowerCase())) {
all_links[i].className += " active";
}
}
}
const markactive_exact = function (element) {
var all_links = element.getElementsByTagName("a"),
i = 0, len = all_links.length,
full_path = location.href.split('#')[0].toLowerCase(); //Ignore hashes
for (; i < len; i++) {
if (full_path == all_links[i].href.toLowerCase()) {
all_links[i].className += " active";
}
}
}
const getLineHeight = function (element) {
var temp = document.createElement(element.nodeName), ret;
temp.setAttribute("class", element.className);
temp.innerHTML = "A";
element.parentNode.appendChild(temp);
ret = temp.clientHeight;
temp.parentNode.removeChild(temp);
return ret;
}
/* TODO: need a resize watcher to undo and reapply the effect on breakpoint */
const overlappingboxcollapse = function (selector) {
let boxes = document.querySelectorAll(selector);
let clientrects = [];
let lineheight = 1;
if (boxes.length >= 1) {
lineheight = getLineHeight(boxes[0]);
}
for (element of boxes) {
clientrects.push([element, element.getBoundingClientRect()]);
}
for (var i = 0; i < clientrects.length; i++) {
if (i < clientrects.length-1) {
if (clientrects[i][1].bottom >= clientrects[i+1][1].top) {
let overlap = clientrects[i][1].bottom - clientrects[i+1][1].top;
let newlength = clientrects[i][1].height - overlap;
let remainder = newlength % lineheight;
newlength = newlength - remainder;
clientrects[i][0].style.height = newlength + 'px';
clientrects[i][0].style.overflowX = "hidden";
clientrects[i][0].style.overflowY = "scroll";
}
}
}
}
window.addEventListener('load', function() {
document.getElementById("openmenubutton").addEventListener('click', openmenu);
document.getElementById("closemenubutton").addEventListener('click', closemenu);
markactive_startswith(document.getElementById("ha-topnav"));
markactive_exact(document.getElementById("ha-register-nav"));
overlappingboxcollapse(".ha-neuzeit .ha-letlinks");
overlappingboxcollapse(".ha-forschung .ha-letlinks");
})
</script>

View File

@@ -9,12 +9,22 @@
<title>HKB: @ViewData["Title"]</title>
<!-- crossorigin is a workaround to prevent double downloading bugs in chrome -->
<link rel="preload" href="/css/output.css" as="style" />
<!-- also, the graphite versions of the font are available for use:
<link rel="preload" href="/fonts/LinLibertine_R_G.ttf" as="font" crossorigin/>
<link rel="preload" href="/fonts/LinBiolinum_R_G.ttf" as="font" crossorigin/>
-->
<link rel="preload" href="/css/output.css" as="style" asp-append-version="true"/>
<link rel="preload" href="/img/subtlenet2.png" as="image" />
<link rel="preload" href="/fonts/LinBiolinum_R_G.ttf" as="font" crossorigin/>
<link rel="preload" href="/fonts/LinLibertine_R_G.ttf" as="font" crossorigin/>
<link rel="preload" href="/fonts/LinBiolinum_R.woff" as="font" crossorigin/>
<link rel="preload" href="/fonts/LinLibertine_R.woff" as="font" crossorigin/>
<link rel="preload" href="/fonts/LinLibertine_RI.woff" as="font" crossorigin/>
<link rel="preload" href="/fonts/LinLibertine_RB.woff" as="font" crossorigin/>
<link rel="stylesheet" href="/css/output.css" />
<link rel="stylesheet" href="/css/output.css" asp-append-version="true" />
<environment include="Development">
<script src="~/js/site.js" asp-append-version="true"></script>
</environment>
</head>
@@ -24,11 +34,12 @@
<main role="main" class="pb-3 w-full desktop:max-w-screen-desktop mx-auto">
@RenderBody()
</main>
<script src="~/js/site.js" asp-append-version="true"></script>
@await RenderSectionAsync("Scripts", required: false)
@await Html.PartialAsync("/Views/Shared/_Footer.cshtml")
<environment exclude="Development">
@await Html.PartialAsync("/Views/Shared/_Javascript.cshtml")
</environment>
</body>
</html>

View File

@@ -1,3 +1,4 @@
@using HaWeb
@using HaWeb.Models
@using HaWeb.Settings
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers