cross-reader/templates/base.html

121 lines
3.2 KiB
HTML

<!DOCTYPE html>
<html lang='{{ lang }}'>
<head>
<meta charset="utf-8" />
<title>cyber/technofeminist cross-readings {% block title %}{% endblock %}</title>
<link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='css/stylesheet.css')}}" />
<script type="text/javascript" src="{{ url_for('static', filename='js/jquery-3.3.1.min.js')}}"></script>
</head>
<body class="{% block view %}{% endblock %}">
<div id="txt-list">
<ul>
{% for txt in filenames|sort %}
{% set name = txt.replace('.txt','') %}
<li>
<a href="/manifesto/{{ name }}">{{ txt.replace('_', ' ') }}</a><br>
<a class="contrast" href="/mapping/{{ name }}"></a>
<small><a href="/list/tf/{{ name }}">TF</a></small>
<small><a href="/list/idf/{{ name }}">IDF</a></small>
<small><a href="/list/tfidf/{{ name }}">TF-IDF</a></small>
</li>
{% endfor %}
<ul>
</div>
<div id="nav">
{% block nav %}
<div class="page-button">
<a href="/cross-readings">cross-readings</a>
</div>
<div class="page-button">
<a href="/colophon">colophon</a>
</div>
{% endblock %}
</div>
<div id="wrapper">
<div id="logo">
<a href="/">cyber/technofeminist <br>cross-readings</a>
</div>
{% block search %}
<div id="search">
<form id="submitform" action="" method="GET" onsubmit="this.setAttribute('isSubmitting', 'true');">
<input id="query" name="q" value="{{query}}"/>
<button id="submit" type="submit"></button>
</form>
<script>
(function () {
var searching = false,
body = document.querySelector('body'),
button = document.querySelector('#search #submit'),
submitting = document.querySelector('#submitform').getAttribute('isSubmitting');
button.addEventListener('click', function (e) {
if (!searching) {
searching = true;
button.classList.add('searching');
body.classList.add('searching');
}
else {
e.preventDefault();
alert('Already searching ...');
}
})
})();
</script>
</div>
{% endblock %}
{% block printbutton %}
{% endblock %}
<div id="content">
{% block content %}
{% endblock %}
{% block results %}
{% endblock %}
{% block manifesto %}
{% endblock %}
{% block suggestions %}
{% endblock %}
</div>
</div>
</body>
<script>
// refresh when there is no (mouse or keyboard) activity for 5 minutes
var time = new Date().getTime();
$(document.body).bind("mousemove keypress", function(e) {
time = new Date().getTime();
});
function refresh() {
if(new Date().getTime() - time >= 300000){
console.log('refresh!');
window.location.href = '/';
} else {
setTimeout(refresh, 300000);
}
}
setTimeout(refresh, 300000);
// prevent links from opening in new tab
var links = document.links;
for (var i = 0; i < links.length; i++) {
links[i].target = "_self";
}
(function () {
var searching = false,
body = document.querySelector('body'),
buttons = document.querySelectorAll('strong.word, strong.query')
for (var i = 0; i < buttons.length; i++) {
buttons[i].addEventListener('click', function (e) {
if (!searching) {
searching = true;
body.classList.add('searching');
}
else {
e.preventDefault();
alert('Already searching ...');
}
})
}
})();
</script>
</html>