parent
dc32052517
commit
bdf2150dfd
@ -1,83 +1,115 @@ |
||||
window.addEventListener('scroll', function(e) { |
||||
if (document.querySelector('body').clientWidth > 767) { |
||||
let rightcolumn = document.querySelector('.rightcolumn'); |
||||
let mantletitle = document.querySelector('.mantletitle') || document.querySelector('.crusttitle') || false; |
||||
if (!mantletitle) { |
||||
return |
||||
} |
||||
let mantlebar = document.querySelector('.mantlebar') |
||||
let grid = document.querySelector('.grid') |
||||
let gridrect = mantletitle.getBoundingClientRect(); |
||||
window.addEventListener("scroll", function (e) { |
||||
if (document.querySelector("body").clientWidth > 767) { |
||||
let rightcolumn = document.querySelector(".rightcolumn"); |
||||
let mantletitle = |
||||
document.querySelector(".mantletitle") || |
||||
document.querySelector(".crusttitle") || |
||||
false; |
||||
if (!mantletitle) { |
||||
return; |
||||
} |
||||
let mantlebar = document.querySelector(".mantlebar"); |
||||
let grid = document.querySelector(".grid"); |
||||
let gridrect = mantletitle.getBoundingClientRect(); |
||||
|
||||
if ((document.querySelector('body').clientHeight - (grid.clientHeight + mantletitle.clientHeight + 32)) < window.innerHeight) { |
||||
return |
||||
} |
||||
|
||||
if (gridrect.top < 20 && !grid.classList.contains('moved')) { |
||||
grid.classList.add('moved'); |
||||
mantlebar.style.display = "inline"; |
||||
mantletitle.style.visibility = "hidden"; |
||||
} else if (gridrect.top > 21 && grid.classList.contains('moved')) { |
||||
grid.classList.remove('moved'); |
||||
mantletitle.style.visibility = "visible"; |
||||
mantlebar.style.display = "none"; |
||||
} |
||||
} else { |
||||
let rightcolumn = document.querySelector('.rightcolumn'); |
||||
let mantletitle = document.querySelector('.mantletitle') || document.querySelector('.crusttitle') || false; |
||||
if (!mantletitle) { |
||||
return |
||||
} |
||||
let mantlebar = document.querySelector('.mantlebar') |
||||
let grid = document.querySelector('.grid') |
||||
let gridrect = mantletitle.getBoundingClientRect(); |
||||
if ( |
||||
document.querySelector("body").clientHeight - |
||||
(grid.clientHeight + mantletitle.clientHeight + 32) < |
||||
window.innerHeight |
||||
) { |
||||
return; |
||||
} |
||||
|
||||
if (gridrect.top < 20 && !grid.classList.contains('moved')) { |
||||
grid.classList.add('moved'); |
||||
mantlebar.style.display = "inline"; |
||||
mantletitle.style.visibility = "hidden"; |
||||
} else if (gridrect.top > 21 && grid.classList.contains('moved')) { |
||||
grid.classList.remove('moved'); |
||||
mantletitle.style.visibility = "visible"; |
||||
mantlebar.style.display = "none"; |
||||
} |
||||
if (gridrect.top < 20 && !grid.classList.contains("moved")) { |
||||
grid.classList.add("moved"); |
||||
mantlebar.style.display = "inline"; |
||||
mantletitle.style.visibility = "hidden"; |
||||
} else if (gridrect.top > 21 && grid.classList.contains("moved")) { |
||||
grid.classList.remove("moved"); |
||||
mantletitle.style.visibility = "visible"; |
||||
mantlebar.style.display = "none"; |
||||
} |
||||
}) |
||||
} else { |
||||
let rightcolumn = document.querySelector(".rightcolumn"); |
||||
let mantletitle = |
||||
document.querySelector(".mantletitle") || |
||||
document.querySelector(".crusttitle") || |
||||
false; |
||||
if (!mantletitle) { |
||||
return; |
||||
} |
||||
let mantlebar = document.querySelector(".mantlebar"); |
||||
let grid = document.querySelector(".grid"); |
||||
let gridrect = mantletitle.getBoundingClientRect(); |
||||
|
||||
window.addEventListener('DOMContentLoaded', (e) => { |
||||
let par = document.querySelector("#TableOfContents > ol:first-child > li:first-child"); |
||||
let s = document.createElement("span"); |
||||
s.appendChild(par.cloneNode(true)) |
||||
par.remove() |
||||
document.querySelector("#TableOfContents > ol:first-child").insertBefore(s, document.querySelector("#TableOfContents > ol:first-child").firstChild) |
||||
if (gridrect.top < 20 && !grid.classList.contains("moved")) { |
||||
grid.classList.add("moved"); |
||||
mantlebar.style.display = "inline"; |
||||
mantletitle.style.visibility = "hidden"; |
||||
} else if (gridrect.top > 21 && grid.classList.contains("moved")) { |
||||
grid.classList.remove("moved"); |
||||
mantletitle.style.visibility = "visible"; |
||||
mantlebar.style.display = "none"; |
||||
} |
||||
} |
||||
}); |
||||
|
||||
if (document.querySelector(".soundcite")) { |
||||
let relPath ="../".repeat(relPathDepth - 1); |
||||
window.addEventListener("DOMContentLoaded", (e) => { |
||||
let preview = document.querySelector("#preview"); |
||||
if ( |
||||
location.pathname.split("/").includes("_preview") || |
||||
location.hash.startsWith("#/_edit") |
||||
) { |
||||
preview.style.display = "flex"; |
||||
} |
||||
|
||||
var popcorn = document.createElement('script'); |
||||
popcorn.src = `${relPath}js/popcorn.min.js`; |
||||
document.body.appendChild(popcorn); |
||||
let par = document.querySelector( |
||||
"#TableOfContents > ol:first-child > li:first-child" |
||||
); |
||||
let s = document.createElement("span"); |
||||
s.appendChild(par.cloneNode(true)); |
||||
par.remove(); |
||||
document |
||||
.querySelector("#TableOfContents > ol:first-child") |
||||
.insertBefore( |
||||
s, |
||||
document.querySelector("#TableOfContents > ol:first-child").firstChild |
||||
); |
||||
|
||||
var soundcite = document.createElement('script'); |
||||
soundcite.src = `${relPath}js/soundcite.min.js`; |
||||
document.body.appendChild(soundcite); |
||||
if (document.querySelector(".soundcite")) { |
||||
let relPath = "../".repeat(relPathDepth - 1); |
||||
|
||||
} |
||||
var popcorn = document.createElement("script"); |
||||
popcorn.src = `${relPath}js/popcorn.min.js`; |
||||
document.body.appendChild(popcorn); |
||||
|
||||
var soundcite = document.createElement("script"); |
||||
soundcite.src = `${relPath}js/soundcite.min.js`; |
||||
document.body.appendChild(soundcite); |
||||
} |
||||
|
||||
document.querySelectorAll('#TableOfContents a, .anchorz, .footnote-backref, .footnote-ref').forEach(i => { |
||||
i.addEventListener('click', e => { |
||||
setTimeout(() => { |
||||
window.scrollBy({top: document.querySelector('.header').clientHeight * -1.25, behavior: 'smooth'})}, 50); |
||||
}) |
||||
}) |
||||
}) |
||||
document |
||||
.querySelectorAll( |
||||
"#TableOfContents a, .anchorz, .footnote-backref, .footnote-ref" |
||||
) |
||||
.forEach((i) => { |
||||
i.addEventListener("click", (e) => { |
||||
setTimeout(() => { |
||||
window.scrollBy({ |
||||
top: document.querySelector(".header").clientHeight * -1.25, |
||||
behavior: "smooth", |
||||
}); |
||||
}, 50); |
||||
}); |
||||
}); |
||||
}); |
||||
|
||||
toggleAllLinks = function () { |
||||
document.querySelectorAll('details').forEach(i => { |
||||
if (i.open) { |
||||
i.removeAttribute('open'); |
||||
} else { |
||||
i.setAttribute('open', true); |
||||
} |
||||
}) |
||||
} |
||||
document.querySelectorAll("details").forEach((i) => { |
||||
if (i.open) { |
||||
i.removeAttribute("open"); |
||||
} else { |
||||
i.setAttribute("open", true); |
||||
} |
||||
}); |
||||
}; |
||||
|
@ -0,0 +1,50 @@ |
||||
{{- $text_link := .Text -}} |
||||
|
||||
{{ $_ := newScratch }} |
||||
{{- range $k, $v := .Page.Site.Data.sandpointsnamegraph -}} |
||||
{{ $_.Add "triads" $k }} |
||||
{{- end -}} |
||||
|
||||
{{- if strings.HasPrefix .Destination "bib:" -}} |
||||
{{- $destination := (substr .Destination 4) -}} |
||||
{{- $c_prefix := .Page.Site.Params.sandpointsCatalogPrefix | default "/library/" -}} |
||||
{{- if index $.Page.Site.Data.books.catalog $destination -}} |
||||
{{- $b := index $.Page.Site.Data.books.catalog $destination -}} |
||||
{{- $bibhref := printf "%sBROWSE_LIBRARY.html#/book/%s" (safeURL ($c_prefix)) $destination }} |
||||
{{ $bibtitle := "" }} |
||||
{{ with $b.title }} |
||||
{{- $bibtitle = printf "%s" $b.title }} |
||||
{{ end }} |
||||
{{ .Page.Scratch.Add "bibs" (slice (slice $bibhref $bibtitle)) }} |
||||
{{- if not $text_link -}} |
||||
<span>{{- delimit $b.authors ", " " & " -}}{{- with $b.pubdate -}}, {{- substr . 0 4}}{{- end -}}.<a href="{{- $c_prefix | safeURL -}}BROWSE_LIBRARY.html#/book/{{- $destination -}}"{{- with $b.title}} title="{{- . -}}"{{- end -}} target="_blank"><span class="sup">bib⁄</span>‘{{- $b.title -}}’</a>. {{- with $b.publisher -}}{{- . -}}.{{- end -}}</span> |
||||
{{- else -}} |
||||
<a href="{{- $c_prefix | safeURL -}}BROWSE_LIBRARY.html#/book/{{- $destination -}}"{{- with $b.title}} title="{{- . -}}"{{- end -}} target="_blank">{{- $text_link -}}</a> |
||||
{{- end -}} |
||||
{{- else -}} |
||||
<a href="{{- $c_prefix | safeURL -}}BROWSE_LIBRARY.html#/book/{{- $destination -}}"{{- with .Title}} title="{{- . -}}"{{- end -}}>{{- $text_link -}}⦚<span class="text-xs font-bold p-1 bg-AuChico text-CoconutCream">bib:{{- $destination -}} not found</span></a> |
||||
{{- end -}} |
||||
{{- else if in ($_.Get "triads") (index (split .Destination ":") 0) -}} |
||||
{{- if $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}} |
||||
{{- $session := $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}} |
||||
{{ .Page.Scratch.Add "links" (slice $session) }} |
||||
{{- if not $text_link -}} |
||||
<a href="{{- $session.RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with $session.Title}} title="{{- $session.Title -}}"{{- end -}}><span class="sup">{{- index (split .Destination ":") 0 -}}⁄</span>{{- $session.Title -}}</a> |
||||
{{- else -}} |
||||
<a href="{{- $session.RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with .Title}} title="{{- . -}}"{{- end -}}><span class="sup">{{- index (split .Destination ":") 0 -}}⁄</span>{{- $text_link -}}</a> |
||||
{{- end -}} |
||||
{{- else -}} |
||||
<a href="{{- .Destination -}}/{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}">{{- $text_link -}}⦚<span>{{- .Destination -}} not found</span></a> |
||||
{{- end -}} |
||||
{{- else if strings.HasPrefix .Destination "audio:" -}} |
||||
{{- $a_destination := (substr .Destination 6) -}} |
||||
{{- if findRE "^.*static" $a_destination -}} |
||||
<span class="soundcite" data-url="{{- (replaceRE "^.*static" "" $a_destination ) | safeURL -}}">{{ .Text }}</span> |
||||
{{- else -}} |
||||
<span class="soundcite" data-url="{{- $a_destination | safeURL -}}">{{ .Text }}</span> |
||||
{{- end -}} |
||||
{{- else if findRE "^.*static" .Destination -}} |
||||
<img src="{{- (replaceRE "^.*static" "" .Destination ) | safeURL -}}" alt="{{- .Text -}}" {{- with .Title}} title="{{- . -}}"{{- end -}} /> |
||||
{{- else -}} |
||||
<img src="{{- .Destination | safeURL -}}" alt="{{- .Text -}}" {{- with .Title}} title="{{- . -}}"{{- end -}} /> |
||||
{{- end -}} |
@ -0,0 +1 @@ |
||||
{{- .Page.Scratch.Add "urls" (slice .Destination) -}}{{- $t := .Text -}}{{- $sup := "" -}}{{- if and (strings.HasPrefix .Destination "{") (.Destination | strings.Count "}") -}}{{- range first 1 (split .Destination "}") -}}{{- range $frmt := (split (substr . 1) ",") -}}{{- if eq $frmt "sc" -}}<span class="smallcaps">{{- $t -}}</span>{{- end -}}{{- end -}}{{- end -}}{{- else }}{{- if strings.HasPrefix .Destination "http" -}}{{- $sup = "www" -}}{{- end -}}{{- if strings.HasPrefix .Destination "#" -}}{{- $sup = "§" -}}{{- end -}}<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ else if strings.HasPrefix .Destination "#"}}class="anchorz"{{ end }}><span class="sup" style="font-size:0.7em">{{- $sup -}}⁄</span>{{ .Text | safeHTML }}</a>{{- end -}} |
File diff suppressed because one or more lines are too long
4
_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/header.html
generated
vendored
4
_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/header.html
generated
vendored
File diff suppressed because one or more lines are too long
@ -1 +1 @@ |
||||
# git.sandpoints.org/Drawwell/SandpointsTheme v0.0.0-20201218140110-4732c15fd7b6 |
||||
# git.sandpoints.org/Drawwell/SandpointsTheme v0.0.0-20201223111022-78f8dbb9b607 |
||||
|
Loading…
Reference in new issue