diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsEditPage/package.json b/_vendor/git.sandpoints.org/Drawwell/SandpointsEditPage/package.json new file mode 100644 index 0000000..48e3d60 --- /dev/null +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsEditPage/package.json @@ -0,0 +1,22 @@ +{ + "name": "svelte-app", + "version": "1.0.0", + "scripts": { + "build": "rollup -c", + "dev": "rollup -c -w", + "start": "sirv public" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^17.0.0", + "@rollup/plugin-node-resolve": "^11.0.0", + "rollup": "^2.3.4", + "rollup-plugin-css-only": "^3.1.0", + "rollup-plugin-livereload": "^2.0.0", + "rollup-plugin-svelte": "^7.0.0", + "rollup-plugin-terser": "^7.0.0", + "svelte": "^3.0.0" + }, + "dependencies": { + "sirv-cli": "^1.0.0" + } +} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsEditPage/public/global.css b/_vendor/git.sandpoints.org/Drawwell/SandpointsEditPage/public/global.css new file mode 100644 index 0000000..52ddc73 --- /dev/null +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsEditPage/public/global.css @@ -0,0 +1,260 @@ +html, body { + position: relative; + width: 100%; + height: 100%; +} + +body { + color: #333; + margin: 0; + padding: 8px; + box-sizing: border-box; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; +} + +a { + color: rgb(0,100,200); + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +a:visited { + color: rgb(0,80,160); +} + +input, button, select, textarea { + font-family: inherit; + font-size: inherit; + -webkit-padding: 0.4em 0; + padding: 0.4em; + margin: 0 0 0.5em 0; + box-sizing: border-box; + border: 1px solid #ccc; + border-radius: 2px; +} + +input:disabled { + color: #ccc; +} + +button { + color: #333; + background-color: #f4f4f463; + outline: none; + padding: 0.1rem 0.1rem; + margin-left: 0.3rem; +} + +button:disabled { + color: #999; +} + +button:disabled:hover { + cursor: default; +} + +button:not(:disabled):active { + background-color: #ddd; +} + +button:focus { + border-color: #666; +} + +button:hover, .newtierbutton:hover { + cursor: pointer; +} +/* custom part */ + +.newtierbutton { + color: #000; + background-color: #dddddd; + padding: 0.2em 0.4em; + grid-column: 2/3; + margin-right: 0.2rem; +} + + +.formgrid { + display: grid; + grid-template-columns: auto 1fr; + grid-gap: 1rem; + margin-top: 1rem; +} + +#sandpoints { + width: 80%; + margin-left: 1rem; + margin-top: 1rem; +} + +label, .filepath { + grid-column: 1/2; + text-transform: capitalize; + align-self: center +} + +.labelcontent { + align-self: auto; +} + +.labeloffline { + margin-top: -0.4rem; +} + +input[readonly] { + color: #000000b3; + background: #00000012; + border: 0px; +} + +input, button, textarea, .selecttier, .relpath { + grid-column: 2/3; +} + +textarea { + height: 10rem; +} + +.hasinput { + line-height: 0.2rem; + border: 0px; + padding: 0px; + margin: 0px; + font-weight: bold; +} + +.hasinput:focus { + outline: none; +} + +.tierline { + display: flex; + align-items: baseline; +} + +.tiertitle { + font-style: italic; +} + +.buttons { + display: flex; + margin-left: auto; + padding-left: 0.2rem; +} + +select { + align-self: start; + border: 0; + padding: 0.1rem; +} + +.selecttier { + margin-top: 0.5rem; +} + +.buttons button { + border: solid #999 1px; + padding: 0; + padding-left: 0.1rem; + padding-right: 0.1rem; + margin: 1px; +} + +.filepath { + font-size: large; + font-style: italic; + margin-bottom: 1rem; +} + +.relpath { + font-size: large; + font-weight: bold; +} + +.tierbox, #selecthas { + margin-top: 0.5rem; +} + +.fmHidden { + display: none; +} + +.fmShown { + display: block; +} + +.fmMetaTitle { + margin-bottom: 0.3rem; + text-transform: capitalize; + display: block; + text-align: right; + font-size: smaller; + padding-top: 0.2rem; +} + +.fmMeta { + border-bottom: 2px #0000001a solid; + border-right: 1px #0000001a solid; + padding-bottom: 1rem; + margin-bottom: 0.5rem; + background: #ffffff1c; + padding-right: 0.2rem; +} + +.fmItem { + display: grid; + grid-template-columns: auto 1fr; + grid-gap: 1rem; +} + +.fmCollapse, .fmExpand { + padding-top: 0.2rem; + margin-top: 0.5rem; + padding-bottom: 0.5rem; +} + +.fmExpand:hover, .fmCollapse:hover { + cursor: pointer; +} + +.fmCollapse::before { + margin-right: 0.3rem; + content: "⇲"; +} + +.fmExpand::before { + margin-right: 0.3rem; + content: "⇱"; +} + +#fmicon, #frontmatter, input.hasinput { + background-color: #ffccbc; + padding-right: 0.3rem; + padding-left: 0.3rem; + padding-bottom: 0.3rem; +} + +.newtiers { + display: none; +} + +#newtierstitle { + margin-right: 0.4rem; + display: block; +} + +.newtiersbar { + padding-bottom: 0.4rem; + padding-top: 0.4rem; + margin-left: auto; + display: flex; + border-bottom: 2px #0000001a solid; + border-right: 1px #0000001a solid; + justify-content: flex-end; + align-items: center; + background: #00000008; +} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsEditPage/public/index.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsEditPage/public/index.html new file mode 100644 index 0000000..fead626 --- /dev/null +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsEditPage/public/index.html @@ -0,0 +1,16 @@ + + + + + + + Sandpoints Edit Page + + + + + + + + + diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/css/postcss.config.js b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/css/postcss.config.js index 3a62dc9..5096b80 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/css/postcss.config.js +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/css/postcss.config.js @@ -5,9 +5,9 @@ module.exports = { require('postcss-import')({ path: [themeDir] }), - require('autoprefixer')({ - grid: true - }), - require('postcss-reporter'), + /* require('autoprefixer')({ + * grid: true + * }), + * require('postcss-reporter'), */ ] } diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/css/site.css b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/css/site.css index cfc4cd0..e2ea2b2 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/css/site.css +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/css/site.css @@ -90,18 +90,18 @@ th:not([align]) { src: url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.eot"); /* IE9 Compat Modes */ src: local(""), - url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.eot?#iefix") - format("embedded-opentype"), - /* IE6-IE8 */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff2") - format("woff2"), - /* Super Modern Browsers */ - url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff") format("woff"), - /* Modern Browsers */ - url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.ttf") - format("truetype"), - /* Safari, Android, iOS */ - url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.svg#VollkornSC") - format("svg"); + url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.eot?#iefix") + format("embedded-opentype"), + /* IE6-IE8 */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff2") + format("woff2"), + /* Super Modern Browsers */ + url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff") format("woff"), + /* Modern Browsers */ + url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.ttf") + format("truetype"), + /* Safari, Android, iOS */ + url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.svg#VollkornSC") + format("svg"); /* Legacy iOS */ } @@ -114,17 +114,17 @@ th:not([align]) { src: url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.eot"); /* IE9 Compat Modes */ src: local(""), - url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.eot?#iefix") - format("embedded-opentype"), - /* IE6-IE8 */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.woff2") - format("woff2"), - /* Super Modern Browsers */ - url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.woff") format("woff"), - /* Modern Browsers */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.ttf") - format("truetype"), - /* Safari, Android, iOS */ - url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.svg#VollkornSC") - format("svg"); + url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.eot?#iefix") + format("embedded-opentype"), + /* IE6-IE8 */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.woff2") + format("woff2"), + /* Super Modern Browsers */ + url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.woff") format("woff"), + /* Modern Browsers */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.ttf") + format("truetype"), + /* Safari, Android, iOS */ + url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.svg#VollkornSC") + format("svg"); /* Legacy iOS */ } @@ -137,17 +137,17 @@ th:not([align]) { src: url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.eot"); /* IE9 Compat Modes */ src: local(""), - url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.eot?#iefix") - format("embedded-opentype"), - /* IE6-IE8 */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.woff2") - format("woff2"), - /* Super Modern Browsers */ - url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.woff") format("woff"), - /* Modern Browsers */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.ttf") - format("truetype"), - /* Safari, Android, iOS */ - url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.svg#VollkornSC") - format("svg"); + url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.eot?#iefix") + format("embedded-opentype"), + /* IE6-IE8 */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.woff2") + format("woff2"), + /* Super Modern Browsers */ + url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.woff") format("woff"), + /* Modern Browsers */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.ttf") + format("truetype"), + /* Safari, Android, iOS */ + url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.svg#VollkornSC") + format("svg"); /* Legacy iOS */ } @@ -160,17 +160,17 @@ th:not([align]) { src: url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.eot"); /* IE9 Compat Modes */ src: local(""), - url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.eot?#iefix") - format("embedded-opentype"), - /* IE6-IE8 */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.woff2") - format("woff2"), - /* Super Modern Browsers */ - url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.woff") format("woff"), - /* Modern Browsers */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.ttf") - format("truetype"), - /* Safari, Android, iOS */ - url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.svg#VollkornSC") - format("svg"); + url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.eot?#iefix") + format("embedded-opentype"), + /* IE6-IE8 */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.woff2") + format("woff2"), + /* Super Modern Browsers */ + url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.woff") format("woff"), + /* Modern Browsers */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.ttf") + format("truetype"), + /* Safari, Android, iOS */ + url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.svg#VollkornSC") + format("svg"); /* Legacy iOS */ } @@ -183,18 +183,18 @@ th:not([align]) { src: url("../fonts/vollkorn-v12-latin-ext_latin-500italic.eot"); /* IE9 Compat Modes */ src: local(""), - url("../fonts/vollkorn-v12-latin-ext_latin-500italic.eot?#iefix") - format("embedded-opentype"), - /* IE6-IE8 */ url("../fonts/vollkorn-v12-latin-ext_latin-500italic.woff2") - format("woff2"), - /* Super Modern Browsers */ - url("../fonts/vollkorn-v12-latin-ext_latin-500italic.woff") format("woff"), - /* Modern Browsers */ - url("../fonts/vollkorn-v12-latin-ext_latin-500italic.ttf") - format("truetype"), - /* Safari, Android, iOS */ - url("../fonts/vollkorn-v12-latin-ext_latin-500italic.svg#Vollkorn") - format("svg"); + url("../fonts/vollkorn-v12-latin-ext_latin-500italic.eot?#iefix") + format("embedded-opentype"), + /* IE6-IE8 */ url("../fonts/vollkorn-v12-latin-ext_latin-500italic.woff2") + format("woff2"), + /* Super Modern Browsers */ + url("../fonts/vollkorn-v12-latin-ext_latin-500italic.woff") format("woff"), + /* Modern Browsers */ + url("../fonts/vollkorn-v12-latin-ext_latin-500italic.ttf") + format("truetype"), + /* Safari, Android, iOS */ + url("../fonts/vollkorn-v12-latin-ext_latin-500italic.svg#Vollkorn") + format("svg"); /* Legacy iOS */ } @@ -207,18 +207,18 @@ th:not([align]) { src: url("../fonts/vollkorn-v12-latin-ext_latin-regular.eot"); /* IE9 Compat Modes */ src: local(""), - url("../fonts/vollkorn-v12-latin-ext_latin-regular.eot?#iefix") - format("embedded-opentype"), - /* IE6-IE8 */ url("../fonts/vollkorn-v12-latin-ext_latin-regular.woff2") - format("woff2"), - /* Super Modern Browsers */ - url("../fonts/vollkorn-v12-latin-ext_latin-regular.woff") format("woff"), - /* Modern Browsers */ - url("../fonts/vollkorn-v12-latin-ext_latin-regular.ttf") - format("truetype"), - /* Safari, Android, iOS */ - url("../fonts/vollkorn-v12-latin-ext_latin-regular.svg#Vollkorn") - format("svg"); + url("../fonts/vollkorn-v12-latin-ext_latin-regular.eot?#iefix") + format("embedded-opentype"), + /* IE6-IE8 */ url("../fonts/vollkorn-v12-latin-ext_latin-regular.woff2") + format("woff2"), + /* Super Modern Browsers */ + url("../fonts/vollkorn-v12-latin-ext_latin-regular.woff") format("woff"), + /* Modern Browsers */ + url("../fonts/vollkorn-v12-latin-ext_latin-regular.ttf") + format("truetype"), + /* Safari, Android, iOS */ + url("../fonts/vollkorn-v12-latin-ext_latin-regular.svg#Vollkorn") + format("svg"); /* Legacy iOS */ } @@ -231,17 +231,17 @@ th:not([align]) { src: url("../fonts/vollkorn-v12-latin-ext_latin-500.eot"); /* IE9 Compat Modes */ src: local(""), - url("../fonts/vollkorn-v12-latin-ext_latin-500.eot?#iefix") - format("embedded-opentype"), - /* IE6-IE8 */ url("../fonts/vollkorn-v12-latin-ext_latin-500.woff2") - format("woff2"), - /* Super Modern Browsers */ - url("../fonts/vollkorn-v12-latin-ext_latin-500.woff") format("woff"), - /* Modern Browsers */ url("../fonts/vollkorn-v12-latin-ext_latin-500.ttf") - format("truetype"), - /* Safari, Android, iOS */ - url("../fonts/vollkorn-v12-latin-ext_latin-500.svg#Vollkorn") - format("svg"); + url("../fonts/vollkorn-v12-latin-ext_latin-500.eot?#iefix") + format("embedded-opentype"), + /* IE6-IE8 */ url("../fonts/vollkorn-v12-latin-ext_latin-500.woff2") + format("woff2"), + /* Super Modern Browsers */ + url("../fonts/vollkorn-v12-latin-ext_latin-500.woff") format("woff"), + /* Modern Browsers */ url("../fonts/vollkorn-v12-latin-ext_latin-500.ttf") + format("truetype"), + /* Safari, Android, iOS */ + url("../fonts/vollkorn-v12-latin-ext_latin-500.svg#Vollkorn") + format("svg"); /* Legacy iOS */ } @@ -254,17 +254,17 @@ th:not([align]) { src: url("../fonts/vollkorn-v12-latin-ext_latin-italic.eot"); /* IE9 Compat Modes */ src: local(""), - url("../fonts/vollkorn-v12-latin-ext_latin-italic.eot?#iefix") - format("embedded-opentype"), - /* IE6-IE8 */ url("../fonts/vollkorn-v12-latin-ext_latin-italic.woff2") - format("woff2"), - /* Super Modern Browsers */ - url("../fonts/vollkorn-v12-latin-ext_latin-italic.woff") format("woff"), - /* Modern Browsers */ - url("../fonts/vollkorn-v12-latin-ext_latin-italic.ttf") format("truetype"), - /* Safari, Android, iOS */ - url("../fonts/vollkorn-v12-latin-ext_latin-italic.svg#Vollkorn") - format("svg"); + url("../fonts/vollkorn-v12-latin-ext_latin-italic.eot?#iefix") + format("embedded-opentype"), + /* IE6-IE8 */ url("../fonts/vollkorn-v12-latin-ext_latin-italic.woff2") + format("woff2"), + /* Super Modern Browsers */ + url("../fonts/vollkorn-v12-latin-ext_latin-italic.woff") format("woff"), + /* Modern Browsers */ + url("../fonts/vollkorn-v12-latin-ext_latin-italic.ttf") format("truetype"), + /* Safari, Android, iOS */ + url("../fonts/vollkorn-v12-latin-ext_latin-italic.svg#Vollkorn") + format("svg"); /* Legacy iOS */ } @@ -277,18 +277,18 @@ th:not([align]) { src: url("../fonts/great-vibes-v7-latin-ext_latin-regular.eot"); /* IE9 Compat Modes */ src: local("Great Vibes"), local("GreatVibes-Regular"), - url("../fonts/great-vibes-v7-latin-ext_latin-regular.eot?#iefix") - format("embedded-opentype"), - /* IE6-IE8 */ url("../fonts/great-vibes-v7-latin-ext_latin-regular.woff2") - format("woff2"), - /* Super Modern Browsers */ - url("../fonts/great-vibes-v7-latin-ext_latin-regular.woff") format("woff"), - /* Modern Browsers */ - url("../fonts/great-vibes-v7-latin-ext_latin-regular.ttf") - format("truetype"), - /* Safari, Android, iOS */ - url("../fonts/great-vibes-v7-latin-ext_latin-regular.svg#GreatVibes") - format("svg"); + url("../fonts/great-vibes-v7-latin-ext_latin-regular.eot?#iefix") + format("embedded-opentype"), + /* IE6-IE8 */ url("../fonts/great-vibes-v7-latin-ext_latin-regular.woff2") + format("woff2"), + /* Super Modern Browsers */ + url("../fonts/great-vibes-v7-latin-ext_latin-regular.woff") format("woff"), + /* Modern Browsers */ + url("../fonts/great-vibes-v7-latin-ext_latin-regular.ttf") + format("truetype"), + /* Safari, Android, iOS */ + url("../fonts/great-vibes-v7-latin-ext_latin-regular.svg#GreatVibes") + format("svg"); /* Legacy iOS */ } @@ -477,8 +477,11 @@ ol li { list-style-type: decimal; } -img { - width: 100%; +img, video { + max-width: 100%; + display: block; + margin-left: auto; + margin-right: auto; } .supt { @@ -575,9 +578,9 @@ img { .rightcolumn { /* display: grid; - grid-column: 2; - grid-template-columns: auto 1fr; - grid-auto-rows: max-content; */ + grid-column: 2; + grid-template-columns: auto 1fr; + grid-auto-rows: max-content; */ padding-left: 0.5rem; } @@ -592,6 +595,7 @@ img { .hasauthors { font-size: 1.6rem !important; + display: flex; } .hassup { @@ -669,7 +673,7 @@ h6 { padding-top: 1.2rem; padding-bottom: 1.2rem; background-color: rgba(0, 0, 0, 0.05); - max-width: 70ch; + max-width: 45ch; } .authors { @@ -775,7 +779,7 @@ h6:before { color: rgba(0, 0, 0, 0.4); counter-increment: h6; content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "." - counter(h6) ". "; + counter(h6) ". "; } h2.nocount:before, @@ -834,9 +838,9 @@ details { } /* .glossline { - border-bottom: lightgray solid 1px; - border-top: lightgray solid 1px; -} */ + border-bottom: lightgray solid 1px; + border-top: lightgray solid 1px; + } */ .glosswords { display: inline-block; @@ -876,6 +880,11 @@ details { background-color: #fff9f9; } +.svedit { + display: none; + margin-left: 0.5rem; +} + @media (max-width: 767px) { html { box-sizing: border-box; diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/js/sandpoints.js b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/js/sandpoints.js index 1ffb04c..4d46e25 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/js/sandpoints.js +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/js/sandpoints.js @@ -54,7 +54,48 @@ window.addEventListener("scroll", function (e) { } }); +function editPage(repoJsId) { + let relPath = "../".repeat(relPathDepth - 1); + var el = document.createElement('script'); + el.onload = ()=> { + console.log("loading...") + console.log(repo) + } + el.src = `${relPath}js/repo/${repoJsId}.js` + document.body.appendChild(el) + document.location.href = `${relPath}edit/index.html?edit=${repoJsId}` +ev} + +window.addEventListener("keyup", (e)=> { + if (e.key == "e" && location.protocol == "file:") { + editPage(sandpointsPageId) + } else if (e.key == "E" && location.protocol == "file:") { + let preview = document.querySelector("#preview"); + if (preview.style.display == "flex") { + preview.style.display = "none"; + } else { + preview.style.display = "flex"; + } + console.log("preview: ", preview); + } +}) + window.addEventListener("DOMContentLoaded", (e) => { + if (location.protocol == "file:") { + document.querySelectorAll(".svedit").forEach((i) => { + i.style.display = "inline"; + }) + } + + document.querySelectorAll('.triadlink').forEach((i) => { + i.addEventListener("click", (ev) => { + if (ev.ctrlKey) { + ev.preventDefault() + editPage(ev.target.getAttribute("repoid")) + } + }) + }) + let preview = document.querySelector("#preview"); if ( location.pathname.split("/").includes("_preview") || @@ -66,15 +107,17 @@ 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 (par) { + 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 (document.querySelector(".soundcite")) { let relPath = "../".repeat(relPathDepth - 1); diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/data/sandpointsnamegraph.json b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/data/sandpointsnamegraph.json index a61716f..427cc44 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/data/sandpointsnamegraph.json +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/data/sandpointsnamegraph.json @@ -1,15 +1,45 @@ { - "syllabus": "syllabi", - "curriculum": "curriculums", - "book": "books", - "journal": "journals", - "topic": "topics", - "part": "parts", - "issue": "issues", - "experiment": "experiments", - "session": "sessions", - "chapter": "chapters", - "article": "articles", - "annex": "annexes", - "author": "authors" + "annex": "annexes", + "article": "articles", + "atlas": "atlases", + "author": "authors", + "book": "books", + "cabin": "cabins", + "chapter": "chapters", + "compartment": "compartments", + "contributor": "contributors", + "curriculum": "curriculums", + "deck": "decks", + "document": "documents", + "editor": "editors", + "entry": "entries", + "experiment": "experiments", + "floor": "floors", + "fragment": "fragments", + "glossary": "glossaries", + "highlight": "highlights", + "house": "houses", + "issue": "issues", + "journal": "journals", + "logbook": "logbooks", + "map": "maps", + "note": "notes", + "notebook": "notebooks", + "part": "parts", + "pin": "pins", + "record": "records", + "reflection": "reflections", + "room": "rooms", + "scribe": "scribes", + "section": "sections", + "series": "series", + "session": "sessions", + "ship": "ships", + "spectre": "spectres", + "syllabus": "syllabi", + "tab": "tabs", + "term":"terms", + "topic": "topics", + "toponym": "toponyms", + "voice": "voices" } diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/_markup/render-heading.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/_markup/render-heading.html index 0a810c7..57c5da4 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/_markup/render-heading.html +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/_markup/render-heading.html @@ -1 +1 @@ -{{ .Text | safeHTML }} +{{ .Text | safeHTML }} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/_markup/render-image.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/_markup/render-image.html index 509776f..2955281 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/_markup/render-image.html +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/_markup/render-image.html @@ -5,7 +5,17 @@ {{ $_.Add "triads" $k }} {{- end -}} -{{- if strings.HasPrefix .Destination "bib:" -}} +{{- if strings.HasPrefix .Destination "img:" -}} + {{- $img_params := (substr .Destination 4) -}} + {{- $img_src := index (split $img_params " ") 0 -}} + {{- $img_attr := index (split $img_params $img_src) 1 -}} + +{{- else if strings.HasPrefix .Destination "vid:" -}} + {{- $vid_params := (substr .Destination 4) -}} + {{- $vid_src := index (split $vid_params " ") 0 -}} + {{- $vid_attr := index (split $vid_params $vid_src) 1 -}} + +{{- else 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 -}} @@ -17,21 +27,21 @@ {{ end }} {{ .Page.Scratch.Add "bibs" (slice (slice $bibhref $bibtitle)) }} {{- if not $text_link -}} - {{- delimit $b.authors ", " " & " -}}{{- with $b.pubdate -}}, {{- substr . 0 4}}{{- end -}}.bib⁄‘{{- $b.title -}}’. {{- with $b.publisher -}}{{- . -}}.{{- end -}} - {{- else -}} - {{- $text_link -}} + {{- delimit $b.authors ", " " & " -}}{{- with $b.pubdate -}}, {{- substr . 0 4}}{{- end -}}. bib⁄{{- $b.title -}}. {{- with $b.publisher -}}{{- . -}}.{{- end -}} + {{- else -}} + bib⁄{{- $text_link -}} {{- end -}} {{- else -}} - {{- $text_link -}}⦚bib:{{- $destination -}} not found + {{- $text_link -}}⦚bib:{{- $destination -}} not found {{- 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 -}} - {{- index (split .Destination ":") 0 -}}⁄{{- $session.Title -}} + {{- index (split .Destination ":") 0 -}}⁄{{- $session.Title -}} {{- else -}} - {{- index (split .Destination ":") 0 -}}⁄{{- $text_link -}} + {{- index (split .Destination ":") 0 -}}⁄{{- $text_link -}} {{- end -}} {{- else -}} {{- $text_link -}}⦚{{- .Destination -}} not found diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/baseof.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/baseof.html index 4c09044..051e285 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/baseof.html +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/baseof.html @@ -2,12 +2,12 @@ - {{- partialCached "head.html" . -}} + {{- partial "head.html" . -}} {{- .Title }} - {{ .Site.Title -}} {{- partialCached "sandpointjs.html" . .RelPermalink -}} - {{- block "singlebody" . }}{{- end }} + {{- block "singlebody" . }}{{- end -}} {{- partialCached "footer.html" . -}} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/list.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/list.html index b428d29..dc2631f 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/list.html +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/_default/list.html @@ -6,30 +6,33 @@ {{ $currentDir = .Dir }} {{ end }} {{ $currentFile := (printf "/%s" .File) }} + {{ $editFile := $.Site.GetPage "/edit" }} + {{ $editFilePath := $editFile.RelPermalink }} -
Sitemap⁄{{ substr $.Site.Title 0 1 }}{{ substr $.Site.Title 1 }} ({{ $currentDir }})
+ +
Sitemap⁄{{ substr $.Site.Title 0 1 }}{{ substr $.Site.Title 1 }} {{with $currentDir}}({{ . }}){{ end }}
{{ $s := partialCached "scratch.html" . }} {{ $noTriad := (slice) }} {{ range $p := .Site.RegularPages }} {{ $scratch := $s.Get (printf "/%s" $p.File) }} {{ if eq $scratch.depth "core" }} -
{{- substr $p.File.Dir 0 -1 -}}⁄{{- $p.Title -}}
+
{{ range $coreKid := $scratch.has_children }} -
+ {{ end }} {{ else if not (in (slice "core" "mantle" "crust") $scratch.depth)}} - {{ $noTriad = $noTriad | append $p }} + {{ $noTriad = $noTriad | append $p }} {{ else }}
{{ end }} {{ end }} {{ range $noTriad }} - +
{{- substr .File.Dir 0 -1 -}}⁄{{- .Title -}}{{ if not (or (hasPrefix .File.Dir "edit") (hasPrefix .File.Dir "print")) }}[EDIT]{{ end }}
{{ end }} {{ end }} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/edit/baseof.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/edit/baseof.html new file mode 100644 index 0000000..c0451ba --- /dev/null +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/edit/baseof.html @@ -0,0 +1,14 @@ + + + + + + + + + + + edit⁄{{- .Site.Title -}} + + {{- block "main" . -}}{{- end -}} + diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/edit/list.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/edit/list.html new file mode 100644 index 0000000..e4e4a83 --- /dev/null +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/edit/list.html @@ -0,0 +1,2 @@ +{{ define "main" }} +{{ end }} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/edit/single.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/edit/single.html new file mode 100644 index 0000000..27f8f31 --- /dev/null +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/edit/single.html @@ -0,0 +1 @@ +{{- define "main" -}}{{- end -}} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/metadata/list.js.js b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/metadata/list.js.js index 2768a68..40d5ba3 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/metadata/list.js.js +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/metadata/list.js.js @@ -1 +1,20 @@ -{{ define "main" }}SECTIONS=[{{ range .Site.Sections }}{"section": "{{ with .File }}{{ trim .Dir "/" }}{{ end }}", "items": [{{ range .Pages }}"{{ .File.BaseFileName }}", {{ end }}]}, {{ end }}];{{ end }} +{{- define "main" -}} + {{ $sections := (slice) }} + {{ $tiers := (slice) }} + {{ range $.Site.Sections }} + {{ with .File }} + {{ $sections = $sections | append (strings.TrimSuffix "/" .Dir) }} + {{ end }} + {{ end }} + {{ $metasp := (dict) }} + {{ range $k, $v := $.Site.Data.sandpointsnamegraph }} + {{ if in $sections $k }} + {{ $tiers = (slice) }} + {{ range where $.Site.RegularPages "Section" $k }} + {{ $tiers = $tiers | append (merge (dict "file" .File.LogicalName) (dict "title" .Title)) }} + {{ end }} + {{ $metasp = merge $metasp (dict $v (merge (dict "singular" $k) (dict "tiers" $tiers))) }} + {{ end }} + {{ end }} +{{ printf "METASP=%s;" (jsonify $metasp) }} +{{ end }} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/head.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/head.html index 0169016..482f33d 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/head.html +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/head.html @@ -11,10 +11,21 @@ {{ end }} -{{ if .Params.Author }} - +{{ if .Params.editors }} + {{ range .Params.editors }} + {{ $e := $.GetPage (printf "editor/%s" .) }} + + {{ end }} {{ end }} +{{ if .Params.authors }} + {{ range .Params.authors }} + {{ $e := $.GetPage (printf "author/%s" .) }} + + {{ end }} +{{ end }} + + {{ template "_internal/opengraph.html" . }} {{ template "_internal/twitter_cards.html" . }} @@ -27,9 +38,9 @@ {{ if eq hugo.Environment "dev" }} - {{ $style := resources.Get "css/site.css" | postCSS (dict "config" "assets/css/postcss.config.js") | minify }} + {{ $style := resources.Get "css/site.css" | resources.PostCSS (dict "config" "assets/css/postcss.config.js") | minify }} - {{ $style := resources.Get "css/player.css" | postCSS (dict "config" "assets/css/postcss.config.js") | minify }} + {{ $style := resources.Get "css/player.css" | resources.PostCSS (dict "config" "assets/css/postcss.config.js") | minify }} {{ else }} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/header.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/header.html index fc5880a..ae5a4c9 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/header.html +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/header.html @@ -36,6 +36,16 @@ PUBLISH ?
+{{ else }} + {{ $editPage := $.Site.GetPage "/edit" }} +
+ EDIT_THIS + {{ with $scratch.core }}ADD_{{ index . 0 | upper }}{{ end }} + {{ with $scratch.mantle }}ADD_{{ index . 0 | upper }}{{ end }} + {{ with $scratch.crust }}ADD_{{ index . 0 | upper }}{{ end }} + {{ if not $scratch.core }}ADD_{{ substr $currentDir 0 -1 | upper }}{{ end }} +
+
{{ end }}
diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/pagedjs.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/pagedjs.html index 2c1f980..cd0e6a3 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/pagedjs.html +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/pagedjs.html @@ -1,2 +1,5 @@ + + + diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/printsinglebody.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/printsinglebody.html new file mode 100644 index 0000000..676d824 --- /dev/null +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/printsinglebody.html @@ -0,0 +1,96 @@ +{{ $s := partialCached "scratch.html" . }} + +{{ $currentNode := . }} +{{ $currentDir := "" }} +{{ with .File }} + {{ $currentDir = .Dir }} +{{ end }} +{{ $currentFile := (printf "/%s" .File) }} +{{ $scratch := $s.Get $currentFile }} + +{{ $longestTitle := "" }} + +
{{ substr $currentDir 0 -1 }}⁄{{ .Title }}
+ +
+
+ {{ if ne (trim .Page.TableOfContents "\n") "" }} + {{ .Page.TableOfContents }} + {{ end }} +
+
+ {{ $closeDivs := false }} + {{ $sandnamePlural := (slice) }} + {{ range $k, $v := $.Site.Data.sandpointsnamegraph }} + {{ $sandnamePlural = $sandnamePlural | append $v }} + {{ end }} + {{ $paramsKeys := (slice) }} + {{ range $k, $v := $currentNode.Params }} + {{ $paramsKeys = $paramsKeys | append $k }} + {{ end }} + {{ $mentions := intersect $paramsKeys $sandnamePlural }} + {{ range $mention := $mentions }} + {{ range $k, $m := index $currentNode.Params $mention }} + {{ $mentionLink := printf "/%s/%s" (substr $mention 0 -1) $m }} + {{- with $.GetPage $mentionLink -}} + {{ with not $k }} + {{ $closeDivs = true }} +
+
{{ with (index $currentNode.Params $mention) }}{{ if gt (len (index $currentNode.Params $mention)) 1 }}{{ $mention }}{{ else }}{{ substr $mention 0 -1 }}{{ end }}{{ end }}⁄
+
+ {{ end }} + + {{ end }} + {{ end }} + {{ end }} + {{- with $closeDivs -}}
{{ end }} + + {{ if and (not (eq $scratch.depth "crust")) $scratch.has_children }} +
+ {{ with $scratch.has }} +
has {{ $scratch.has }}⁄
+ {{ end }} +
+ {{ range $scratch.has_children }} + {{ $authors := "" }} + {{ range $k, $authorLink := .Params.authors }} + {{ $authorPage := $.GetPage (printf "/author/%s" $authorLink) }} + {{ $prefix := ", " }} + {{ with not $k }} + {{ $prefix = "" }} + {{ end }} + {{ $authors = printf "%s%s" $prefix $authorPage.Title }} + {{ end }} + + {{ if gt (len .Title) (len $longestTitle) }} + {{ $longestTitle = .Title }} + {{ end }} + {{ end }} + +
+ {{ end }} + + {{ if eq $scratch.depth "crust" }} +
+
in {{ index $scratch.in 1 }}⁄
+
+ {{ range $scratch.is_in }} + + {{ end }} +
+ {{ end }} +
+
+ + +{{ with .Page.Params.abstract }}
abstract⁄{{ . | $.Page.RenderString | htmlUnescape | safeHTML }}
{{ end }} + +{{- $vld := false -}}{{- range $k, $v := .Page.Params.keywords -}}{{- if eq $k 0 -}}{{- $vld = true -}}
keywords⁄{{- $v -}}{{- else -}}, {{- $v -}}{{- end -}}{{- end -}}{{- with $vld -}}
{{- end -}} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/readdir.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/readdir.html new file mode 100644 index 0000000..04ed812 --- /dev/null +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/readdir.html @@ -0,0 +1,13 @@ +{{ $parentName := . }} +{{ range (readDir .) }} + {{ $currentName := printf "%s/%s" $parentName .Name }} + {{ if .IsDir }} +

_Dir: {{ $currentName }}

+ {{ partial "readdir.html" $currentName }} + {{ else }} + {{ if eq (path.Ext .Name) ".md" }} + {{ $f := readFile $currentName }} + + {{ end }} + {{ end }} +{{ end }} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/sandpointjs.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/sandpointjs.html index d023ad6..ef9cf51 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/sandpointjs.html +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/sandpointjs.html @@ -1,4 +1,4 @@ - + {{ $sjsopts := dict "targetPath" "js/sandpoints.js" "minify" "true"}} {{ $sjs := resources.Get "js/sandpoints.js" | js.Build $sjsopts }} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/scratch.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/scratch.html index beb3b0e..c54a821 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/scratch.html +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/scratch.html @@ -3,6 +3,14 @@ {{ $_ := newScratch }} {{ $debug := (slice) }} +{{ $sandnameSingular := (slice) }} +{{ $sandnamePlural := (slice) }} + +{{ range $k, $v := $.Site.Data.sandpointsnamegraph }} + {{ $sandnameSingular = $sandnameSingular | append $k }} + {{ $sandnamePlural = $sandnamePlural | append $v }} +{{ end }} + {{ $pPath := "" }} {{ range $p := .Site.RegularPages }} {{ $pPath = printf "/%s" $p.File }} @@ -23,16 +31,24 @@ {{ end }} {{ end }} - {{ with $authors := $p.Params.authors }} - {{ range $author := $authors }} - {{ $authorLink := printf "/author/%s" $author }} - {{ with ($_.Get $authorLink) }} - {{ $_.SetInMap $authorLink "backlinks" (uniq ((index ($_.Get $authorLink) "backlinks") | append $p)) }} + {{ $paramsKeys := (slice) }} + {{ range $k, $v := $p.Params }} + {{ $paramsKeys = $paramsKeys | append $k }} + {{ end }} + + {{ $mentions := intersect $paramsKeys $sandnamePlural }} + {{ range $mention := $mentions }} + {{ range $m := index $p.Params $mention }} + {{ $mentionLink := printf "/%s/%s" (substr $mention 0 -1) $m }} + {{ with ($_.Get $mentionLink) }} + {{ $p.Scratch.Add "links" (uniq (($p.Scratch.Get "links")| append ($.GetPage $mentionLink))) }} + {{ $_.SetInMap $mentionLink "backlinks" (uniq ((index ($_.Get $mentionLink) "backlinks") | append $p)) }} {{ else }} - {{ $_.SetInMap $authorLink "backlinks" (slice $p) }} - {{ end }} - {{ end }} - {{ end }} + {{ $p.Scratch.Add "links" (uniq (($p.Scratch.Get "links")| append ($.GetPage $mentionLink))) }} + {{ $_.SetInMap $mentionLink "backlinks" (slice $p) }} + {{ end }} + {{ end }} + {{ end }} {{ $gp := $.GetPage $pPath }} {{ $gpPath := printf "/%s" $gp.File }} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/singlebody.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/singlebody.html index 49a5aea..c8d2c86 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/singlebody.html +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/partials/singlebody.html @@ -8,6 +8,10 @@ {{ $currentFile := (printf "/%s" .File) }} {{ $scratch := $s.Get $currentFile }} +{{ $sandnamePlural := (slice) }} +{{ $sandnameSingular := "" }} +{{ $mentionLink := "" }} +
{{ substr $currentDir 0 -1 }}⁄{{ substr .Title 0 1 }}{{ substr .Title 1 }}
@@ -17,22 +21,41 @@ {{ end }}
- {{- range $k, $v := .Page.Params.authors -}} - {{- with $.GetPage (printf "/author/%s" $v) -}} - {{- with not $k -}} -
-
author{{ with $.Page.Params.authors }}{{ if gt (len .) 1 }}s{{ end }}{{ end }}⁄
-
- {{- end -}} - - {{- end -}} - {{- end -}} - {{- with .Page.Params.authors -}}
{{- end -}} + {{ $closeDivs := false }} + {{ range $k, $v := $.Site.Data.sandpointsnamegraph }} + {{ $sandnamePlural = $sandnamePlural | append $v }} + {{ end }} + {{ $paramsKeys := (slice) }} + {{ range $k, $v := $currentNode.Params }} + {{ $paramsKeys = $paramsKeys | append $k }} + {{ end }} + {{ $mentions := intersect $paramsKeys $sandnamePlural }} + {{ range $mention := $mentions }} + {{ range $k, $m := index $currentNode.Params $mention }} + {{ range $k, $v := $.Site.Data.sandpointsnamegraph }} + {{ if eq $v $mention }} + {{ $mentionLink = printf "/%s/%s" $k $m }} + {{ $sandnameSingular = $k }} + {{ end }} + {{ end }} + {{- with $.GetPage $mentionLink -}} + {{- with not $k -}} + {{ $closeDivs = true }} +
+
{{ with (index $currentNode.Params $mention) }}{{ if gt (len (index $currentNode.Params $mention)) 1 }}{{ $mention }}{{ else }}{{ $sandnameSingular }}{{ end }}{{ end }}⁄
+
+ {{- end -}} + + {{- end -}} + {{ end }} + {{- with $closeDivs -}}
{{ end }} + {{ end }} + {{ if in .Page.Site.Params.sandpointsMentionedIn (substr $currentDir 0 -1) }} -
+
{{ with $scratch.backlinks }}
mentioned in⁄
{{ end }} @@ -46,7 +69,7 @@ {{ end }} {{ if and (not (eq $scratch.depth "crust")) $scratch.has_children }} -
+
{{ with $scratch.has }}
has {{ $scratch.has }}⁄
{{ end }} @@ -60,7 +83,7 @@ {{ end }} {{ if eq $scratch.depth "crust" }} -
+
in {{ index $scratch.in 1 }}⁄
{{ range $scratch.is_in }} @@ -74,8 +97,9 @@
-{{ with .Page.Params.abstract }}
abstract⁄{{ . | markdownify }}
{{ end }} +{{ with .Page.Params.abstract }}
abstract⁄{{ . | $.Page.RenderString | htmlUnescape | safeHTML }}
{{ end }} -{{- $vld := false -}}{{- range $k, $v := .Page.Params.keywords -}}{{- if eq $k 0 -}}{{- $vld = true -}}
keywords⁄{{- $v -}}{{- else -}}, {{- $v -}}{{- end -}}{{- end -}}{{- with $vld -}}
{{- end -}} -{{ with .Page.Params.abstract }}
{{ end }} +{{- $vld := false -}}{{- range $k, $v := .Page.Params.keywords -}}{{- if eq $k 0 -}}{{- $vld = true -}}
keywords⁄{{- $v -}}{{- else -}}, {{- $v -}}{{- end -}}{{- end -}}{{- with $vld -}}
{{- end -}} + +{{ $var := printf "repo={\"frontmatter\": %s, \"content\": %s, \"path\": \"%s\", \"relpermalink\": \"%s\" }" (jsonify .Params) (jsonify .RawContent) .File.Path .RelPermalink | resources.FromString (printf "js/repo/%s.js" .File.UniqueID) }} +{{ $dummy := $var.Permalink }} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/print/baseof.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/print/baseof.html index f27eaaa..3a88dcf 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/print/baseof.html +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/print/baseof.html @@ -2,12 +2,10 @@ - {{- partialCached "head.html" . -}} + {{- partial "head.html" . -}} {{- partial "pagedjs.html" . -}} -
{{- block "singlebody" . -}}{{- end -}} -
diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/print/single.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/print/single.html index 614dad4..eaeac2b 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/print/single.html +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/print/single.html @@ -1,4 +1,63 @@ {{- define "singlebody" -}} + {{ $cssTemplate := `.css-_rplc_-h2 { + counter-reset: css-_rplc_-h3; + } + + .css-_rplc_-h3 { + counter-reset: css-_rplc_-h4; + } + + .css-_rplc_-h4 { + counter-reset: css-_rplc_-h5; + } + + .css-_rplc_-h5 { + counter-reset: css-_rplc_-h6; + } + + .css-_rplc_-h2:before { + color: rgba(0, 0, 0, 0.4); + counter-increment: css-_rplc_-h2 1; + content: counter(css-_rplc_-h2) ". "; + } + + .css-_rplc_-h3:before { + color: rgba(0, 0, 0, 0.4); + counter-increment: css-_rplc_-h3 1; + content: counter(css-_rplc_-h2) "." counter(css-_rplc_-h3) ". "; + } + + .css-_rplc_-h4:before { + color: rgba(0, 0, 0, 0.4); + counter-increment: css-_rplc_-h4 1; + content: counter(css-_rplc_-h2) "." counter(css-_rplc_-h3) "." counter(css-_rplc_-h4) ". "; + } + + .css-_rplc_-h5:before { + color: rgba(0, 0, 0, 0.4); + counter-increment: css-_rplc_-h5 1; + content: counter(css-_rplc_-h2) "." counter(css-_rplc_-h3) "." counter(css-_rplc_-h4) "." counter(css-_rplc_-h5) ". "; + } + + .css-_rplc_-h6:before { + color: rgba(0, 0, 0, 0.4); + counter-increment: css-_rplc_-h6 1; + content: counter(css-_rplc_-h2) "." counter(css-_rplc_-h3) "." counter(css-_rplc_-h4) "." counter(css-_rplc_-h5) "." + counter(css-_rplc_-h6) ". "; + } + + .css-_rplc_-h2.nocount:before, + .css-_rplc_-h3.nocount:before, + .css-_rplc_-h4.nocount:before, + .css-_rplc_-h5.nocount:before, + .css-_rplc_-h6.nocount:before { + content: ""; + counter-increment: none; + }` }} + + {{ $cssOutput := "" }} + {{ $cssHashes := "" }} + {{ $s := partialCached "scratch.html" . }} {{ $p := $.GetPage .Params.print }} {{ $scratch := $s.Get (printf "/%s" $p.File) }} @@ -8,17 +67,87 @@ {{ $currentDir = .Dir }} {{ end }} -
{{ partial "singlebody.html" $p }}
-
{{ $p.Content }} - {{ range $printPage := $scratch.has_cildren }} -
{{ partial "singlebody.html" $printPage }}
-
{{ $printPage.Content }} - {{ $printPageScratch := $s.Get (printf "/%s" $printPage.File) }} - {{ range $printPageKid := $printPageScratch.has_children }} -
{{ partial "singlebody.html" $printPageKid }}
-
{{ $printPageKid.Content }} - {{ . }} +
{{ partial "printsinglebody.html" $p }}
+
{{ $p.Content }}
+ {{ $cssOutput = printf "%s\n%s" $cssOutput (replace $cssTemplate "_rplc_" $p.File.UniqueID) }} + {{ $cssHashes = printf "%s css-%s-h2" $cssHashes $p.File.UniqueID }} + + {{ range $scratch.has_children }} +
+ {{ $addS := 0 }} + {{ with .Params.authors }} + {{ $addS = len . }} + {{ end }} + {{ range $n, $authorFile := .Params.authors }} + {{ $author := $.GetPage (printf "/author/%s" $authorFile) }} + {{ if eq $n 0 }} +
author{{ with (gt $addS 1) }}s{{ end }}⁄{{ $author.Title }} + {{ else }} + , {{ $author.Title }} {{ end }} -
- {{ end }} + {{ end }} + {{ with .Params.authors }}
{{ end }} + + {{ $tit := .Title }} + {{ if gt (len .Title) 54 }} + {{ $tit = printf "%s…" (substr .Title 0 50) }} + {{ end }} +
{{ index $scratch.crust 0 }}⁄{{ $tit }}
+ {{ partial "printsinglebody.html" . }} + {{ .Content }} + {{ $cssOutput = printf "%s\n%s" $cssOutput (replace $cssTemplate "_rplc_" .File.UniqueID) }} + {{ $cssHashes = printf "%s css-%s-h2" $cssHashes .File.UniqueID }} + {{ $kid := $s.Get (printf "/%s" .File) }} + {{ range $kid.has_children }} +
+ {{ $addS := 0 }} + {{ with .Params.authors }} + {{ $addS = len . }} + {{ end }} + {{ range $n, $authorFile := .Params.authors }} + {{ $author := $.GetPage (printf "/author/%s" $authorFile) }} + {{ if eq $n 0 }} +
author{{ with (gt $addS 1) }}s{{ end }}⁄{{ $author.Title }} + {{ else }} + , {{ $author.Title }} + {{ end }} + {{ end }} + {{ with .Params.authors }}
{{ end }} + + {{ $tit := .Title }} + {{ if gt (len .Title) 54 }} + {{ $tit = printf "%s…" (substr .Title 0 50) }} + {{ end }} +
{{ index $scratch.crust 0 }}⁄{{ $tit }}
+ {{ partial "printsinglebody.html" . }} + {{ .Content }} + {{ $cssOutput = printf "%s\n%s" $cssOutput (replace $cssTemplate "_rplc_" .File.UniqueID) }} + {{ $cssHashes = printf "%s css-%s-h2" $cssHashes .File.UniqueID }} + {{ end }} + {{ end }} + + {{ range where $.Site.RegularPages "Section" "in" (slice "author" "editor") }} +
+
{{ index $scratch.mantle 0 }}⁄{{ $p.Title }}
+
{{ substr .File.Dir 0 -1 }}⁄{{ .Title }}
+ {{ .Content }} + + {{ if in .Page.Site.Params.sandpointsMentionedIn (substr .File.Dir 0 -1) }} + {{ $ss := $s.Get (printf "/%s" .File) }} +
+ {{ with $ss }} +
mentioned in⁄
+ {{ end }} +
+ {{ range $ss.backlinks }} + + {{ end }} +
+ {{ end }} + {{ end }} + {{ $cssOutput = printf "body {counter-reset: %s;}\n%s" $cssHashes $cssOutput }} + {{ $var := $cssOutput | resources.FromString "css/dyn.css" }} + {{ $dummy := $var.Permalink }} {{- end -}} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/taxonomy/baseof.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/taxonomy/baseof.html new file mode 100644 index 0000000..ff6a2c7 --- /dev/null +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/taxonomy/baseof.html @@ -0,0 +1,12 @@ + + + + {{- partialCached "head.html" . -}} + {{- .Title }} - {{ .Site.Title -}} + {{- partialCached "sandpointjs.html" . .RelPermalink -}} + + + {{- block "keywords" . -}}{{- end -}} + {{- partialCached "footer.html" . -}} + + diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/taxonomy/list.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/taxonomy/list.html new file mode 100644 index 0000000..e70e8e3 --- /dev/null +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/taxonomy/list.html @@ -0,0 +1,23 @@ +{{ define "keywords" }} + {{ $p := split (trim .RelPermalink "/") "/" }} + {{ if eq (len $p) 1 }} +
{{ index $p 0 }}⁄All
+ {{ range $taxonomyname, $taxonomy := .Site.Taxonomies }} + {{ if eq (index $p 0) $taxonomyname }} + {{ range $key, $value := $taxonomy }} + {{ $key }}({{ len (index (index $.Site.Taxonomies $taxonomyname) $key) }}) + {{ end }} + {{ end }} + {{ end }} + {{ else }} +
{{ index $p 0 }}⁄{{ index $p 1 }}
+ {{ range .Pages.ByDate.Reverse }} +
{{ .Date.Format "Jan 2, 2006" }}
+ + {{ range $n, $authorFile := .Params.authors }} + {{ $author := $.GetPage (printf "/author/%s" $authorFile) }} + {{ $author.Title }} + {{ end }} + {{ end }} + {{ end }} +{{ end }} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/urls/list.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/urls/list.html index 2e1eb98..2764d59 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/urls/list.html +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/layouts/urls/list.html @@ -5,102 +5,100 @@

{{ range $p := .Site.RegularPages }} - {{ with or ($p.Scratch.Get "urls") ($p.Scratch.Get "bibs") ($p.Scratch.Get "links") ($p.Scratch.Get "backlinks" )}} -
{{ with $p.File }}{{- substr .Dir 0 -1 -}}⁄{{ end }}{{ $p.Title }} +
{{ with $p.File }}{{- substr .Dir 0 -1 -}}⁄{{ end }}{{ $p.Title }} - {{ $pPath := printf "/%s" $p.File }} - {{ with $ss := $s.Get $pPath }} - {{ with $ss.backlinks }} - {{ range $i, $_ := $ss.backlinks }} - {{ if eq $i 0 }} -
Mentioned in other Sandpoints pages ({{ len $ss.backlinks }}):
    - {{ end }} -
  • {{ with $_.File }}{{ substr .Dir 0 -1 }}⁄{{ end }}{{ $_.Title }}
  • - {{ end }} -
- {{ end }} - {{ end }} - - {{ with ($p.Scratch.Get "links") }} - {{ range $i, $_ := ($p.Scratch.Get "links") }} + {{ $pPath := printf "/%s" $p.File }} + {{ with $ss := $s.Get $pPath }} + {{ with $ss.backlinks }} + {{ range $i, $_ := $ss.backlinks }} {{ if eq $i 0 }} -
Internal links to other Sandpoint pages ({{ len ($p.Scratch.Get "links") }}):
    +
    Mentioned in other Sandpoints pages ({{ len $ss.backlinks }}):
      {{ end }}
    • {{ with $_.File }}{{ substr .Dir 0 -1 }}⁄{{ end }}{{ $_.Title }}
    • {{ end }}
    {{ end }} + {{ end }} - {{ $http_links := (slice) }} - {{ $library_links := (slice) }} - {{ $anchor_links := (slice) }} - {{ $other_links := (slice) }} + {{ with ($p.Scratch.Get "links") }} + {{ range $i, $_ := uniq ($p.Scratch.Get "links") }} + {{ if eq $i 0 }} +
    Internal links to other Sandpoint pages ({{ len (uniq ($p.Scratch.Get "links")) }}):
      + {{ end }} +
    • {{ with $_.File }}{{ substr .Dir 0 -1 }}⁄{{ end }}{{ $_.Title }}
    • + {{ end }} +
    + {{ end }} - {{ with ($p.Scratch.Get "urls") }} - {{- $c_prefix := $p.Site.Params.sandpointsCatalogPrefix | default "/library/" -}} - {{ range $i, $_ := ($p.Scratch.Get "urls") }} - {{ if strings.HasPrefix $_ "http" }} - {{ $http_links = $http_links | append $_ }} - {{ else if strings.HasPrefix $_ $c_prefix }} - {{ $library_links = $library_links | append $_ }} - {{ else}} - {{ $other_links = $other_links | append $_ }} - {{ end }} + {{ $http_links := (slice) }} + {{ $library_links := (slice) }} + {{ $anchor_links := (slice) }} + {{ $other_links := (slice) }} + + {{ with ($p.Scratch.Get "urls") }} + {{- $c_prefix := $p.Site.Params.sandpointsCatalogPrefix | default "/library/" -}} + {{ range $i, $_ := ($p.Scratch.Get "urls") }} + {{ if strings.HasPrefix $_ "http" }} + {{ $http_links = $http_links | append $_ }} + {{ else if strings.HasPrefix $_ $c_prefix }} + {{ $library_links = $library_links | append $_ }} + {{ else}} + {{ $other_links = $other_links | append $_ }} {{ end }} {{ end }} + {{ end }} - {{ with $http_links }} - {{ range $i, $_ := $http_links }} - {{ if eq $i 0 }} -
    Outgoing links to other pages on Internet ({{ len $http_links }}):
      - {{ end }} -
    • www⁄{{ $_ }}
    • + {{ with $http_links }} + {{ range $i, $_ := $http_links }} + {{ if eq $i 0 }} +
      Outgoing links to other pages on Internet ({{ len $http_links }}):
        {{ end }} -
      +
    • www⁄{{ $_ }}
    • {{ end }} +
    + {{ end }} - {{ with $library_links }} - {{ range $i, $_ := $library_links }} - {{ if eq $i 0 }} -
    Links to Sandpoint's library ({{ len $library_links }}):
      - {{ end }} -
    • lib⁄{{ $_ }}
    • + {{ with $library_links }} + {{ range $i, $_ := $library_links }} + {{ if eq $i 0 }} +
      Links to Sandpoint's library ({{ len $library_links }}):
        {{ end }} -
      +
    • lib⁄{{ $_ }}
    • {{ end }} +
    + {{ end }} - {{ with ($p.Scratch.Get "bibs") }} - {{ range $i, $_ := ($p.Scratch.Get "bibs") }} - {{ if eq $i 0 }} -
    Bibliographic references ({{ len ($p.Scratch.Get "bibs") }}):
      - {{ end }} -
    • bib⁄{{ index $_ 1 }}
    • + {{ with ($p.Scratch.Get "bibs") }} + {{ range $i, $_ := ($p.Scratch.Get "bibs") }} + {{ if eq $i 0 }} +
      Bibliographic references ({{ len ($p.Scratch.Get "bibs") }}):
        {{ end }} -
      +
    • bib⁄{{ index $_ 1 }}
    • {{ end }} +
    + {{ end }} - {{ with $other_links }} - {{ $formattingN := 0 }} - {{ $anchorN := 0 }} - {{ range $i, $_ := $other_links }} - {{ if eq $i 0 }} -
    Anchor, formatting and other links ({{ len $other_links }}):
      - {{ end }} - {{ if strings.HasPrefix $_ "#" }} - {{ $anchorN = add $anchorN 1 }} - {{ else if strings.HasPrefix $_ "{"}} - {{ $formattingN = add $formattingN 1 }} - {{ else }} -
    • other⁄{{ $_ }}
    • - {{ end }} + {{ with $other_links }} + {{ $formattingN := 0 }} + {{ $anchorN := 0 }} + {{ range $i, $_ := $other_links }} + {{ if eq $i 0 }} +
      Anchor, formatting and other links ({{ len $other_links }}):
        + {{ end }} + {{ if strings.HasPrefix $_ "#" }} + {{ $anchorN = add $anchorN 1 }} + {{ else if strings.HasPrefix $_ "{"}} + {{ $formattingN = add $formattingN 1 }} + {{ else }} +
      • other⁄{{ $_ }}
      • {{ end }} - {{ with $formattingN }}
      • {{ $formattingN }} formatting links.
      • {{ end }} - {{ with $anchorN }}
      • {{ $anchorN }} anchor links.
      • {{ end }} -
      {{ end }} + {{ with $formattingN }}
    • {{ $formattingN }} formatting links.
    • {{ end }} + {{ with $anchorN }}
    • {{ $anchorN }} anchor links.
    • {{ end }} +
    + {{ end }} -
+
- {{ end }} {{ end }} {{ end }} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/css/print.css b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/css/print.css new file mode 100644 index 0000000..4682b5e --- /dev/null +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/css/print.css @@ -0,0 +1,242 @@ +@page { + size: 6.14in 9.21in; + margin-bottom: 0.8in; + padding-bottom: 0.2in; + margin-top: 0.7in; +} + +@page:left { + margin-right: 0.8in; + margin-left: 0.9in; + @bottom-left-corner { + content: counter(page); + font-size: 1rem; + vertical-align: text-top; + } + + @bottom { + content: element(runningTitle); + position: relative; + } +} + +@page:right { + margin-left: 0.8in; + margin-right: 0.9in; + @bottom-right-corner { + content: counter(page); + font-size: 1rem; + vertical-align: text-top; + } + + @bottom { + content: element(runningAuthors); + position: relative; + } +} + +@page crustpage :first { + @bottom-right-corner { + content: none; + } + @bottom { + content: none; + } +} + +@media print { + html { + font-size: 0.8em; + box-sizing: border-box; + margin: 0; + padding: 0; + } + body { + font-size: 1rem; + padding: 0; + margin: 0; + } + + .sup, + .hassup { + color: black; + } + .grid { + display: inline; + } + + .coretitle { + margin-top: 3rem; + margin-bottom: 2rem; + font-size: 2.2rem; + } + + .leftcolumn { + display: none; + } + + .has, + .afterhas { + font-size: 1.1rem; + } + + .mantle, + .crust { + margin-bottom: 0.2em; + } + + .content { + padding: 0px; + margin: 0 auto; + margin-top: 4rem; + } + + .hpar { + display: none; + } + + .mantletitle { + font-size: 1.7rem; + } + + .sessiongrid { + display: none; + } + + #bibliography { + break-before: page; + } + + .footnotes ol { + margin-top: 3rem; + padding-left: 0.9rem; + } + + .footnotes hr { + border: none; + border-top: 0px; + text-align: left; + margin-top: 2rem; + margin-bottom: -2rem; + } + + .footnotes hr::after { + content: "Endnotes"; + font-size: 1.2rem; + font-weight: bold; + } + + .runningTitle { + position: running(runningTitle); + } + + .runningAuthors { + position: running(runningAuthors); + } + + .hasauthors .afterhas { + font-size: 1.5rem; + } + + .crustpage { + break-before: page; + page: crustpage; + } + + .hasin { + display: none; + } + + .abstract { + margin-left: 0; + margin-right: 0; + max-width: inherit; + } + + .keywords { + margin-left: 0; + margin-right: 0; + max-width: inherit; + padding-left: 0; + padding-right: 0; + font-size: 0.9rem; + } + /* + h2:before, + h3:before, + h4:before, + h5:before { + content: none; + } + */ + h2, h3, h4, h5, hr { + break-after: avoid; + } + + .glosscontainer, + table, + table + p, + tr, + blockquote, + li { + break-inside: avoid; + } + + .authorpage { + break-before: page; + } + + img { + display: block; + max-height: 150mm; + width: auto; + break-after: avoid; + margin-bottom: 0.5rem; + margin-left: 1rem; + } + + .crustoc { + position: relative; + bottom: 0 + } + + a.toc::before { + direction: rtl; + content: " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . "; + line-height: 0; + height: 1px; + position: absolute; + bottom: 10px; + z-index: -1; + } + + a.toc { + display: grid; + grid-template-columns: 1fr auto; + align-items: flex-end; + } + + a.toc span { + } + + a.toc .back { + background: white; + } + + a.toc::after { + text-align: right; + float: right; + content: target-counter(attr(href url), page, decimal-leading-zero); + background: white; + padding-left: 0.1rem; + } + + ol[data-split-from] { + padding-left: 0.5rem; + } + + .longesttitle { + visibility: hidden; + cursor: default; + } +} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/css/site.min.css b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/css/site.min.css index 11a51fc..35c040a 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/css/site.min.css +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/css/site.min.css @@ -1 +1 @@ -stdin 587:3 ⚠ grid-auto-rows is not supported by ie [autoprefixer] html,body,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}ul{list-style:none}button,input,select,textarea{margin:0}html{box-sizing:border-box}img,video{height:auto;max-width:100%}iframe{border:0}strong del{display:inline;text-decoration:none;margin-left:1rem;box-decoration-break:clone;-webkit-box-decoration-break:clone}table{border-collapse:collapse;border-spacing:0;background-color:#fff9f9;border-left:1px red solid;margin-left:1rem}td,th{padding:0;vertical-align:top;padding-right:1rem;padding-left:1rem;padding-bottom:.5rem}td:not([align]),th:not([align]){text-align:left}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:400;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:600;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:700;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:900;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn;font-style:italic;font-weight:500;src:url(../fonts/vollkorn-v12-latin-ext_latin-500italic.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.svg#Vollkorn)format("svg")}@font-face{font-family:vollkorn;font-style:normal;font-weight:400;src:url(../fonts/vollkorn-v12-latin-ext_latin-regular.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-regular.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.svg#Vollkorn)format("svg")}@font-face{font-family:vollkorn;font-style:normal;font-weight:500;src:url(../fonts/vollkorn-v12-latin-ext_latin-500.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-500.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-500.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-500.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-500.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-500.svg#Vollkorn)format("svg")}@font-face{font-family:vollkorn;font-style:italic;font-weight:400;src:url(../fonts/vollkorn-v12-latin-ext_latin-italic.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-italic.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.svg#Vollkorn)format("svg")}@font-face{font-family:great vibes;font-style:normal;font-weight:400;src:url(../fonts/great-vibes-v7-latin-ext_latin-regular.eot);src:local("Great Vibes"),local("GreatVibes-Regular"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.eot?#iefix)format("embedded-opentype"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.woff2)format("woff2"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.woff)format("woff"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.ttf)format("truetype"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.svg#GreatVibes)format("svg")}html{line-height:1.5}body{font-family:vollkorn,serif;font-weight:400;max-width:1024px;font-size:1.4rem;padding-left:3rem;padding-top:.5rem;padding-right:2rem;color:#000}#preview{display:none}sup,sub{vertical-align:baseline;position:relative;top:-.4em}sub{top:.4em}.headiter{display:flex;justify-content:space-between;border-bottom:.3rem solid red;border-top:.1rem solid red;padding-top:1rem;padding-bottom:.5rem;padding-left:1rem;padding-right:1rem;margin-bottom:1rem}a.edit-button{color:#000;text-decoration:none}a.edit-button:hover{text-decoration:underline;-webkit-text-decoration-color:red;text-decoration-color:red;font-weight:500;font-size:.97em;cursor:pointer}.header{display:-ms-grid;display:grid;-ms-grid-columns:auto;grid-template-columns:auto;grid-auto-flow:column;position:-webkit-sticky;position:sticky;top:0;padding-top:.5rem;font-size:1.1rem;background-color:#fff;z-index:10}.mantlebar{display:none}.breadcrumbs{-ms-grid-column:1;grid-column:1}.bibliotheke{width:2.4rem;-ms-grid-column:2;grid-column:2;margin-left:auto}.bibliotheke:hover{text-decoration:none;font-size:1rem}.alsoin{font-weight:700;display:inline-flex;padding-left:.2rem;padding-right:.3rem}.ddmenu{cursor:pointer;display:-ms-inline-grid;display:inline-grid}.ddmenu input{display:none}.ddmenu li{list-style-type:none}.ddmenu .hiddendiv{display:none;margin-top:-.9rem}input:focus,select:focus,textarea:focus,label:focus,button:focus{outline:none}.ddmenu input:checked~.hiddendiv{display:block}.logolink{width:2.4rem;margin-left:auto}.sandpointlogo{border-radius:50%;border:.3em solid red;display:inline-flex;font-family:great vibes,cursive;font-size:1.2rem;font-weight:700;color:#fff;background-color:red;position:relative;padding-left:1em;padding-right:.3em;padding-bottom:1.2em;max-width:0;max-height:0}.sandpointF{position:absolute;font-size:1.2em;margin-top:-.2em;margin-left:-.4em}.sandpointN{position:absolute;font-size:.7em;margin-top:.4em;color:red;margin-left:-.5em}.sandpointC{position:absolute;font-size:1em;margin-left:-.37em}footer{display:flex;margin-bottom:1rem;margin-top:4rem}li{list-style-type:"› "}li[role=doc-endnote]{list-style-type:decimal}ol li{list-style-type:decimal}img{width:100%}.supt{display:inline-flex;flex-wrap:nowrap;font-family:great vibes,cursive;font-size:.9em;font-style:normal;color:rgba(0,0,0,.8);vertical-align:baseline;position:relative;top:-.3em}.sup{display:inline-flex;flex-wrap:nowrap;font-family:great vibes,cursive;font-size:.9em;font-style:normal;color:red;vertical-align:baseline;position:relative;top:-.3em}.sup:hover{font-weight:400!important}.nosup a{color:red}.nosup a span.sup{display:none}.syllabustitle,.coretitle{margin-top:4rem;font-style:italic;font-size:4rem;margin-bottom:4rem}.mantletitle,.crusttitle{margin-top:4rem;font-style:italic;font-size:2rem;margin-bottom:4rem}.grid{padding-left:3rem;margin-bottom:2rem;display:-ms-grid;display:grid;-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr}.leftcolumn{-ms-grid-column:1;grid-column:1;padding-right:1.2rem;position:relative}#TableOfContents{margin-left:-2rem;margin-top:-1.5rem}#TableOfContents li{list-style:decimal inside;padding-left:.5rem;color:rgba(0,0,0,.4);margin:0;padding:0}#TableOfContents li a{font-family:vollkorn;font-size:1.4rem;font-weight:500;font-style:normal}#TableOfContents>ol:first-child>span>li>a::after{content:"¶";color:rgba(0,0,0,.2);font-size:1.3em;padding-left:.1em}.rightcolumn{padding-left:.5rem}.has{display:-ms-inline-grid;display:inline-grid;-ms-grid-column:2;grid-column:2;grid-auto-rows:-webkit-max-content;grid-auto-rows:max-content;font-size:1.4rem;font-style:italic;margin-bottom:.8rem}.hasauthors{font-size:1.6rem!important}.hassup{-ms-grid-column:1;grid-column:1;font-family:great vibes,cursive;font-size:.9em;font-style:normal;color:red;vertical-align:baseline;position:relative}.afterhas{-ms-grid-column:2;grid-column:2}.content{margin-top:4rem;padding-left:3rem;padding-right:10rem;max-width:720px}a{color:#000;text-decoration:none}a:hover{text-decoration:underline;-webkit-text-decoration-color:red;text-decoration-color:red;font-weight:500;font-size:.97em;cursor:pointer}h1{display:none}h2{font-weight:500;font-size:1.6rem}h3{font-weight:500;font-size:1.4rem}h4{font-weight:500;font-size:1.2rem}h5{font-weight:500;font-size:1.1rem}h6{font-weight:500;font-size:1rem}.abstract{font-style:italic;border-left:1px solid #000;margin-left:5rem;margin-right:2rem;margin-bottom:1.2rem;padding-left:1rem;padding-right:2rem;padding-top:1.2rem;padding-bottom:1.2rem;background-color:rgba(0,0,0,.05);max-width:70ch}.authors{display:inline-block;font-size:1.8rem;margin-left:5rem;margin-right:2rem;padding-left:1rem}.keywords{display:inline-block;font-size:1.2rem;margin-left:5rem;margin-right:2rem;padding-left:1rem;padding-right:2rem;margin-bottom:2.2rem;max-width:72ch}blockquote{border-left:1px red solid;margin-left:1rem;margin-right:2rem;padding-left:1rem;padding-right:2rem;padding-top:.1rem;padding-bottom:.1rem;background-color:#fff9f9}h2+p:first-letter{font-family:great vibes,cursive;color:rgba(0,0,0,.8);font-size:1.5em;line-height:0}.hx{position:relative}.hpar{position:absolute;font-size:1.7em;font-style:normal;color:rgba(0,0,0,.1);top:0;margin-top:-.4em}.smallcaps{font-family:vollkorn sc,serif;font-weight:400}body{counter-reset:h2 glossN}h2{counter-reset:h3}h3{counter-reset:h4}h4{counter-reset:h5}h5{counter-reset:h6}h2:before{color:rgba(0,0,0,.4);counter-increment:h2;content:counter(h2)". "}h3:before{color:rgba(0,0,0,.4);counter-increment:h3;content:counter(h2)"." counter(h3)". "}h4:before{color:rgba(0,0,0,.4);counter-increment:h4;content:counter(h2)"." counter(h3)"." counter(h4)". "}h5:before{color:rgba(0,0,0,.4);counter-increment:h5;content:counter(h2)"." counter(h3)"." counter(h4)"." counter(h5)". "}h6:before{color:rgba(0,0,0,.4);counter-increment:h6;content:counter(h2)"." counter(h3)"." counter(h4)"." counter(h5)"." counter(h6)". "}h2.nocount:before,h3.nocount:before,h4.nocount:before,h5.nocount:before,h6.nocount:before{content:"";counter-increment:none}details{padding-left:1rem}#toggleAllLinks{font-size:.8rem}#toggleAllLinks:hover{cursor:pointer;text-decoration:underline;-webkit-text-decoration-color:red;text-decoration-color:red}.glosscontainer{display:-ms-grid;display:grid;-ms-grid-columns:auto 0 1fr;grid-template-columns:auto 1fr;-ms-grid-rows:1fr;grid-template-rows:1fr;gap:0 0;grid-template-areas:"glossnumber gloss";border-left:1px red solid;background-color:#fff9f9;padding-top:.4em;margin-top:1rem;margin-bottom:1rem;margin-left:1rem;margin-right:2rem;padding-bottom:.4em;padding-left:1rem;padding-right:2rem}.gloss{-ms-grid-row:1;-ms-grid-column:3;grid-area:gloss}.glossnumber{-ms-grid-row:1;-ms-grid-column:1;grid-area:glossnumber;padding-right:.6rem}.glossnumberAuto::before{counter-increment:glossN;content:"(" counter(glossN)")"}.glosswords{display:inline-block;padding-left:-.3rem;padding-right:1rem}.sitemap{padding-left:3rem;font-size:1.2rem}.sitemap a{color:rgba(0,0,0,.4)}.sitemap .sup{color:rgba(255,0,0,.7)}.highline a,.sitemap a:hover{color:#000}.highline .sup,.sitemap .sup:hover{color:red}.highline{font-size:1.6rem;color:#000;border-left:1px red solid;padding-left:1rem;padding-top:.1rem;padding-bottom:.1rem;background-color:#fff9f9}@media(max-width:767px){html{box-sizing:border-box;max-width:767px;margin:0 auto;padding:0}body{font-size:1rem;padding-left:10px;padding-right:10px}.grid{display:inline}.coretitle{margin-top:3rem;margin-bottom:2rem;font-size:2.2rem}.leftcolumn{display:none}.has,.afterhas{font-size:1.1rem}.mantle,.crust{margin-bottom:.2em}.content{padding:0;margin:0 auto;margin-top:4rem}.hpar{display:none}.mantletitle{font-size:1.7rem}.sessiongrid{display:none}} \ No newline at end of file +qhtml,body,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}ul{list-style:none}button,input,select,textarea{margin:0}html{box-sizing:border-box}img,video{height:auto;max-width:100%}iframe{border:0}strong del{display:inline;text-decoration:none;margin-left:1rem;box-decoration-break:clone;-webkit-box-decoration-break:clone}table{border-collapse:collapse;border-spacing:0;background-color:#fff9f9;border-left:1px red solid;margin-left:1rem}td,th{padding:0;vertical-align:top;padding-right:1rem;padding-left:1rem;padding-bottom:.5rem}td:not([align]),th:not([align]){text-align:left}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:400;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-regular.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:600;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-600.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:700;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-700.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn sc;font-style:normal;font-weight:900;src:url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.eot);src:local(""),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.woff2)format("woff2"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.woff)format("woff"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.ttf)format("truetype"),url(../fonts/vollkorn-sc-v4-latin-ext_latin-900.svg#VollkornSC)format("svg")}@font-face{font-family:vollkorn;font-style:italic;font-weight:500;src:url(../fonts/vollkorn-v12-latin-ext_latin-500italic.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.svg#Vollkorn)format("svg")}@font-face{font-family:vollkorn;font-style:normal;font-weight:400;src:url(../fonts/vollkorn-v12-latin-ext_latin-regular.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-regular.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-regular.svg#Vollkorn)format("svg")}@font-face{font-family:vollkorn;font-style:normal;font-weight:500;src:url(../fonts/vollkorn-v12-latin-ext_latin-500.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-500.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-500.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-500.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-500.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-500.svg#Vollkorn)format("svg")}@font-face{font-family:vollkorn;font-style:italic;font-weight:400;src:url(../fonts/vollkorn-v12-latin-ext_latin-italic.eot);src:local(""),url(../fonts/vollkorn-v12-latin-ext_latin-italic.eot?#iefix)format("embedded-opentype"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.woff2)format("woff2"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.woff)format("woff"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.ttf)format("truetype"),url(../fonts/vollkorn-v12-latin-ext_latin-italic.svg#Vollkorn)format("svg")}@font-face{font-family:great vibes;font-style:normal;font-weight:400;src:url(../fonts/great-vibes-v7-latin-ext_latin-regular.eot);src:local("Great Vibes"),local("GreatVibes-Regular"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.eot?#iefix)format("embedded-opentype"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.woff2)format("woff2"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.woff)format("woff"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.ttf)format("truetype"),url(../fonts/great-vibes-v7-latin-ext_latin-regular.svg#GreatVibes)format("svg")}html{line-height:1.5}body{font-family:vollkorn,serif;font-weight:400;max-width:1024px;font-size:1.4rem;padding-left:3rem;padding-top:.5rem;padding-right:2rem;color:#000}#preview{display:none}sup,sub{vertical-align:baseline;position:relative;top:-.4em}sub{top:.4em}.headiter{display:flex;justify-content:space-between;border-bottom:.3rem solid red;border-top:.1rem solid red;padding-top:1rem;padding-bottom:.5rem;padding-left:1rem;padding-right:1rem;margin-bottom:1rem}a.edit-button{color:#000;text-decoration:none}a.edit-button:hover{text-decoration:underline;-webkit-text-decoration-color:red;text-decoration-color:red;font-weight:500;font-size:.97em;cursor:pointer}.header{display:grid;grid-template-columns:auto;grid-auto-flow:column;position:sticky;top:0;padding-top:.5rem;font-size:1.1rem;background-color:#fff;z-index:10}.mantlebar{display:none}.breadcrumbs{grid-column:1}.bibliotheke{width:2.4rem;grid-column:2;margin-left:auto}.bibliotheke:hover{text-decoration:none;font-size:1rem}.alsoin{font-weight:700;display:inline-flex;padding-left:.2rem;padding-right:.3rem}.ddmenu{cursor:pointer;display:inline-grid}.ddmenu input{display:none}.ddmenu li{list-style-type:none}.ddmenu .hiddendiv{display:none;margin-top:-.9rem}input:focus,select:focus,textarea:focus,label:focus,button:focus{outline:none}.ddmenu input:checked~.hiddendiv{display:block}.logolink{width:2.4rem;margin-left:auto}.sandpointlogo{border-radius:50%;border:.3em solid red;display:inline-flex;font-family:great vibes,cursive;font-size:1.2rem;font-weight:700;color:#fff;background-color:red;position:relative;padding-left:1em;padding-right:.3em;padding-bottom:1.2em;max-width:0;max-height:0}.sandpointF{position:absolute;font-size:1.2em;margin-top:-.2em;margin-left:-.4em}.sandpointN{position:absolute;font-size:.7em;margin-top:.4em;color:red;margin-left:-.5em}.sandpointC{position:absolute;font-size:1em;margin-left:-.37em}footer{display:flex;margin-bottom:1rem;margin-top:4rem}li{list-style-type:"› "}li[role=doc-endnote]{list-style-type:decimal}ol li{list-style-type:decimal}img{width:100%}.supt{display:inline-flex;flex-wrap:nowrap;font-family:great vibes,cursive;font-size:.9em;font-style:normal;color:rgba(0,0,0,.8);vertical-align:baseline;position:relative;top:-.3em}.sup{display:inline-flex;flex-wrap:nowrap;font-family:great vibes,cursive;font-size:.9em;font-style:normal;color:red;vertical-align:baseline;position:relative;top:-.3em}.sup:hover{font-weight:400!important}.nosup a{color:red}.nosup a span.sup{display:none}.syllabustitle,.coretitle{margin-top:4rem;font-style:italic;font-size:4rem;margin-bottom:4rem}.mantletitle,.crusttitle{margin-top:4rem;font-style:italic;font-size:2rem;margin-bottom:4rem}.grid{padding-left:3rem;margin-bottom:2rem;display:grid;grid-template-columns:1fr 1fr}.leftcolumn{grid-column:1;padding-right:1.2rem;position:relative}#TableOfContents{margin-left:-2rem;margin-top:-1.5rem}#TableOfContents li{list-style:decimal inside;padding-left:.5rem;color:rgba(0,0,0,.4);margin:0;padding:0}#TableOfContents li a{font-family:vollkorn;font-size:1.4rem;font-weight:500;font-style:normal}#TableOfContents>ol:first-child>span>li>a::after{content:"¶";color:rgba(0,0,0,.2);font-size:1.3em;padding-left:.1em}.rightcolumn{padding-left:.5rem}.has{display:inline-grid;grid-column:2;grid-auto-rows:max-content;font-size:1.4rem;font-style:italic;margin-bottom:.8rem}.hasauthors{font-size:1.6rem!important;display:flex}.hassup{grid-column:1;font-family:great vibes,cursive;font-size:.9em;font-style:normal;color:red;vertical-align:baseline;position:relative}.afterhas{grid-column:2}.content{margin-top:4rem;padding-left:3rem;padding-right:10rem;max-width:720px}a{color:#000;text-decoration:none}a:hover{text-decoration:underline;text-decoration-color:red;font-weight:500;font-size:.97em;cursor:pointer}h1{display:none}h2{font-weight:500;font-size:1.6rem}h3{font-weight:500;font-size:1.4rem}h4{font-weight:500;font-size:1.2rem}h5{font-weight:500;font-size:1.1rem}h6{font-weight:500;font-size:1rem}.abstract{font-style:italic;border-left:1px solid #000;margin-left:5rem;margin-right:2rem;margin-bottom:1.2rem;padding-left:1rem;padding-right:2rem;padding-top:1.2rem;padding-bottom:1.2rem;background-color:rgba(0,0,0,5%);max-width:45ch}.authors{display:inline-block;font-size:1.8rem;margin-left:5rem;margin-right:2rem;padding-left:1rem}.keywords{display:inline-block;font-size:1.2rem;margin-left:5rem;margin-right:2rem;padding-left:1rem;padding-right:2rem;margin-bottom:2.2rem;max-width:72ch}blockquote{border-left:1px red solid;margin-left:1rem;margin-right:2rem;padding-left:1rem;padding-right:2rem;padding-top:.1rem;padding-bottom:.1rem;background-color:#fff9f9}h2+p:first-letter{font-family:great vibes,cursive;color:rgba(0,0,0,.8);font-size:1.5em;line-height:0}.hx{position:relative}.hpar{position:absolute;font-size:1.7em;font-style:normal;color:rgba(0,0,0,.1);top:0;margin-top:-.4em}.smallcaps{font-family:vollkorn sc,serif;font-weight:400}body{counter-reset:h2 glossN}h2{counter-reset:h3}h3{counter-reset:h4}h4{counter-reset:h5}h5{counter-reset:h6}h2:before{color:rgba(0,0,0,.4);counter-increment:h2;content:counter(h2)". "}h3:before{color:rgba(0,0,0,.4);counter-increment:h3;content:counter(h2)"." counter(h3)". "}h4:before{color:rgba(0,0,0,.4);counter-increment:h4;content:counter(h2)"." counter(h3)"." counter(h4)". "}h5:before{color:rgba(0,0,0,.4);counter-increment:h5;content:counter(h2)"." counter(h3)"." counter(h4)"." counter(h5)". "}h6:before{color:rgba(0,0,0,.4);counter-increment:h6;content:counter(h2)"." counter(h3)"." counter(h4)"." counter(h5)"." counter(h6)". "}h2.nocount:before,h3.nocount:before,h4.nocount:before,h5.nocount:before,h6.nocount:before{content:"";counter-increment:none}details{padding-left:1rem}#toggleAllLinks{font-size:.8rem}#toggleAllLinks:hover{cursor:pointer;text-decoration:underline;text-decoration-color:red}.glosscontainer{display:grid;grid-template-columns:auto 1fr;grid-template-rows:1fr;gap:0 0;grid-template-areas:"glossnumber gloss";border-left:1px red solid;background-color:#fff9f9;padding-top:.4em;margin-top:1rem;margin-bottom:1rem;margin-left:1rem;margin-right:2rem;padding-bottom:.4em;padding-left:1rem;padding-right:2rem}.gloss{grid-area:gloss}.glossnumber{grid-area:glossnumber;padding-right:.6rem}.glossnumberAuto::before{counter-increment:glossN;content:"(" counter(glossN)")"}.glosswords{display:inline-block;padding-left:-.3rem;padding-right:1rem}.sitemap{padding-left:3rem;font-size:1.2rem}.sitemap a{color:rgba(0,0,0,.4)}.sitemap .sup{color:rgba(255,0,0,.7)}.highline a,.sitemap a:hover{color:#000}.highline .sup,.sitemap .sup:hover{color:red}.highline{font-size:1.6rem;color:#000;border-left:1px red solid;padding-left:1rem;padding-top:.1rem;padding-bottom:.1rem;background-color:#fff9f9}.svedit{display:none;margin-left:.5rem}@media(max-width:767px){html{box-sizing:border-box;max-width:767px;margin:0 auto;padding:0}body{font-size:1rem;padding-left:10px;padding-right:10px}.grid{display:inline}.coretitle{margin-top:3rem;margin-bottom:2rem;font-size:2.2rem}.leftcolumn{display:none}.has,.afterhas{font-size:1.1rem}.mantle,.crust{margin-bottom:.2em}.content{padding:0;margin:0 auto;margin-top:4rem}.hpar{display:none}.mantletitle{font-size:1.7rem}.sessiongrid{display:none}} diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/js/paged.polyfill.js b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/js/paged.polyfill.js index 1b7048a..c984974 100644 --- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/js/paged.polyfill.js +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/js/paged.polyfill.js @@ -1,3 +1,7 @@ +/** + * @license Paged.js v0.1.43 | MIT | https://gitlab.pagedmedia.org/tools/pagedjs + */ + (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : @@ -620,64 +624,87 @@ } function nodeAfter(node, limiter) { - let after = node; + if (limiter && node === limiter) { + return; + } + let significantNode = nextSignificantNode(node); + if (significantNode) { + return significantNode; + } + if (node.parentNode) { + while ((node = node.parentNode)) { + if (limiter && node === limiter) { + return; + } + significantNode = nextSignificantNode(node); + if (significantNode) { + return significantNode; + } + } + } + } - if (after.nextSibling) { - if (limiter && node === limiter) { - return; - } - after = after.nextSibling; - } else { - while (after) { - after = after.parentNode; - if (limiter && after === limiter) { - after = undefined; - break; + function nodeBefore(node, limiter) { + if (limiter && node === limiter) { + return; + } + let significantNode = previousSignificantNode(node); + if (significantNode) { + return significantNode; + } + if (node.parentNode) { + while ((node = node.parentNode)) { + if (limiter && node === limiter) { + return; } - if (after && after.nextSibling) { - after = after.nextSibling; - break; + significantNode = previousSignificantNode(node); + if (significantNode) { + return significantNode; } } } + } + + function elementAfter(node, limiter) { + let after = nodeAfter(node, limiter); + + while (after && after.nodeType !== 1) { + after = nodeAfter(after, limiter); + } return after; } - function nodeBefore(node, limiter) { - let before = node; - if (before.previousSibling) { - if (limiter && node === limiter) { - return; - } - before = before.previousSibling; - } else { - while (before) { - before = before.parentNode; - if (limiter && before === limiter) { - before = undefined; - break; - } - if (before && before.previousSibling) { - before = before.previousSibling; - break; - } - } + function elementBefore(node, limiter) { + let before = nodeBefore(node, limiter); + + while (before && before.nodeType !== 1) { + before = nodeBefore(before, limiter); } return before; } - function elementAfter(node, limiter) { - let after = nodeAfter(node); + function displayedElementAfter(node, limiter) { + let after = elementAfter(node, limiter); - while (after && after.nodeType !== 1) { - after = nodeAfter(after); + while (after && after.dataset.undisplayed) { + after = elementAfter(after); } return after; } + function displayedElementBefore(node, limiter) { + let before = elementBefore(node, limiter); + + while (before && before.dataset.undisplayed) { + before = elementBefore(before); + } + + return before; + } + function rebuildAncestors(node) { let parent, ancestor; let ancestors = []; @@ -810,15 +837,16 @@ return false; } - function needsPageBreak(node) { - if( typeof node !== "undefined" && - typeof node.dataset !== "undefined" && - (node.dataset.page || node.dataset.afterPage) - ) { - return true; + function needsPageBreak(node, previousSignificantNode) { + if (typeof node === "undefined" || !previousSignificantNode || isIgnorable(node)) { + return false; } - - return false; + if (node.dataset && node.dataset.undisplayed) { + return false; + } + const previousSignificantNodePage = previousSignificantNode.dataset ? previousSignificantNode.dataset.page : undefined; + const currentNodePage = node.dataset ? node.dataset.page : undefined; + return currentNodePage !== previousSignificantNodePage; } function *words(node) { @@ -881,7 +909,7 @@ return true; } - if (node.style.display === "none") { + if (node.style && node.style.display === "none") { return false; } @@ -1029,6 +1057,158 @@ return index; } + + /** + * Throughout, whitespace is defined as one of the characters + * "\t" TAB \u0009 + * "\n" LF \u000A + * "\r" CR \u000D + * " " SPC \u0020 + * + * This does not use Javascript's "\s" because that includes non-breaking + * spaces (and also some other characters). + */ + + /** + * Determine if a node should be ignored by the iterator functions. + * taken from https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Whitespace#Whitespace_helper_functions + * + * @param {Node} node An object implementing the DOM1 |Node| interface. + * @return {boolean} true if the node is: + * 1) A |Text| node that is all whitespace + * 2) A |Comment| node + * and otherwise false. + */ + function isIgnorable(node) { + return (node.nodeType === 8) || // A comment node + ((node.nodeType === 3) && isAllWhitespace(node)); // a text node, all whitespace + } + + /** + * Determine whether a node's text content is entirely whitespace. + * + * @param {Node} node A node implementing the |CharacterData| interface (i.e., a |Text|, |Comment|, or |CDATASection| node + * @return {boolean} true if all of the text content of |nod| is whitespace, otherwise false. + */ + function isAllWhitespace(node) { + return !(/[^\t\n\r ]/.test(node.textContent)); + } + + /** + * Version of |previousSibling| that skips nodes that are entirely + * whitespace or comments. (Normally |previousSibling| is a property + * of all DOM nodes that gives the sibling node, the node that is + * a child of the same parent, that occurs immediately before the + * reference node.) + * + * @param {ChildNode} sib The reference node. + * @return {Node|null} Either: + * 1) The closest previous sibling to |sib| that is not ignorable according to |is_ignorable|, or + * 2) null if no such node exists. + */ + function previousSignificantNode(sib) { + while ((sib = sib.previousSibling)) { + if (!isIgnorable(sib)) return sib; + } + return null; + } + + function breakInsideAvoidParentNode(node) { + while ((node = node.parentNode)) { + if (node && node.dataset && node.dataset.breakInside === "avoid") { + return node; + } + } + return null; + } + + /** + * Find a parent with a given node name. + * @param {Node} node - initial Node + * @param {string} nodeName - node name (eg. "TD", "TABLE", "STRONG"...) + * @param {Node} limiter - go up to the parent until there's no more parent or the current node is equals to the limiter + * @returns {Node|undefined} - Either: + * 1) The closest parent for a the given node name, or + * 2) undefined if no such node exists. + */ + function parentOf(node, nodeName, limiter) { + if (limiter && node === limiter) { + return; + } + if (node.parentNode) { + while ((node = node.parentNode)) { + if (limiter && node === limiter) { + return; + } + if (node.nodeName === nodeName) { + return node; + } + } + } + } + + /** + * Version of |nextSibling| that skips nodes that are entirely + * whitespace or comments. + * + * @param {ChildNode} sib The reference node. + * @return {Node|null} Either: + * 1) The closest next sibling to |sib| that is not ignorable according to |is_ignorable|, or + * 2) null if no such node exists. + */ + function nextSignificantNode(sib) { + while ((sib = sib.nextSibling)) { + if (!isIgnorable(sib)) return sib; + } + return null; + } + + function filterTree(content, func, what) { + const treeWalker = document.createTreeWalker( + content || this.dom, + what || NodeFilter.SHOW_ALL, + func ? { acceptNode: func } : null, + false + ); + + let node; + let current; + node = treeWalker.nextNode(); + while(node) { + current = node; + node = treeWalker.nextNode(); + current.parentNode.removeChild(current); + } + } + + /** + * Layout + * @class + */ + class BreakToken { + + constructor(node, offset) { + this.node = node; + this.offset = offset; + } + + equals(otherBreakToken) { + if (!otherBreakToken) { + return false; + } + if (this["node"] && otherBreakToken["node"] && + this["node"] !== otherBreakToken["node"]) { + return false; + } + if (this["offset"] && otherBreakToken["offset"] && + this["offset"] !== otherBreakToken["offset"]) { + return false; + } + return true; + } + + } + const MAX_CHARS_PER_BREAK = 1500; /** @@ -1057,13 +1237,15 @@ this.settings = options || {}; this.maxChars = this.settings.maxChars || MAX_CHARS_PER_BREAK; + this.forceRenderBreak = false; } - async renderTo(wrapper, source, breakToken, bounds=this.bounds) { + async renderTo(wrapper, source, breakToken, bounds = this.bounds) { let start = this.getStart(source, breakToken); let walker = walk(start, source); let node; + let prevNode; let done; let next; @@ -1072,8 +1254,11 @@ let length = 0; + let prevBreakToken = breakToken || new BreakToken(start); + while (!done && !newBreakToken) { next = walker.next(); + prevNode = node; node = next.value; done = next.done; @@ -1085,7 +1270,12 @@ await this.waitForImages(imgs); } - newBreakToken = this.findBreakToken(wrapper, source, bounds); + newBreakToken = this.findBreakToken(wrapper, source, bounds, prevBreakToken); + + if (newBreakToken && newBreakToken.equals(prevBreakToken)) { + console.warn("Unable to layout item: ", prevNode); + return undefined; + } return newBreakToken; } @@ -1093,7 +1283,6 @@ // Check if the rendered element has a break set if (hasRenderedContent && this.shouldBreak(node)) { - this.hooks && this.hooks.layout.trigger(wrapper, this); let imgs = wrapper.querySelectorAll("img"); @@ -1101,12 +1290,17 @@ await this.waitForImages(imgs); } - newBreakToken = this.findBreakToken(wrapper, source, bounds); + newBreakToken = this.findBreakToken(wrapper, source, bounds, prevBreakToken); if (!newBreakToken) { newBreakToken = this.breakAt(node); } + if (newBreakToken && newBreakToken.equals(prevBreakToken)) { + console.warn("Unable to layout item: ", node); + return undefined; + } + length = 0; break; @@ -1129,6 +1323,21 @@ walker = walk(nodeAfter(node, source), source); } + if (this.forceRenderBreak) { + this.hooks && this.hooks.layout.trigger(wrapper, this); + + newBreakToken = this.findBreakToken(wrapper, source, bounds, prevBreakToken); + + if (!newBreakToken) { + newBreakToken = this.breakAt(node); + } + + length = 0; + this.forceRenderBreak = false; + + break; + } + // Only check x characters if (length >= this.maxChars) { @@ -1139,7 +1348,12 @@ await this.waitForImages(imgs); } - newBreakToken = this.findBreakToken(wrapper, source, bounds); + newBreakToken = this.findBreakToken(wrapper, source, bounds, prevBreakToken); + + if (newBreakToken && newBreakToken.equals(prevBreakToken)) { + console.warn("Unable to layout item: ", node); + return undefined; + } if (newBreakToken) { length = 0; @@ -1151,15 +1365,23 @@ return newBreakToken; } - breakAt(node, offset=0) { - return { + breakAt(node, offset = 0) { + let newBreakToken = new BreakToken( node, offset - }; + ); + let breakHooks = this.hooks.onBreakToken.triggerSync(newBreakToken, undefined, node, this); + breakHooks.forEach((newToken) => { + if (typeof newToken != "undefined") { + newBreakToken = newToken; + } + }); + + return newBreakToken; } shouldBreak(node) { - let previousSibling = node.previousSibling; + let previousSibling = previousSignificantNode(node); let parentNode = node.parentNode; let parentBreakBefore = needsBreakBefore(node) && parentNode && !previousSibling && needsBreakBefore(parentNode); let doubleBreakBefore; @@ -1168,7 +1390,11 @@ doubleBreakBefore = node.dataset.breakBefore === parentNode.dataset.breakBefore; } - return !doubleBreakBefore && needsBreakBefore(node) || needsPreviousBreakAfter(node) || needsPageBreak(node); + return !doubleBreakBefore && needsBreakBefore(node) || needsPreviousBreakAfter(node) || needsPageBreak(node, previousSibling); + } + + forceBreak() { + this.forceRenderBreak = true; } getStart(source, breakToken) { @@ -1184,7 +1410,7 @@ return start; } - append(node, dest, breakToken, shallow=true, rebuild=true) { + append(node, dest, breakToken, shallow = true, rebuild = true) { let clone = cloneNode(node, !shallow); @@ -1215,7 +1441,7 @@ dest.appendChild(clone); } - let nodeHooks = this.hooks.renderNode.triggerSync(clone, node); + let nodeHooks = this.hooks.renderNode.triggerSync(clone, node, this); nodeHooks.forEach((newNode) => { if (typeof newNode != "undefined") { clone = newNode; @@ -1235,16 +1461,16 @@ async awaitImageLoaded(image) { return new Promise(resolve => { if (image.complete !== true) { - image.onload = function() { - let { width, height } = window.getComputedStyle(image); + image.onload = function () { + let {width, height} = window.getComputedStyle(image); resolve(width, height); }; - image.onerror = function(e) { - let { width, height } = window.getComputedStyle(image); + image.onerror = function (e) { + let {width, height} = window.getComputedStyle(image); resolve(width, height, e); }; } else { - let { width, height } = window.getComputedStyle(image); + let {width, height} = window.getComputedStyle(image); resolve(width, height); } }); @@ -1264,7 +1490,7 @@ break; } - if(window.getComputedStyle(node)["break-inside"] === "avoid") { + if (window.getComputedStyle(node)["break-inside"] === "avoid") { breakNode = node; break; } @@ -1286,7 +1512,11 @@ if (!renderedNode) { // Find closest element with data-ref - renderedNode = findElement(prevValidNode(temp), rendered); + let prevNode = prevValidNode(temp); + if (!isElement(prevNode)) { + prevNode = prevNode.parentElement; + } + renderedNode = findElement(prevNode, rendered); // Check if temp is the last rendered node at its level. if (!temp.nextSibling) { // We need to ensure that the previous sibling of temp is fully rendered. @@ -1294,7 +1524,7 @@ const walker = document.createTreeWalker(renderedNodeFromSource, NodeFilter.SHOW_ELEMENT); const lastChildOfRenderedNodeFromSource = walker.lastChild(); const lastChildOfRenderedNodeMatchingFromRendered = findElement(lastChildOfRenderedNodeFromSource, rendered); - // Check if we found that the last child in source + // Check if we found that the last child in source if (!lastChildOfRenderedNodeMatchingFromRendered) { // Pending content to be rendered before virtual break token return; @@ -1318,8 +1548,14 @@ parent = findElement(renderedNode, source); index = indexOfTextNode(temp, parent); - node = child(parent, index); - offset = 0; + // No seperatation for the first textNode of an element + if(index === 0) { + node = parent; + offset = 0; + } else { + node = child(parent, index); + offset = 0; + } } } else { renderedNode = findElement(container.parentNode, rendered); @@ -1344,14 +1580,14 @@ return; } - return { + return new BreakToken( node, offset - }; + ); } - findBreakToken(rendered, source, bounds=this.bounds, extract=true) { + findBreakToken(rendered, source, bounds = this.bounds, prevBreakToken, extract = true) { let overflow = this.findOverflow(rendered, bounds); let breakToken, breakLetter; @@ -1365,12 +1601,6 @@ if (overflow) { breakToken = this.createBreakToken(overflow, rendered, source); // breakToken is nullable - if (breakToken && breakToken["node"] && breakToken["offset"] && breakToken["node"].textContent) { - breakLetter = breakToken["node"].textContent.charAt(breakToken["offset"]); - } else { - breakLetter = undefined; - } - let breakHooks = this.hooks.onBreakToken.triggerSync(breakToken, overflow, rendered, this); breakHooks.forEach((newToken) => { if (typeof newToken != "undefined") { @@ -1378,6 +1608,16 @@ } }); + // Stop removal if we are in a loop + if (breakToken && breakToken.equals(prevBreakToken)) { + return breakToken; + } + + if (breakToken && breakToken["node"] && breakToken["offset"] && breakToken["node"].textContent) { + breakLetter = breakToken["node"].textContent.charAt(breakToken["offset"]); + } else { + breakLetter = undefined; + } if (breakToken && breakToken.node && extract) { this.removeOverflow(overflow, breakLetter); @@ -1387,18 +1627,18 @@ return breakToken; } - hasOverflow(element, bounds=this.bounds) { + hasOverflow(element, bounds = this.bounds) { let constrainingElement = element && element.parentNode; // this gets the element, instead of the wrapper for the width workaround - let { width } = element.getBoundingClientRect(); + let {width} = element.getBoundingClientRect(); let scrollWidth = constrainingElement ? constrainingElement.scrollWidth : 0; return Math.max(Math.floor(width), scrollWidth) > Math.round(bounds.width); } - findOverflow(rendered, bounds=this.bounds) { + findOverflow(rendered, bounds = this.bounds) { if (!this.hasOverflow(rendered, bounds)) return; let start = Math.round(bounds.left); - let end = Math.round(bounds.right); + let end = Math.round(bounds.right); let range; let walker = walk(rendered.firstChild, rendered); @@ -1423,7 +1663,12 @@ // Check if it is a float let isFloat = false; - if (isElement(node) ) { + // Check if the node is inside a break-inside: avoid table cell + const insideTableCell = parentOf(node, "TD", rendered); + if (insideTableCell && window.getComputedStyle(insideTableCell)["break-inside"] === "avoid") { + // breaking inside a table cell produces unexpected result, as a workaround, we forcibly avoid break inside in a cell. + prev = insideTableCell; + } else if (isElement(node)) { let styles = window.getComputedStyle(node); isFloat = styles.getPropertyValue("float") !== "none"; skip = styles.getPropertyValue("break-inside") === "avoid"; @@ -1434,27 +1679,27 @@ if (prev) { range = document.createRange(); - range.setStartBefore(prev); + range.selectNode(prev); break; } if (!br && !isFloat && isElement(node)) { range = document.createRange(); - range.setStartBefore(node); + range.selectNode(node); break; } if (isText(node) && node.textContent.trim().length) { range = document.createRange(); - range.setStartBefore(node); + range.selectNode(node); break; } } if (!range && isText(node) && - node.textContent.trim().length && - window.getComputedStyle(node.parentNode)["break-inside"] !== "avoid") { + node.textContent.trim().length && + !breakInsideAvoidParentNode(node.parentNode)) { let rects = getClientRects(node); let rect; @@ -1466,7 +1711,7 @@ } } - if(left >= end) { + if (left >= end) { range = document.createRange(); offset = this.textBreak(node, start, end); if (!offset) { @@ -1498,7 +1743,7 @@ } - findEndToken(rendered, source, bounds=this.bounds) { + findEndToken(rendered, source, bounds = this.bounds) { if (rendered.childNodes.length === 0) { return; } @@ -1510,7 +1755,7 @@ if (!validNode(lastChild)) { // Only get elements with refs lastChild = lastChild.previousSibling; - } else if(!validNode(lastChild.lastChild)) { + } else if (!validNode(lastChild.lastChild)) { // Deal with invalid dom items lastChild = prevValidNode(lastChild.lastChild); break; @@ -1607,18 +1852,31 @@ hyphenateAtBreak(startContainer, breakLetter) { if (isText(startContainer)) { let startText = startContainer.textContent; - let prevLetter = startText[startText.length-1]; + let prevLetter = startText[startText.length - 1]; // Add a hyphen if previous character is a letter or soft hyphen if ( - (breakLetter && /^\w|\u00AD$/.test(prevLetter) && /^\w|\u00AD$/.test(breakLetter)) || - (!breakLetter && /^\w|\u00AD$/.test(prevLetter)) + (breakLetter && /^\w|\u00AD$/.test(prevLetter) && /^\w|\u00AD$/.test(breakLetter)) || + (!breakLetter && /^\w|\u00AD$/.test(prevLetter)) ) { startContainer.parentNode.classList.add("pagedjs_hyphen"); startContainer.textContent += this.settings.hyphenGlyph || "\u2011"; } } } + + equalTokens(a, b) { + if (!a || !b) { + return false; + } + if (a["node"] && b["node"] && a["node"] !== b["node"]) { + return false; + } + if (a["offset"] && b["offset"] && a["offset"] !== b["offset"]) { + return false; + } + return true; + } } eventEmitter(Layout.prototype); @@ -1693,7 +1951,7 @@ let page = this.element; // let pagebox = this.pagebox; - let index = pgnum+1; + let index = pgnum + 1; let id = `page-${index}`; @@ -1748,7 +2006,7 @@ this.layoutMethod = new Layout(this.area, this.hooks, maxChars); let newBreakToken = await this.layoutMethod.renderTo(this.wrapper, contents, breakToken); - + this.addListeners(contents); this.endToken = newBreakToken; @@ -1773,7 +2031,7 @@ let e; for (var i = 0; i < entries.length; i++) { e = entries[i]; - if(e.dataset.ref === ref) { + if (e.dataset.ref === ref) { return e; } } @@ -1803,8 +2061,8 @@ } // TODO: fall back to mutation observer? - this._onScroll = function() { - if(this.listening) { + this._onScroll = function () { + if (this.listening) { this.element.scrollLeft = 0; } }.bind(this); @@ -1827,30 +2085,31 @@ this.element.removeEventListener("underflow", this._checkOverflowAfterResize, false); } - this.element &&this.element.removeEventListener("scroll", this._onScroll); + this.element && this.element.removeEventListener("scroll", this._onScroll); } addResizeObserver(contents) { let wrapper = this.wrapper; let prevHeight = wrapper.getBoundingClientRect().height; - this.ro = new ResizeObserver( entries => { + this.ro = new ResizeObserver(entries => { if (!this.listening) { return; } + requestAnimationFrame(() => { + for (let entry of entries) { + const cr = entry.contentRect; - for (let entry of entries) { - const cr = entry.contentRect; - - if (cr.height > prevHeight) { - this.checkOverflowAfterResize(contents); - prevHeight = wrapper.getBoundingClientRect().height; - } else if (cr.height < prevHeight ) { // TODO: calc line height && (prevHeight - cr.height) >= 22 - this.checkUnderflowAfterResize(contents); - prevHeight = cr.height; + if (cr.height > prevHeight) { + this.checkOverflowAfterResize(contents); + prevHeight = wrapper.getBoundingClientRect().height; + } else if (cr.height < prevHeight) { // TODO: calc line height && (prevHeight - cr.height) >= 22 + this.checkUnderflowAfterResize(contents); + prevHeight = cr.height; + } } - } + }); }); this.ro.observe(wrapper); @@ -1861,7 +2120,7 @@ return; } - let newBreakToken = this.layoutMethod.findBreakToken(this.wrapper, contents); + let newBreakToken = this.layoutMethod.findBreakToken(this.wrapper, contents, this.startToken); if (newBreakToken) { this.endToken = newBreakToken; @@ -1876,8 +2135,6 @@ let endToken = this.layoutMethod.findEndToken(this.wrapper, contents); - // let newBreakToken = this.layoutMethod.findBreakToken(this.wrapper, contents); - if (endToken) { this._onUnderflow && this._onUnderflow(endToken); } @@ -1918,7 +2175,6 @@ let fragment = range.createContextualFragment(markup); this.addRefs(fragment); - this.removeEmpty(fragment); return fragment; } @@ -1933,7 +2189,6 @@ // } this.addRefs(contents); - this.removeEmpty(contents); return contents; } @@ -1942,7 +2197,7 @@ var treeWalker = document.createTreeWalker( content, NodeFilter.SHOW_ELEMENT, - { acceptNode: function(node) { return NodeFilter.FILTER_ACCEPT; } }, + null, false ); @@ -1965,62 +2220,10 @@ } } - removeEmpty(content) { - var treeWalker = document.createTreeWalker( - content, - NodeFilter.SHOW_TEXT, - { acceptNode: function(node) { - // Only remove more than a single space - if (node.textContent.length > 1 && !node.textContent.trim()) { - - // Don't touch whitespace if text is preformated - let parent = node.parentNode; - let pre = isElement(parent) && parent.closest("pre"); - if (pre) { - return NodeFilter.FILTER_REJECT; - } - - return NodeFilter.FILTER_ACCEPT; - } else { - return NodeFilter.FILTER_REJECT; - } - } }, - false - ); - - let node; - let current; - node = treeWalker.nextNode(); - while(node) { - current = node; - node = treeWalker.nextNode(); - // if (!current.nextSibling || (current.nextSibling && current.nextSibling.nodeType === 1)) { - current.parentNode.removeChild(current); - // } - } - } - find(ref) { return this.refs[ref]; } - // isWrapper(element) { - // return wrappersRegex.test(element.nodeName); - // } - - isText(node) { - return node.tagName === "TAG"; - } - - isElement(node) { - return node.nodeType === 1; - } - - hasChildren(node) { - return node.childNodes && node.childNodes.length; - } - - destroy() { this.refs = undefined; this.dom = undefined; @@ -2313,6 +2516,7 @@ this.hooks = {}; this.hooks.beforeParsed = new Hook(this); + this.hooks.filter = new Hook(this); this.hooks.afterParsed = new Hook(this); this.hooks.beforePageLayout = new Hook(this); this.hooks.layout = new Hook(this); @@ -2362,6 +2566,8 @@ parsed = new ContentParser(content); + this.hooks.filter.triggerSync(parsed); + this.source = parsed; this.breakToken = undefined; @@ -2372,7 +2578,7 @@ this.setup(renderTo); } - this.emit("rendering", content); + this.emit("rendering", parsed); await this.hooks.afterParsed.trigger(parsed, this); @@ -2385,7 +2591,7 @@ } this.rendered = true; - this.pagesArea.style.setProperty("--pagedjs-page-count", this.total); + this.pagesArea.style.setProperty("--pagedjs-page-count", this.total); await this.hooks.afterRendered.trigger(this.pages, this); @@ -2429,7 +2635,6 @@ let done = false; let result; - while (!done) { result = await this.q.enqueue(() => { return this.renderAsync(renderer); }); done = result.done; @@ -25494,6 +25699,10 @@ --pagedjs-padding-right: 0mm; --pagedjs-padding-bottom: 0mm; --pagedjs-padding-left: 0mm; + --pagedjs-border-top: 0mm; + --pagedjs-border-right: 0mm; + --pagedjs-border-bottom: 0mm; + --pagedjs-border-left: 0mm; --pagedjs-bleed-top: 0mm; --pagedjs-bleed-right: 0mm; --pagedjs-bleed-bottom: 0mm; @@ -25513,6 +25722,7 @@ --pagedjs-mark-cross-display: none; --pagedjs-mark-crop-display: none; --pagedjs-page-count: 0; + --pagedjs-page-counter-increment: 1; } @page { @@ -25581,6 +25791,7 @@ display: var(--pagedjs-mark-crop-display); flex-grow: 0; flex-shrink: 0; + z-index: 9999999999; } .pagedjs_bleed-top .pagedjs_marks-crop:nth-child(1), @@ -25836,8 +26047,11 @@ grid-row: page; width: 100%; height: 100%; - padding: var(--pagedjs-padding-top) var(--pagedjs-padding-right) var(--pagedjs-padding-bottom) var(--pagedjs-padding-left) - + padding: var(--pagedjs-padding-top) var(--pagedjs-padding-right) var(--pagedjs-padding-bottom) var(--pagedjs-padding-left); + border-top: var(--pagedjs-border-top); + border-right: var(--pagedjs-border-right); + border-bottom: var(--pagedjs-border-bottom); + border-left: var(--pagedjs-border-left); } .pagedjs_pagebox > .pagedjs_area > .pagedjs_page_content { @@ -25848,19 +26062,17 @@ } .pagedjs_page { - counter-increment: page; + counter-increment: page var(--pagedjs-page-counter-increment); width: var(--pagedjs-width); height: var(--pagedjs-height); } .pagedjs_page.pagedjs_right_page { - counter-increment: page; width: var(--pagedjs-width-right); height: var(--pagedjs-height-right); } .pagedjs_page.pagedjs_left_page { - counter-increment: page; width: var(--pagedjs-width-left); height: var(--pagedjs-height-left); } @@ -25869,7 +26081,6 @@ counter-reset: pages var(--pagedjs-page-count); } - .pagedjs_pagebox .pagedjs_margin-top-left-corner, .pagedjs_pagebox .pagedjs_margin-top-right-corner, .pagedjs_pagebox .pagedjs_margin-bottom-left-corner, @@ -26037,10 +26248,6 @@ content: none !important; } -img { - height: auto; -} - [data-align-last-split-element='justify'] { text-align-last: justify; } @@ -26426,7 +26633,6 @@ img { this.width = undefined; this.height = undefined; this.orientation = undefined; - this.marginalia = {}; } @@ -26440,18 +26646,25 @@ img { width: undefined, height: undefined, orientation: undefined, - margin : { + margin: { top: {}, right: {}, left: {}, bottom: {} }, - padding : { + padding: { top: {}, right: {}, left: {}, bottom: {} }, + border: { + top: {}, + right: {}, + left: {}, + bottom: {} + }, + backgroundOrigin: undefined, block: {}, marks: undefined }; @@ -26497,7 +26710,7 @@ img { page.marginalia = marginalia; } - let declarations = this.replaceDeclartations(node); + let declarations = this.replaceDeclarations(node); if (declarations.size) { page.size = declarations.size; @@ -26564,6 +26777,10 @@ img { page.padding = declarations.padding; } + if (declarations.border) { + page.border = declarations.border; + } + if (declarations.marks) { page.marks = declarations.marks; } @@ -26606,15 +26823,15 @@ img { let bleedrecto = undefined; if (":left" in this.pages) { - bleedverso = this.pages[":left"].bleed; - } + bleedverso = this.pages[":left"].bleed; + } - if (":right" in this.pages) { - bleedrecto = this.pages[":right"].bleed; - } + if (":right" in this.pages) { + bleedrecto = this.pages[":right"].bleed; + } if ((width && height) && - (this.width !== width || this.height !== height)) { + (this.width !== width || this.height !== height)) { this.width = width; this.height = height; this.format = format; @@ -26702,7 +26919,7 @@ img { return parsed; } - replaceDeclartations(ast) { + replaceDeclarations(ast) { let parsed = {}; lib.walk(ast.block, { @@ -26737,7 +26954,7 @@ img { parsed.margin[m] = declaration.value.children.first(); dList.remove(dItem); - } else if (prop === "padding"){ + } else if (prop === "padding") { parsed.padding = this.getPaddings(declaration.value); dList.remove(dItem); @@ -26753,8 +26970,43 @@ img { } parsed.padding[p] = declaration.value.children.first(); dList.remove(dItem); + } - } else if (prop === "size") { + else if (prop === "border") { + if (!parsed.border) { + parsed.border = { + top: {}, + right: {}, + left: {}, + bottom: {} + }; + } + parsed.border.top = lib.generate(declaration.value); + parsed.border.right = lib.generate(declaration.value); + parsed.border.left = lib.generate(declaration.value); + parsed.border.bottom = lib.generate(declaration.value); + + dList.remove(dItem); + + } + + else if (prop.indexOf("border-") === 0) { + if (!parsed.border) { + parsed.border = { + top: {}, + right: {}, + left: {}, + bottom: {} + }; + } + let p = prop.substring("border-".length); + + parsed.border[p] = lib.generate(declaration.value); + dList.remove(dItem); + + } + + else if (prop === "size") { parsed.size = this.getSize(declaration); dList.remove(dItem); } else if (prop === "bleed") { @@ -26780,7 +27032,7 @@ img { unit: "px" }); break; - // ignore + // ignore } } @@ -26793,8 +27045,8 @@ img { }); return parsed; - } + } getSize(declaration) { let width, height, orientation, format; @@ -26802,7 +27054,7 @@ img { lib.walk(declaration, { visit: "Dimension", enter: (node, item, list) => { - let {value, unit} = node; + let { value, unit } = node; if (typeof width === "undefined") { width = { value, unit }; } else if (typeof height === "undefined") { @@ -26860,9 +27112,16 @@ img { }; lib.walk(declaration, { - visit: "Dimension", - enter: (node, item, list) => { - margins.push(node); + enter: (node) => { + switch (node.type) { + case "Dimension": // margin: 1in 2in, margin: 20px, etc... + margins.push(node); + break; + case "Number": // margin: 0 + margins.push({value: node.value, unit: "px"}); + break; + // ignore + } } }); @@ -26900,9 +27159,16 @@ img { }; lib.walk(declaration, { - visit: "Dimension", - enter: (node, item, list) => { - paddings.push(node); + enter: (node) => { + switch (node.type) { + case "Dimension": // padding: 1in 2in, padding: 20px, etc... + paddings.push(node); + break; + case "Number": // padding: 0 + paddings.push({value: node.value, unit: "px"}); + break; + // ignore + } } }); if (paddings.length === 1) { @@ -26930,50 +27196,79 @@ img { } return padding; } + + // get values for the border on the @page to pass them to the element with the .pagedjs_area class + getBorders(declaration) { + let border = { + top: {}, + right: {}, + left: {}, + bottom: {} + }; + + if (declaration.prop == "border") { + border.top = lib.generate(declaration.value); + border.right = lib.generate(declaration.value); + border.bottom = lib.generate(declaration.value); + border.left = lib.generate(declaration.value); + + } + else if (declaration.prop == "border-top") { + border.top = lib.generate(declaration.value); + } + else if (declaration.prop == "border-right") { + border.right = lib.generate(declaration.value); + + } + else if (declaration.prop == "border-bottom") { + border.bottom = lib.generate(declaration.value); + + } + else if (declaration.prop == "border-left") { + border.left = lib.generate(declaration.value); + } + + return border; + } + + addPageClasses(pages, ast, sheet) { // First add * page - if ("*" in pages && !pages["*"].added) { + if ("*" in pages) { let p = this.createPage(pages["*"], ast.children, sheet); sheet.insertRule(p); - pages["*"].added = true; } // Add :left & :right - if (":left" in pages && !pages[":left"].added) { + if (":left" in pages) { let left = this.createPage(pages[":left"], ast.children, sheet); sheet.insertRule(left); - pages[":left"].added = true; } - if (":right" in pages && !pages[":right"].added) { + if (":right" in pages) { let right = this.createPage(pages[":right"], ast.children, sheet); sheet.insertRule(right); - pages[":right"].added = true; } // Add :first & :blank - if (":first" in pages && !pages[":first"].first) { + if (":first" in pages) { let first = this.createPage(pages[":first"], ast.children, sheet); sheet.insertRule(first); - pages[":first"].added = true; } - if (":blank" in pages && !pages[":blank"].added) { + if (":blank" in pages) { let blank = this.createPage(pages[":blank"], ast.children, sheet); sheet.insertRule(blank); - pages[":blank"].added = true; } // Add nth pages for (let pg in pages) { - if (pages[pg].nth && !pages[pg].added) { + if (pages[pg].nth) { let nth = this.createPage(pages[pg], ast.children, sheet); sheet.insertRule(nth); - pages[pg].added = true; } } // Add named pages for (let pg in pages) { - if (pages[pg].name && !pages[pg].added) { + if (pages[pg].name) { let named = this.createPage(pages[pg], ast.children, sheet); sheet.insertRule(named); - pages[pg].added = true; } } @@ -26988,11 +27283,14 @@ img { loc: 0, children: children }; + + let rule = this.createRule(selectors, block); this.addMarginVars(page.margin, children, children.first()); - this.addPaddingVars(page.padding, children, children.first()); + this.addBorderVars(page.border, children, children.first()); + if (page.width) { this.addDimensions(page.width, page.height, page.orientation, children, children.first()); @@ -27002,7 +27300,6 @@ img { this.addMarginaliaStyles(page, ruleList, rule, sheet); this.addMarginaliaContent(page, ruleList, rule, sheet); } - return rule; } @@ -27020,6 +27317,7 @@ img { } }); list.append(mVar, item); + } } } @@ -27027,6 +27325,7 @@ img { addPaddingVars(padding, list, item) { // variables for padding for (let p in padding) { + if (typeof padding[p].value !== "undefined") { let value = padding[p].value + (padding[p].unit || ""); let pVar = list.createItem({ @@ -27044,6 +27343,25 @@ img { } } + addBorderVars(border, list, item) { + // variables for borders + for (let b in border) { + if (typeof border[b] !== "undefined") { + let value = border[b]; + let bVar = list.createItem({ + type: "Declaration", + property: "--pagedjs-border-" + b, + value: { + type: "Raw", + value: value + } + }); + list.append(bVar, item); + } + + } + } + addDimensions(width, height, orientation, list, item) { let widthString, heightString; @@ -27074,7 +27392,7 @@ img { let block = lib.clone(page.marginalia[loc]); let hasContent = false; - if(block.children.isEmpty()) { + if (block.children.isEmpty()) { continue; } @@ -27108,11 +27426,11 @@ img { if (node.property === "width" && (loc === "top-left" || - loc === "top-center" || - loc === "top-right" || - loc === "bottom-left" || - loc === "bottom-center" || - loc === "bottom-right")) { + loc === "top-center" || + loc === "top-right" || + loc === "bottom-left" || + loc === "bottom-center" || + loc === "bottom-right")) { let c = lib.clone(node); c.property = "max-width"; list.appendData(c); @@ -27120,11 +27438,11 @@ img { if (node.property === "height" && (loc === "left-top" || - loc === "left-middle" || - loc === "left-bottom" || - loc === "right-top" || - loc === "right-middle" || - loc === "right-bottom")) { + loc === "left-middle" || + loc === "left-bottom" || + loc === "right-top" || + loc === "right-middle" || + loc === "right-bottom")) { let c = lib.clone(node); c.property = "max-height"; list.appendData(c); @@ -27170,7 +27488,7 @@ img { } }); - if(content.children.isEmpty()) { + if (content.children.isEmpty()) { continue; } @@ -27282,7 +27600,7 @@ img { bleedLeftRecto = this.createVariable("--pagedjs-bleed-right-left", CSSValueToString(bleedrecto.left)); widthStringRight = `calc( ${CSSValueToString(width)} + ${CSSValueToString(bleedrecto.left)} + ${CSSValueToString(bleedrecto.right)} )`; - heightStringRight = `calc( ${CSSValueToString(height)} + ${CSSValueToString(bleedrecto.top)} + ${CSSValueToString(bleedrecto.bottom)} )`; + heightStringRight = `calc( ${CSSValueToString(height)} + ${CSSValueToString(bleedrecto.top)} + ${CSSValueToString(bleedrecto.bottom)} )`; } if (bleedverso) { bleedTopVerso = this.createVariable("--pagedjs-bleed-left-top", CSSValueToString(bleedverso.top)); @@ -27291,18 +27609,18 @@ img { bleedLeftVerso = this.createVariable("--pagedjs-bleed-left-left", CSSValueToString(bleedverso.left)); widthStringLeft = `calc( ${CSSValueToString(width)} + ${CSSValueToString(bleedverso.left)} + ${CSSValueToString(bleedverso.right)} )`; - heightStringLeft = `calc( ${CSSValueToString(height)} + ${CSSValueToString(bleedverso.top)} + ${CSSValueToString(bleedverso.bottom)} )`; + heightStringLeft = `calc( ${CSSValueToString(height)} + ${CSSValueToString(bleedverso.top)} + ${CSSValueToString(bleedverso.bottom)} )`; } let pageWidthVar = this.createVariable("--pagedjs-width", CSSValueToString(width)); let pageHeightVar = this.createVariable("--pagedjs-height", CSSValueToString(height)); rules.push( - bleedTop, - bleedRight, - bleedBottom, - bleedLeft, - bleedTopRecto, + bleedTop, + bleedRight, + bleedBottom, + bleedLeft, + bleedTopRecto, bleedRightRecto, bleedBottomRecto, bleedLeftRecto, @@ -27310,7 +27628,7 @@ img { bleedRightVerso, bleedBottomVerso, bleedLeftVerso, - pageWidthVar, + pageWidthVar, pageHeightVar ); } @@ -27957,6 +28275,7 @@ img { if (start) { this.addPageAttributes(page, start, chunker.pages); } + // page.element.querySelector('.paged_area').style.color = red; } afterPageLayout(fragment, page, breakToken, chunker) { @@ -27995,14 +28314,14 @@ img { if (centerContent) { centerWidth = window.getComputedStyle(center)["max-width"]; - if(centerWidth === "none" || centerWidth === "auto") { - if(!leftContent && !rightContent){ + if (centerWidth === "none" || centerWidth === "auto") { + if (!leftContent && !rightContent) { marginGroup.style["grid-template-columns"] = "0 1fr 0"; - }else if(leftContent){ - if(!rightContent){ - if(leftWidth !== "none" && leftWidth !== "auto"){ + } else if (leftContent) { + if (!rightContent) { + if (leftWidth !== "none" && leftWidth !== "auto") { marginGroup.style["grid-template-columns"] = leftWidth + " 1fr " + leftWidth; - }else { + } else { marginGroup.style["grid-template-columns"] = "auto auto 1fr"; left.style["white-space"] = "nowrap"; center.style["white-space"] = "nowrap"; @@ -28014,17 +28333,17 @@ img { left.style["white-space"] = "normal"; center.style["white-space"] = "normal"; } - }else { - if(leftWidth !== "none" && leftWidth !== "auto"){ - if(rightWidth !== "none" && rightWidth !== "auto"){ + } else { + if (leftWidth !== "none" && leftWidth !== "auto") { + if (rightWidth !== "none" && rightWidth !== "auto") { marginGroup.style["grid-template-columns"] = leftWidth + " 1fr " + rightWidth; - }else { + } else { marginGroup.style["grid-template-columns"] = leftWidth + " 1fr " + leftWidth; } - }else { - if(rightWidth !== "none" && rightWidth !== "auto"){ + } else { + if (rightWidth !== "none" && rightWidth !== "auto") { marginGroup.style["grid-template-columns"] = rightWidth + " 1fr " + rightWidth; - }else { + } else { marginGroup.style["grid-template-columns"] = "auto auto 1fr"; left.style["white-space"] = "nowrap"; center.style["white-space"] = "nowrap"; @@ -28034,9 +28353,9 @@ img { let rightOuterWidth = right.offsetWidth; let outerwidths = leftOuterWidth + centerOuterWidth + rightOuterWidth; let newcenterWidth = centerOuterWidth * 100 / outerwidths; - if(newcenterWidth > 40){ + if (newcenterWidth > 40) { marginGroup.style["grid-template-columns"] = "minmax(16.66%, 1fr) minmax(33%, " + newcenterWidth + "%) minmax(16.66%, 1fr)"; - }else { + } else { marginGroup.style["grid-template-columns"] = "repeat(3, 1fr)"; } left.style["white-space"] = "normal"; @@ -28045,10 +28364,10 @@ img { } } } - }else { - if(rightWidth !== "none" && rightWidth !== "auto"){ + } else { + if (rightWidth !== "none" && rightWidth !== "auto") { marginGroup.style["grid-template-columns"] = rightWidth + " 1fr " + rightWidth; - }else { + } else { marginGroup.style["grid-template-columns"] = "auto auto 1fr"; right.style["white-space"] = "nowrap"; center.style["white-space"] = "nowrap"; @@ -28061,32 +28380,32 @@ img { center.style["white-space"] = "normal"; } } - }else if(centerWidth !== "none" && centerWidth !== "auto"){ - if(leftContent && leftWidth !== "none" && leftWidth !== "auto"){ + } else if (centerWidth !== "none" && centerWidth !== "auto") { + if (leftContent && leftWidth !== "none" && leftWidth !== "auto") { marginGroup.style["grid-template-columns"] = leftWidth + " " + centerWidth + " 1fr"; - }else if(rightContent && rightWidth !== "none" && rightWidth !== "auto"){ + } else if (rightContent && rightWidth !== "none" && rightWidth !== "auto") { marginGroup.style["grid-template-columns"] = "1fr " + centerWidth + " " + rightWidth; - }else { + } else { marginGroup.style["grid-template-columns"] = "1fr " + centerWidth + " 1fr"; } } - }else { - if(leftContent){ - if(!rightContent){ + } else { + if (leftContent) { + if (!rightContent) { marginGroup.style["grid-template-columns"] = "1fr 0 0"; - }else { - if(leftWidth !== "none" && leftWidth !== "auto"){ - if(rightWidth !== "none" && rightWidth !== "auto"){ + } else { + if (leftWidth !== "none" && leftWidth !== "auto") { + if (rightWidth !== "none" && rightWidth !== "auto") { marginGroup.style["grid-template-columns"] = leftWidth + " 1fr " + rightWidth; - }else { + } else { marginGroup.style["grid-template-columns"] = leftWidth + " 0 1fr"; } - }else { - if(rightWidth !== "none" && rightWidth !== "auto"){ + } else { + if (rightWidth !== "none" && rightWidth !== "auto") { marginGroup.style["grid-template-columns"] = "1fr 0 " + rightWidth; - }else { + } else { marginGroup.style["grid-template-columns"] = "auto 1fr auto"; left.style["white-space"] = "nowrap"; right.style["white-space"] = "nowrap"; @@ -28094,16 +28413,16 @@ img { let rightOuterWidth = right.offsetWidth; let outerwidths = leftOuterWidth + rightOuterWidth; let newLeftWidth = leftOuterWidth * 100 / outerwidths; - marginGroup.style["grid-template-columns"] = "minmax(16.66%, " + newLeftWidth + "%) 0 1fr"; + marginGroup.style["grid-template-columns"] = "minmax(16.66%, " + newLeftWidth + "%) 0 1fr"; left.style["white-space"] = "normal"; right.style["white-space"] = "normal"; } } } - }else { - if(rightWidth !== "none" && rightWidth !== "auto"){ + } else { + if (rightWidth !== "none" && rightWidth !== "auto") { marginGroup.style["grid-template-columns"] = "1fr 0 " + rightWidth; - }else { + } else { marginGroup.style["grid-template-columns"] = "0 0 1fr"; } } @@ -28131,66 +28450,66 @@ img { if (middle) { middleHeight = window.getComputedStyle(middle)["max-height"]; - if(middleHeight === "none" || middleHeight === "auto") { - if(!topContent && !bottomContent){ + if (middleHeight === "none" || middleHeight === "auto") { + if (!topContent && !bottomContent) { marginGroup.style["grid-template-rows"] = "0 1fr 0"; - }else if(topContent){ - if(!bottomContent){ - if(topHeight !== "none" && topHeight !== "auto"){ + } else if (topContent) { + if (!bottomContent) { + if (topHeight !== "none" && topHeight !== "auto") { marginGroup.style["grid-template-rows"] = topHeight + " calc(100% - " + topHeight + "*2) " + topHeight; } - }else { - if(topHeight !== "none" && topHeight !== "auto"){ - if(bottomHeight !== "none" && bottomHeight !== "auto"){ + } else { + if (topHeight !== "none" && topHeight !== "auto") { + if (bottomHeight !== "none" && bottomHeight !== "auto") { marginGroup.style["grid-template-rows"] = topHeight + " calc(100% - " + topHeight + " - " + bottomHeight + ") " + bottomHeight; - }else { + } else { marginGroup.style["grid-template-rows"] = topHeight + " calc(100% - " + topHeight + "*2) " + topHeight; } - }else { - if(bottomHeight !== "none" && bottomHeight !== "auto"){ + } else { + if (bottomHeight !== "none" && bottomHeight !== "auto") { marginGroup.style["grid-template-rows"] = bottomHeight + " calc(100% - " + bottomHeight + "*2) " + bottomHeight; } } } - }else { - if(bottomHeight !== "none" && bottomHeight !== "auto"){ + } else { + if (bottomHeight !== "none" && bottomHeight !== "auto") { marginGroup.style["grid-template-rows"] = bottomHeight + " calc(100% - " + bottomHeight + "*2) " + bottomHeight; } } - }else { - if(topContent && topHeight !== "none" && topHeight !== "auto"){ - marginGroup.style["grid-template-rows"] = topHeight +" " + middleHeight + " calc(100% - (" + topHeight + " + " + middleHeight + "))"; - }else if(bottomContent && bottomHeight !== "none" && bottomHeight !== "auto"){ + } else { + if (topContent && topHeight !== "none" && topHeight !== "auto") { + marginGroup.style["grid-template-rows"] = topHeight + " " + middleHeight + " calc(100% - (" + topHeight + " + " + middleHeight + "))"; + } else if (bottomContent && bottomHeight !== "none" && bottomHeight !== "auto") { marginGroup.style["grid-template-rows"] = "1fr " + middleHeight + " " + bottomHeight; - }else { + } else { marginGroup.style["grid-template-rows"] = "calc((100% - " + middleHeight + ")/2) " + middleHeight + " calc((100% - " + middleHeight + ")/2)"; } } - }else { - if(topContent){ - if(!bottomContent){ + } else { + if (topContent) { + if (!bottomContent) { marginGroup.style["grid-template-rows"] = "1fr 0 0"; - }else { - if(topHeight !== "none" && topHeight !== "auto"){ - if(bottomHeight !== "none" && bottomHeight !== "auto"){ + } else { + if (topHeight !== "none" && topHeight !== "auto") { + if (bottomHeight !== "none" && bottomHeight !== "auto") { marginGroup.style["grid-template-rows"] = topHeight + " 1fr " + bottomHeight; - }else { + } else { marginGroup.style["grid-template-rows"] = topHeight + " 0 1fr"; } - }else { - if(bottomHeight !== "none" && bottomHeight !== "auto"){ + } else { + if (bottomHeight !== "none" && bottomHeight !== "auto") { marginGroup.style["grid-template-rows"] = "1fr 0 " + bottomHeight; - }else { + } else { marginGroup.style["grid-template-rows"] = "1fr 0 1fr"; } } } - }else { - if(bottomHeight !== "none" && bottomHeight !== "auto"){ + } else { + if (bottomHeight !== "none" && bottomHeight !== "auto") { marginGroup.style["grid-template-rows"] = "1fr 0 " + bottomHeight; - }else { + } else { marginGroup.style["grid-template-rows"] = "0 0 1fr"; } } @@ -28310,7 +28629,7 @@ img { }; } - createCalculatedDimension(property, items, important, operator="+") { + createCalculatedDimension(property, items, important, operator = "+") { let children = new lib.List(); let calculations = new lib.List(); @@ -28500,17 +28819,31 @@ img { for (let prop of breaks[b]) { if (prop.property === "break-after") { - let nodeAfter = elementAfter(elements[i]); + let nodeAfter = displayedElementAfter(elements[i], parsed); elements[i].setAttribute("data-break-after", prop.value); if (nodeAfter) { nodeAfter.setAttribute("data-previous-break-after", prop.value); } + } else if (prop.property === "break-before") { + let nodeBefore = displayedElementBefore(elements[i], parsed); + + // Breaks are only allowed between siblings, not between a box and its container. + // If we cannot find a node before we should not break! + // https://drafts.csswg.org/css-break-3/#break-propagation + if (nodeBefore) { + if (prop.value === "page" && needsPageBreak(elements[i], nodeBefore)) { + // we ignore this explicit page break because an implicit page break is already needed + continue; + } + elements[i].setAttribute("data-break-before", prop.value); + nodeBefore.setAttribute("data-next-break-before", prop.value); + } } else if (prop.property === "page") { elements[i].setAttribute("data-page", prop.value); - let nodeAfter = elementAfter(elements[i]); + let nodeAfter = displayedElementAfter(elements[i], parsed); if (nodeAfter) { nodeAfter.setAttribute("data-after-page", prop.value); @@ -28669,6 +29002,7 @@ img { this.styleSheet = polisher.styleSheet; this.counters = {}; + this.resetCountersMap = new Map(); } onDeclaration(declaration, dItem, dList, rule) { @@ -28711,10 +29045,9 @@ img { } handleIncrement(declaration, rule) { - let identifier = declaration.value.children.first(); - let number = declaration.value.children.getSize() > 1 - && declaration.value.children.last().value; - let name = identifier && identifier.name; + const identifier = declaration.value.children.first(); + const number = declaration.value.children.getSize() > 1 ? declaration.value.children.last().value : 1; + const name = identifier && identifier.name; if (name === "page" || name.indexOf("target-counter-") === 0) { return; @@ -28731,7 +29064,7 @@ img { return counter.increments[selector] = { selector: selector, - number: number || 1 + number }; } @@ -28761,17 +29094,21 @@ img { counter = this.counters[c]; this.processCounterIncrements(parsed, counter); this.processCounterResets(parsed, counter); - this.addCounterValues(parsed, counter); + if (c !== "page") { + this.addCounterValues(parsed, counter); + } } } scopeCounters(counters) { let countersArray = []; for (let c in counters) { - countersArray.push(`${counters[c].name} 0`); + if(c !== "page") { + countersArray.push(`${counters[c].name} 0`); + } } // Add to pages to allow cross page scope - this.insertRule(`.pagedjs_pages { counter-reset: ${countersArray.join(" ")}}`); + this.insertRule(`.pagedjs_pages { counter-reset: ${countersArray.join(" ")} page 0 pages var(--pagedjs-page-count)}`); } insertRule(rule) { @@ -28785,7 +29122,7 @@ img { // Find elements for increments let incrementElements = parsed.querySelectorAll(increment.selector); // Add counter data - for (var i = 0; i < incrementElements.length; i++) { + for (let i = 0; i < incrementElements.length; i++) { incrementElements[i].setAttribute("data-counter-"+ counter.name +"-increment", increment.number); incrementElements[i].setAttribute("data-counter-increment", counter.name); } @@ -28807,8 +29144,8 @@ img { } addCounterValues(parsed, counter) { - let counterName = counter.name; - let elements = parsed.querySelectorAll("[data-counter-"+ counterName +"-reset], [data-counter-"+ counterName +"-increment]"); + const counterName = counter.name; + const elements = parsed.querySelectorAll("[data-counter-"+ counterName +"-reset], [data-counter-"+ counterName +"-increment]"); let count = 0; let element; @@ -28816,7 +29153,7 @@ img { let resetValue, incrementValue, resetDelta; let incrementArray; - for (var i = 0; i < elements.length; i++) { + for (let i = 0; i < elements.length; i++) { element = elements[i]; resetDelta = 0; incrementArray = []; @@ -28854,16 +29191,16 @@ img { incrementCounterForElement(element, incrementArray) { if (!element || !incrementArray || incrementArray.length === 0) return; - let ref = element.dataset.ref; - let prevIncrements = Array.from(this.styleSheet.cssRules).filter((rule) => { + const ref = element.dataset.ref; + const prevIncrements = Array.from(this.styleSheet.cssRules).filter((rule) => { return rule.selectorText === `[data-ref="${element.dataset.ref}"]:not([data-split-from])` && rule.style[0] === "counter-increment"; }); - let increments = []; + const increments = []; for (let styleRule of prevIncrements) { let values = styleRule.style.counterIncrement.split(" "); - for (var i = 0; i < values.length; i+=2) { + for (let i = 0; i < values.length; i+=2) { increments.push(values[i] + " " + values[i+1]); } } @@ -28876,8 +29213,14 @@ img { afterPageLayout(pageElement, page) { let pgreset = pageElement.querySelectorAll("[data-counter-page-reset]"); pgreset.forEach((reset) => { - let value = reset.datasetCounterPageReset; - this.styleSheet.insertRule(`[data-page-number="${pageElement.dataset.pageNumber}"] { counter-reset: page ${value} }`, this.styleSheet.cssRules.length); + const ref = reset.dataset && reset.dataset.ref; + if (ref && this.resetCountersMap.has(ref)) ; else { + if (ref) { + this.resetCountersMap.set(ref, ""); + } + let value = reset.dataset.counterPageReset; + this.styleSheet.insertRule(`[data-page-number="${pageElement.dataset.pageNumber}"] { counter-increment: none; counter-reset: page ${value}; }`, this.styleSheet.cssRules.length); + } }); } @@ -28908,9 +29251,16 @@ img { } addDataNumbers(list) { + let start = 1; + if (list.hasAttribute("start")) { + start = parseInt(list.getAttribute("start"), 10); + if (isNaN(start)) { + start = 1; + } + } let items = list.children; for (var i = 0; i < items.length; i++) { - items[i].setAttribute("data-item-num", i + 1); + items[i].setAttribute("data-item-num", i + start); } } @@ -28950,6 +29300,176 @@ img { } } + class PageCounterIncrement extends Handler { + constructor(chunker, polisher, caller) { + super(chunker, polisher, caller); + + this.styleSheet = polisher.styleSheet; + this.pageCounter = { + name: "page", + increments: {}, + resets: {} + }; + } + + onDeclaration(declaration, dItem, dList, rule) { + const property = declaration.property; + + if (property === "counter-increment") { + let inc = this.handleIncrement(declaration, rule); + if (inc) { + dList.remove(dItem); + } + } + } + + afterParsed(_) { + for (const inc in this.pageCounter.increments) { + const increment = this.pageCounter.increments[inc]; + this.insertRule(`${increment.selector} { --pagedjs-page-counter-increment: ${increment.number} }`); + } + } + + handleIncrement(declaration, rule) { + const identifier = declaration.value.children.first(); + const number = declaration.value.children.getSize() > 1 ? declaration.value.children.last().value : 1; + const name = identifier && identifier.name; + + if (name.indexOf("target-counter-") === 0) { + return; + } + // A counter named page is automatically created and incremented by 1 on every page of the document, + // unless the counter-increment property in the page context explicitly specifies a different increment for the page counter. + // https://www.w3.org/TR/css-page-3/#page-based-counters + if (name !== "page") { + return; + } + // the counter-increment property is not defined on the page context (i.e. @page rule), ignoring... + if (rule.ruleNode.name === "page" && rule.ruleNode.type === "Atrule") { + return; + } + const selector = lib.generate(rule.ruleNode.prelude); + return this.pageCounter.increments[selector] = { + selector: selector, + number + }; + } + + insertRule(rule) { + this.styleSheet.insertRule(rule, this.styleSheet.cssRules.length); + } + } + + class NthOfType extends Handler { + constructor(chunker, polisher, caller) { + super(chunker, polisher, caller); + + this.styleSheet = polisher.styleSheet; + this.selectors = {}; + } + + onRule(ruleNode, ruleItem, rulelist) { + let selector = lib.generate(ruleNode.prelude); + if (selector.match(/:(first|last|nth)-of-type/)) { + + let declarations = lib.generate(ruleNode.block); + declarations = declarations.replace(/[{}]/g,""); + + let uuid = "nth-of-type-" + UUID(); + + selector.split(",").forEach((s) => { + if (!this.selectors[s]) { + this.selectors[s] = [uuid, declarations]; + } else { + this.selectors[s][1] = `${this.selectors[s][1]};${declarations}` ; + } + }); + + rulelist.remove(ruleItem); + } + } + + afterParsed(parsed) { + this.processSelectors(parsed, this.selectors); + } + + processSelectors(parsed, selectors) { + // add the new attributes to matching elements + for (let s in selectors) { + let elements = parsed.querySelectorAll(s); + + for (var i = 0; i < elements.length; i++) { + let dataNthOfType = elements[i].getAttribute("data-nth-of-type"); + + if (dataNthOfType && dataNthOfType != "") { + dataNthOfType = `${dataNthOfType},${selectors[s][0]}`; + elements[i].setAttribute("data-nth-of-type", dataNthOfType); + } else { + elements[i].setAttribute("data-nth-of-type", selectors[s][0]); + } + } + + let rule = `*[data-nth-of-type*='${selectors[s][0]}'] { ${selectors[s][1]}; }`; + this.styleSheet.insertRule(rule, this.styleSheet.cssRules.length); + } + } + } + + class Following extends Handler { + constructor(chunker, polisher, caller) { + super(chunker, polisher, caller); + + this.styleSheet = polisher.styleSheet; + this.selectors = {}; + } + + onRule(ruleNode, ruleItem, rulelist) { + let selector = lib.generate(ruleNode.prelude); + if (selector.match(/\+/)) { + + let declarations = lib.generate(ruleNode.block); + declarations = declarations.replace(/[{}]/g,""); + + let uuid = "following-" + UUID(); + + selector.split(",").forEach((s) => { + if (!this.selectors[s]) { + this.selectors[s] = [uuid, declarations]; + } else { + this.selectors[s][1] = `${this.selectors[s][1]};${declarations}` ; + } + }); + + rulelist.remove(ruleItem); + } + } + + afterParsed(parsed) { + this.processSelectors(parsed, this.selectors); + } + + processSelectors(parsed, selectors) { + // add the new attributes to matching elements + for (let s in selectors) { + let elements = parsed.querySelectorAll(s); + + for (var i = 0; i < elements.length; i++) { + let dataFollowing = elements[i].getAttribute("data-following"); + + if (dataFollowing && dataFollowing != "") { + dataFollowing = `${dataFollowing},${selectors[s][0]}`; + elements[i].setAttribute("data-following", dataFollowing); + } else { + elements[i].setAttribute("data-following", selectors[s][0]); + } + } + + let rule = `*[data-following*='${selectors[s][0]}'] { ${selectors[s][1]}; }`; + this.styleSheet.insertRule(rule, this.styleSheet.cssRules.length); + } + } + } + var pagedMediaHandlers = [ AtPage, Breaks, @@ -28957,7 +29477,10 @@ img { Splits, Counters, Lists, - PositionFixed + PositionFixed, + PageCounterIncrement, + NthOfType, + Following ]; class RunningHeaders extends Handler { @@ -29193,6 +29716,13 @@ img { }); } + function cleanSelector(el) { + if(el == null) return; + return el + .replace(new RegExp("::footnote-call", "g"), "") + .replace(new RegExp("::footnote-marker", "g"), ""); + } + class StringSets extends Handler { constructor(chunker, polisher, caller) { super(chunker, polisher, caller); @@ -29234,13 +29764,24 @@ img { funcNode.name = "var"; funcNode.children = new lib.List(); - funcNode.children.append( - funcNode.children.createItem({ - type: "Identifier", - loc: null, - name: "--pagedjs-string-" + identifier - }) - ); + + if(this.type === "first" || this.type === "last" || this.type === "start" || this.type === "first-except"){ + funcNode.children.append( + funcNode.children.createItem({ + type: "Identifier", + loc: null, + name: "--pagedjs-string-" + this.type + "-" + identifier + }) + ); + }else { + funcNode.children.append( + funcNode.children.createItem({ + type: "Identifier", + loc: null, + name: "--pagedjs-string-first-" + identifier + }) + ); + } } } @@ -29252,59 +29793,65 @@ img { this.pageLastString = {}; } - // get the value of the previous last string + for (let name of Object.keys(this.stringSetSelectors)) { let set = this.stringSetSelectors[name]; let selected = fragment.querySelectorAll(set.selector); - - // let cssVar = previousPageLastString; + // Get the last found string for the current identifier - let cssVar = ( name in this.pageLastString ) ? this.pageLastString[name] : ""; - - selected.forEach((sel) => { - // push each content into the array to define in the variable the first and the last element of the page. - - - //this.pageLastString = selected[selected.length - 1].textContent; - // Index by identifier - this.pageLastString[name] = selected[selected.length - 1].textContent; - + let stringPrevPage = ( name in this.pageLastString ) ? this.pageLastString[name] : ""; + + let varFirst, varLast, varStart, varFirstExcept; + + if(selected.length == 0){ + // if there is no sel. on the page + varFirst = stringPrevPage; + varLast = stringPrevPage; + varStart = stringPrevPage; + varFirstExcept = stringPrevPage; + }else { + + selected.forEach((sel) => { + // push each content into the array to define in the variable the first and the last element of the page. + this.pageLastString[name] = selected[selected.length - 1].textContent; - if (this.type === "first") { - cssVar = selected[0].textContent; - } - - else if (this.type === "last") { - cssVar = selected[selected.length - 1].textContent; - } - - else if (this.type === "start") { - - if (sel.parentElement.firstChild === sel) { - cssVar = sel.textContent; - } + }); + + /* FIRST */ + + varFirst = selected[0].textContent; + + + /* LAST */ + + varLast = selected[selected.length - 1].textContent; + + + /* START */ + + // Hack to find if the sel. is the first elem of the page / find a better way + let selTop = selected[0].getBoundingClientRect().top; + let pageContent = selected[0].closest(".pagedjs_page_content"); + let pageContentTop = pageContent.getBoundingClientRect().top; + + if(selTop == pageContentTop){ + varStart = varFirst; + }else { + varStart = stringPrevPage; } - - else if (this.type === "first-except") { - cssVar = ""; - } - - else { - cssVar = selected[0].textContent; - } - }); - - fragment.setAttribute("data-string", `string-type-${this.type}-${name}`); - - - // fragment.style.setProperty(`--pagedjs-string-${name}`, `"${cssVar.replace(/\\([\s\S])|(["|'])/g, "\\$1$2")}"`); - fragment.style.setProperty(`--pagedjs-string-${name}`, `"${cleanPseudoContent(cssVar)}`); - - // if there is no new string on the page - if (!fragment.hasAttribute("data-string")) { - fragment.style.setProperty(`--pagedjs-string-${name}`, `"${this.pageLastString}"`); - } + + /* FIRST EXCEPT */ + + varFirstExcept = ""; + + } + + fragment.style.setProperty(`--pagedjs-string-first-${name}`, `"${cleanPseudoContent(varFirst)}`); + fragment.style.setProperty(`--pagedjs-string-last-${name}`, `"${cleanPseudoContent(varLast)}`); + fragment.style.setProperty(`--pagedjs-string-start-${name}`, `"${cleanPseudoContent(varStart)}`); + fragment.style.setProperty(`--pagedjs-string-first-except-${name}`, `"${cleanPseudoContent(varFirstExcept)}`); + } } @@ -29368,7 +29915,7 @@ img { variable: variable }; }); - + // Replace with counter funcNode.name = "counter"; funcNode.children = new lib.List(); @@ -29390,7 +29937,7 @@ img { let target = this.counterTargets[name]; let split = target.selector.split("::"); let query = split[0]; - + let queried = chunker.pagesArea.querySelectorAll(query + ":not([data-" + target.variable + "])"); queried.forEach((selected, index) => { @@ -29412,16 +29959,19 @@ img { if (target.counter === "page") { let pages = chunker.pagesArea.querySelectorAll(".pagedjs_page"); let pg = 0; - for (var i = 0; i < pages.length; i++) { + for (let i = 0; i < pages.length; i++) { let styles = window.getComputedStyle(pages[i]); let reset = styles["counter-reset"].replace("page", "").trim(); + let increment = styles["counter-increment"].replace("page", "").trim(); if (reset !== "none") { pg = parseInt(reset); } - pg += 1; + if (increment !== "none") { + pg += parseInt(increment); + } - if (pages[i].contains( element )){ + if (pages[i].contains(element)) { break; } } @@ -29569,6 +30119,332 @@ img { TargetText ]; + class WhiteSpaceFilter extends Handler { + constructor(chunker, polisher, caller) { + super(chunker, polisher, caller); + } + + filter(content) { + + filterTree(content, (node) => { + return this.filterEmpty(node); + }, NodeFilter.SHOW_TEXT); + + } + + filterEmpty(node) { + if (node.textContent.length > 1 && isIgnorable(node)) { + + // Do not touch the content if text is pre-formatted + let parent = node.parentNode; + let pre = isElement(parent) && parent.closest("pre"); + if (pre) { + return NodeFilter.FILTER_REJECT; + } + + const previousSibling = previousSignificantNode(node); + const nextSibling = nextSignificantNode(node); + + if (nextSibling === null && previousSibling === null) { + // we should not remove a Node that does not have any siblings. + node.textContent = " "; + return NodeFilter.FILTER_REJECT; + } + if (nextSibling === null) { + // we can safely remove this node + return NodeFilter.FILTER_ACCEPT; + } + if (previousSibling === null) { + // we can safely remove this node + return NodeFilter.FILTER_ACCEPT; + } + + // replace the content with a single space + node.textContent = " "; + + // TODO: we also need to preserve sequences of white spaces when the parent has "white-space" rule: + // pre + // Sequences of white space are preserved. Lines are only broken at newline characters in the source and at
elements. + // + // pre-wrap + // Sequences of white space are preserved. Lines are broken at newline characters, at
, and as necessary to fill line boxes. + // + // pre-line + // Sequences of white space are collapsed. Lines are broken at newline characters, at
, and as necessary to fill line boxes. + // + // break-spaces + // The behavior is identical to that of pre-wrap, except that: + // - Any sequence of preserved white space always takes up space, including at the end of the line. + // - A line breaking opportunity exists after every preserved white space character, including between white space characters. + // - Such preserved spaces take up space and do not hang, and thus affect the box’s intrinsic sizes (min-content size and max-content size). + // + // See: https://developer.mozilla.org/en-US/docs/Web/CSS/white-space#Values + + return NodeFilter.FILTER_REJECT; + } else { + return NodeFilter.FILTER_REJECT; + } + } + + } + + class CommentsFilter extends Handler { + constructor(chunker, polisher, caller) { + super(chunker, polisher, caller); + } + + filter(content) { + filterTree(content, null, NodeFilter.SHOW_COMMENT); + } + + } + + class ScriptsFilter extends Handler { + constructor(chunker, polisher, caller) { + super(chunker, polisher, caller); + } + + filter(content) { + content.querySelectorAll("script").forEach( script => { script.remove(); }); + } + + } + + var clearCut = createCommonjsModule(function (module, exports) { + /** + * Originally ported from https://github.com/keeganstreet/specificity/blob/866bf7ab4e7f62a7179c15b13a95af4e1c7b1afa/specificity.js + * + * Calculates the specificity of CSS selectors + * http://www.w3.org/TR/css3-selectors/#specificity + * + * Returns a selector integer value + */ + + // The following regular expressions assume that selectors matching the preceding regular expressions have been removed + var attributeRegex = /(\[[^\]]+\])/g; + var idRegex = /(#[^\s\+>~\.\[:]+)/g; + var classRegex = /(\.[^\s\+>~\.\[:]+)/g; + var pseudoElementRegex = /(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/g; + var pseudoClassRegex = /(:[^\s\+>~\.\[:]+)/g; + var elementRegex = /([^\s\+>~\.\[:]+)/g; + var notRegex = /:not\(([^\)]*)\)/g; + var ruleRegex = /\{[^]*/gm; + var separatorRegex = /[\*\s\+>~]/g; + var straysRegex = /[#\.]/g; + + // Find matches for a regular expression in a string and push their details to parts + // Type is "a" for IDs, "b" for classes, attributes and pseudo-classes and "c" for elements and pseudo-elements + var findMatch = function(regex, type, types, selector) { + var matches = selector.match(regex); + if (matches) { + for (var i = 0; i < matches.length; i++) { + types[type]++; + // Replace this simple selector with whitespace so it won't be counted in further simple selectors + selector = selector.replace(matches[i], ' '); + } + } + + return selector; + }; + + // Calculate the specificity for a selector by dividing it into simple selectors and counting them + var calculate = function(selector) { + var commaIndex = selector.indexOf(','); + if (commaIndex !== -1) { + selector = selector.substring(0, commaIndex); + } + + var types = { + a: 0, + b: 0, + c: 0 + }; + + // Remove the negation psuedo-class (:not) but leave its argument because specificity is calculated on its argument + selector = selector.replace(notRegex, ' $1 '); + + // Remove anything after a left brace in case a user has pasted in a rule, not just a selector + selector = selector.replace(ruleRegex, ' '); + + // Add attribute selectors to parts collection (type b) + selector = findMatch(attributeRegex, 'b', types, selector); + + // Add ID selectors to parts collection (type a) + selector = findMatch(idRegex, 'a', types, selector); + + // Add class selectors to parts collection (type b) + selector = findMatch(classRegex, 'b', types, selector); + + // Add pseudo-element selectors to parts collection (type c) + selector = findMatch(pseudoElementRegex, 'c', types, selector); + + // Add pseudo-class selectors to parts collection (type b) + selector = findMatch(pseudoClassRegex, 'b', types, selector); + + // Remove universal selector and separator characters + selector = selector.replace(separatorRegex, ' '); + + // Remove any stray dots or hashes which aren't attached to words + // These may be present if the user is live-editing this selector + selector = selector.replace(straysRegex, ' '); + + // The only things left should be element selectors (type c) + findMatch(elementRegex, 'c', types, selector); + + return (types.a * 100) + (types.b * 10) + (types.c * 1); + }; + + var specificityCache = {}; + + exports.calculateSpecificity = function(selector) { + var specificity = specificityCache[selector]; + if (specificity === undefined) { + specificity = calculate(selector); + specificityCache[selector] = specificity; + } + return specificity; + }; + + var validSelectorCache = {}; + var testSelectorElement = null; + + exports.isSelectorValid = function(selector) { + var valid = validSelectorCache[selector]; + if (valid === undefined) { + if (testSelectorElement == null) { + testSelectorElement = document.createElement('div'); + } + + try { + testSelectorElement.querySelector(selector); + valid = true; + } catch (error) { + valid = false; + } + validSelectorCache[selector] = valid; + } + return valid; + }; + + exports.validateSelector = function(selector) { + if (!exports.isSelectorValid(selector)) { + var error = new SyntaxError(selector + ' is not a valid selector'); + error.code = 'EBADSELECTOR'; + throw error; + } + }; + }); + var clearCut_1 = clearCut.calculateSpecificity; + var clearCut_2 = clearCut.isSelectorValid; + var clearCut_3 = clearCut.validateSelector; + + class UndisplayedFilter extends Handler { + constructor(chunker, polisher, caller) { + super(chunker, polisher, caller); + this.displayRules = {}; + } + + onDeclaration(declaration, dItem, dList, rule) { + if (declaration.property === "display") { + let selector = lib.generate(rule.ruleNode.prelude); + let value = declaration.value.children.first().name; + + selector.split(",").forEach((s) => { + this.displayRules[s] = { + value: value, + selector: s, + specificity: clearCut_1(s), + important: declaration.important + }; + }); + } + } + + filter(content) { + let { matches, selectors } = this.sortDisplayedSelectors(content, this.displayRules); + + // Find matching elements that have display styles + for (let i = 0; i < matches.length; i++) { + let element = matches[i]; + let selector = selectors[i]; + let displayValue = selector[selector.length-1].value; + if(this.removable(element) && displayValue === "none") { + element.dataset.undisplayed = "undisplayed"; + } + } + + // Find elements that have inline styles + let styledElements = content.querySelectorAll("[style]"); + for (let i = 0; i < styledElements.length; i++) { + let element = styledElements[i]; + if (this.removable(element)) { + element.dataset.undisplayed = "undisplayed"; + } + } + } + + sorter(a, b) { + if (a.important && !b.important) { + return 1; + } + + if (b.important && !a.important) { + return -1; + } + + return a.specificity - b.specificity; + } + + sortDisplayedSelectors(content, displayRules=[]) { + let matches = []; + let selectors = []; + for (let d in displayRules) { + let displayItem = displayRules[d]; + let selector = displayItem.selector; + let query = []; + try { + try { + query = content.querySelectorAll(selector); + } catch (e) { + query = content.querySelectorAll(cleanSelector(selector)); + } + } catch (e) { + query = []; + } + let elements = Array.from(query); + for (let e of elements) { + if (matches.includes(e)) { + let index = matches.indexOf(e); + selectors[index].push(displayItem); + selectors[index] = selectors[index].sort(this.sorter); + } else { + matches.push(e); + selectors.push([displayItem]); + } + } + } + + return { matches, selectors }; + } + + removable(element) { + if (element.style && + element.style.display !== "" && + element.style.display !== "none") { + return false; + } + + return true; + } + } + + var filters = [ + WhiteSpaceFilter, + CommentsFilter, + ScriptsFilter, + UndisplayedFilter + ]; + var isImplemented$3 = function () { var from = Array.from, arr, result; if (typeof from !== "function") return false; @@ -29997,7 +30873,7 @@ img { return pipe; }; - let registeredHandlers = [...pagedMediaHandlers, ...generatedContentHandlers]; + let registeredHandlers = [...pagedMediaHandlers, ...generatedContentHandlers, ...filters]; class Handlers { constructor(chunker, polisher, caller) { diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/js/pagedjsCustomizations.js b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/js/pagedjsCustomizations.js new file mode 100644 index 0000000..e494029 --- /dev/null +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/js/pagedjsCustomizations.js @@ -0,0 +1,100 @@ +var UID = { + _current: 0, + getNew: function(){ + this._current++; + return this._current; + } +}; + +HTMLElement.prototype.pseudoStyle = function(element,prop,value){ + var _this = this; + var _sheetId = "pseudoStyles"; + var _head = document.head || document.getElementsByTagName('head')[0]; + var _sheet = document.getElementById(_sheetId) || document.createElement('style'); + _sheet.id = _sheetId; + var className = "pseudoStyle" + UID.getNew(); + + _this.className += " "+className; + + _sheet.innerHTML += " ."+className+":"+element+"{"+prop+":"+value+"}"; + _head.appendChild(_sheet); + return this; +}; + +class Sandpoints extends Paged.Handler { + constructor(chunker, polisher, caller) { + super(chunker, polisher, caller); + } + + beforeParsed(content) { + var d = {}; + content.querySelectorAll('*').forEach((n, i)=> { + if (n.hasAttribute("printhref")) { + n.setAttribute("href", n.getAttribute("printhref")) + } + + if (n.classList.length > 0 ) { + n.classList.forEach((c, i)=>{ + if (c.startsWith("css-")) { + (c in d) ? d[c]++ : d[c] = 1 + let s = "" + Object.keys(d).filter(ks => ks.startsWith(c.slice(0, -1))).forEach((t, i)=> {if (c >= t) {s += `${d[t]}.`}}) + n.pseudoStyle('before','content', `"${s} "`) + } + }) + } + }) + } + + afterPageLayout(pageElement, page, breakToken, chunker) { + // Find all split table elements + let tables = pageElement.querySelectorAll("table[data-split-from]"); + + tables.forEach((table) => { + // There is an edge case where the previous page table + // has zero height (isn't visible). + // To avoid double header we will only add header if there is none. + let tableHeader = table.querySelector("thead"); + if (tableHeader) { + return; + } + + // Get the reference UUID of the node + let ref = table.dataset.ref; + // Find the node in the original source + let sourceTable = chunker.source.querySelector("[data-ref='" + ref + "']"); + + // Find if there is a header + let sourceHeader = sourceTable.querySelector("thead"); + if (sourceHeader) { + // Clone the header element + let clonedHeader = sourceHeader.cloneNode(true); + // Insert the header at the start of the split table + table.insertBefore(clonedHeader, table.firstChild); + } + }); + + // Find all tables + tables = pageElement.querySelectorAll("table"); + + // special case which might not fit for everyone + tables.forEach((table) => { + // if the table has no rows in body, hide it. + // This happens because my render engine creates empty tables. + let sourceBody = table.querySelector("tbody > tr"); + if (!sourceBody) { + console.log("Table was hidden, because it has no rows in tbody."); + table.style.visibility = "hidden"; + table.style.position = "absolute"; + + var lineSpacer = table.nextSibling; + if (lineSpacer) { + lineSpacer.style.visibility = "hidden"; + lineSpacer.style.position = "absolute"; + } + } + }); + } +} + +Paged.registerHandlers(Sandpoints); diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/800x418.png b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/800x418.png new file mode 100644 index 0000000..4595f4c Binary files /dev/null and b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/800x418.png differ diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/800x800.png b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/800x800.png new file mode 100644 index 0000000..84656c8 Binary files /dev/null and b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/800x800.png differ diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/index.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/index.html new file mode 100644 index 0000000..e4ed5bf --- /dev/null +++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/static/logo/index.html @@ -0,0 +1,145 @@ + + + + + + + + + + +
+
+ +
+
+ + diff --git a/_vendor/modules.txt b/_vendor/modules.txt index a4a89cf..eaa2d9a 100644 --- a/_vendor/modules.txt +++ b/_vendor/modules.txt @@ -1 +1,2 @@ -# git.sandpoints.org/Drawwell/SandpointsTheme v0.0.0-20201218222521-33a423ebe113 +# git.sandpoints.org/Drawwell/SandpointsTheme v0.0.0-20220418135300-b3e229aeea27 +# git.sandpoints.org/Drawwell/SandpointsEditPage v0.0.0-20210825011616-e019d8a4d186 diff --git a/config.toml b/config.toml index 448addc..0808096 100644 --- a/config.toml +++ b/config.toml @@ -4,70 +4,76 @@ title = "Simple Sandpoints" relativeurls = true disableKinds = ["RSS", "sitemap"] -[params] - description = "Simple Sandpoints project to test and develop...." - # sandpointsGiteaUrl = "https://git.sandpoints.org/Drawwell/SimpleSandpoints" - sandpointsGiteaUrl = "http://localhost:3333/Sandpoints/SimpleSandpoints" - sandpointsCatalogPrefix = "/library/" +[taxonomies] +keyword = "keywords" +tag = "tags" - sandpointsMentionedIn = ["annex"] + +[params] +description = "Simple Sandpoints project to test and develop...." +# sandpointsGiteaUrl = "https://git.sandpoints.org/Drawwell/SimpleSandpoints" +sandpointsGiteaUrl = "http://localhost:3333/Sandpoints/SimpleSandpoints" +sandpointsCatalogPrefix = "/library/" + +sandpointsMentionedIn = ["annex"] [outputFormats] - [outputFormats.js] - isPlainText = true - mediaType = "application/javascript" +[outputFormats.js] +isPlainText = true +mediaType = "application/javascript" [outputs] - list = ["html", "js"] +list = ["html", "js"] [markup.tableOfContents] - endLevel=4 - ordered = true - startLevel = 1 +endLevel=4 +ordered = true +startLevel = 1 [markup.goldmark.renderer] - unsafe = true +unsafe = true # [markup.goldmark.parser.attribute] # block = true [module] - # replacement allow for easier local development - replacements = ["git.sandpoints.org/Drawwell/SandpointsTheme -> /home/m/devel/SandpointsTheme", "git.sandpoints.org/Drawwell/SandpointsEditPage -> /home/m/devel/SandpointsEditPage"] - [[module.imports]] - path = "git.sandpoints.org/Drawwell/SandpointsTheme" +# replacement allow for easier local development +# replacements = ["git.sandpoints.org/Drawwell/SandpointsTheme -> /home/m/devel/SandpointsTheme", "git.sandpoints.org/Drawwell/SandpointsEditPage -> /home/m/devel/SandpointsEditPage"] - [[module.imports]] - path = "git.sandpoints.org/Drawwell/SandpointsEditPage" +[[module.imports]] +path = "git.sandpoints.org/Drawwell/SandpointsTheme" - [[module.imports.mounts]] - source = "public/index.html" - target = "static/svedit/index.html" - [[module.imports.mounts]] - source = "public/global.css" - target = "static/svedit/global.css" - [[module.imports.mounts]] - source = "public/build" - target = "static/svedit/build" - - [[module.imports.mounts]] - source = "archetypes" - target = "archetypes" - [[module.imports.mounts]] - source = "assets" - target = "assets" - [[module.imports.mounts]] - source = "layouts" - target = "layouts" - [[module.imports.mounts]] - source = "static" - target = "static" - [[module.imports.mounts]] - source = "data" - target = "data" - # [[module.imports.mounts]] - # source = "customizations/Dotawo/assets/css/site.css" - # target = "assets/css/site.css" - # [[module.imports.mounts]] - # source = "customizations/Dotawo/static/css/site.min.css" - # target = "static/css/site.min.css" +[[module.imports]] +path = "git.sandpoints.org/Drawwell/SandpointsEditPage" + +[[module.imports.mounts]] +source = "public/index.html" +target = "static/svedit/index.html" +[[module.imports.mounts]] +source = "public/global.css" +target = "static/svedit/global.css" +[[module.imports.mounts]] +source = "public/build" +target = "static/svedit/build" + +[[module.imports.mounts]] +source = "archetypes" +target = "archetypes" +[[module.imports.mounts]] +source = "assets" +target = "assets" +[[module.imports.mounts]] +source = "layouts" +target = "layouts" +[[module.imports.mounts]] +source = "static" +target = "static" +[[module.imports.mounts]] +source = "data" +target = "data" +# [[module.imports.mounts]] +# source = "customizations/Dotawo/assets/css/site.css" +# target = "assets/css/site.css" +# [[module.imports.mounts]] +# source = "customizations/Dotawo/static/css/site.min.css" +# target = "static/css/site.min.css"