2021-10-13 14:24:52 +02:00
|
|
|
{% extends "base.html" %}
|
2021-06-29 19:54:51 +02:00
|
|
|
|
|
|
|
{% block head %}
|
2021-10-13 14:24:52 +02:00
|
|
|
<link href="{{ url_for('static', filename='css/pagedjs.css')}}" rel="stylesheet" type="text/css" media="screen">
|
2021-09-01 16:52:29 +02:00
|
|
|
<link href="{{ url_for('static', filename='css/print.css')}}" rel="stylesheet" type="text/css" media="print">
|
2021-12-03 00:11:42 +01:00
|
|
|
<!-- <link href="{{ url_for('static', filename='css/baseline.css')}}" rel="stylesheet" type="text/css" media="print"> -->
|
|
|
|
<script>
|
|
|
|
// Thank you paged.js team for the Hyphenopoly tip!
|
|
|
|
// config for hyphenopoly
|
|
|
|
var Hyphenopoly = {
|
|
|
|
require: {
|
|
|
|
"en-us": "FORCEHYPHENOPOLY"
|
|
|
|
},
|
|
|
|
paths: {
|
|
|
|
patterndir: "./js/hyphens/patterns/",
|
|
|
|
maindir: "./js/hyphens/"
|
|
|
|
},
|
|
|
|
setup: {
|
|
|
|
dontHyphenateClass: "noHyphen",
|
|
|
|
safeCopy: false,
|
|
|
|
hide: "nothing",
|
|
|
|
selectors: {
|
|
|
|
"p": {
|
|
|
|
hyphen: "\u00AD",
|
|
|
|
// hyphen: "•",
|
|
|
|
compound: "all",
|
|
|
|
minWordLength: 5,
|
|
|
|
leftmin: 3,
|
|
|
|
rightmin: 0,
|
|
|
|
orphanControl: 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<script src="{{ url_for('static', filename='js/hyphens/Hyphenopoly_Loader.js')}}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/paged.polyfill.js')}}" type="text/javascript"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/runHyphens.js')}}"></script>
|
2021-06-29 19:54:51 +02:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
{{ publication_unfolded | safe }}
|
2021-12-03 00:11:42 +01:00
|
|
|
<script>
|
|
|
|
// With many thanks to Julien Taquet for digging into Paged.js
|
|
|
|
// to find a way to remove hyphenated words on page breaks!!
|
|
|
|
class noHyphenBetweenPage extends Paged.Handler {
|
|
|
|
constructor(chunker, polisher, caller) {
|
|
|
|
super(chunker, polisher, caller);
|
|
|
|
this.hyphenToken;
|
|
|
|
}
|
|
|
|
afterPageLayout(pageFragment, page, breakToken) {
|
|
|
|
if (pageFragment.querySelector('.pagedjs_hyphen')) {
|
|
|
|
// find the hyphenated word
|
|
|
|
let block = pageFragment.querySelector('.pagedjs_hyphen');
|
|
|
|
block.dataset.ref = this.prevHyphen;
|
|
|
|
// move the breakToken
|
|
|
|
let offsetMove = getFinalWord(block.innerHTML).length;
|
|
|
|
// move the token accordingly
|
|
|
|
page.breakToken = page.endToken.offset - offsetMove;
|
|
|
|
// remove the last word
|
|
|
|
block.innerHTML = block.innerHTML.replace(getFinalWord(block.innerHTML), "");
|
|
|
|
breakToken.offset = page.endToken.offset - offsetMove;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Paged.registerHandlers(noHyphenBetweenPage);
|
|
|
|
|
|
|
|
function getFinalWord(words) {
|
|
|
|
var n = words.split(" ");
|
|
|
|
return n[n.length - 1];
|
|
|
|
}
|
|
|
|
</script>
|
2021-06-29 19:54:51 +02:00
|
|
|
{% endblock %}
|
|
|
|
|
2021-09-08 15:33:56 +02:00
|
|
|
<!--
|
2021-06-29 19:54:51 +02:00
|
|
|
<script>
|
|
|
|
window.addEventListener('load', function () {
|
|
|
|
|
2021-09-08 15:33:56 +02:00
|
|
|
// Add the main.css again to insert the nav css
|
|
|
|
var cssLink = document.createElement('link');
|
|
|
|
cssLink.rel = 'stylesheet';
|
|
|
|
cssLink.href = '/static/css/main.css';
|
|
|
|
cssLink.media = 'screen';
|
|
|
|
var head = document.getElementsByTagName('head')[0];
|
|
|
|
head.insertBefore(cssLink, head.firstChild);
|
2021-06-29 19:54:51 +02:00
|
|
|
|
|
|
|
})
|
|
|
|
</script>
|
2021-09-08 15:33:56 +02:00
|
|
|
-->
|
|
|
|
{% block footer %}
|
|
|
|
<br>
|
2021-09-01 16:52:29 +02:00
|
|
|
{% endblock %}
|