Browse Source

changing manifesto displays from iframes to plain text

english-french
manetta 6 years ago
parent
commit
9e2f91c111
  1. 3
      start.py
  2. 1
      static/css/stylesheet.css
  3. 7
      templates/en/base.html
  4. 4
      templates/en/index.html
  5. 20
      templates/en/manifesto.html
  6. 20
      templates/fr/manifesto.html

3
start.py

@ -81,8 +81,9 @@ def manifesto(lang, name):
"""
index = readings.load_index()
filenames = sorted([manifesto for manifesto, _ in index.items()])
manifesto = open('txt/'+name+'.txt', 'r').readlines()
link = manifestos[name]
return flask.render_template(lang+'/manifesto.html', filenames=filenames, name=name, link=link, lang=lang)
return flask.render_template(lang+'/manifesto.html', filenames=filenames, name=name, manifesto=manifesto, link=link, lang=lang)
@APP.route('/<lang>/mappings', methods=['GET', 'POST'])
def contrast_mappings(lang):

1
static/css/stylesheet.css

@ -33,7 +33,6 @@ body{
margin:20px;
font-family: mono, sans-serif;
font-size: 8px;
/*background-color: #f0dfff;*/
overflow-x: hidden;
z-index: -1;
}

7
templates/en/base.html

@ -32,14 +32,15 @@
</div>
{% block search %}
<div id="search">
<form action="" method="GET">
<form id="submitform" action="" method="GET" onsubmit="this.setAttribute('isSubmitting', 'true');">
<input id="query" name="q" value="{{query}}"/>
<input id="submit" type="submit" value="search"/>
</form>
<script>
(function () {
var searching = false,
button = document.querySelector('#search #submit');
button = document.querySelector('#search #submit'),
submitting = document.querySelector('#submitform').getAttribute('isSubmitting');
button.addEventListener('click', function (e) {
if (!searching) {
@ -75,7 +76,6 @@
$(document.body).bind("mousemove keypress", function(e) {
time = new Date().getTime();
});
function refresh() {
if(new Date().getTime() - time >= 300000){
console.log('refresh!');
@ -84,7 +84,6 @@
setTimeout(refresh, 300000);
}
}
setTimeout(refresh, 300000);
// prevent links from opening in new tab

4
templates/en/index.html

@ -26,7 +26,7 @@
<h1>Cross-reading suggestions (manual selection):</h1>
<div>
{% for word in suggestions %}
<strong class="query"><a href="/{{ lang}}/?q={{word}}">{{ word.strip() }}</a></strong>
<strong class="query"><a href="/{{ lang }}/?q={{word}}">{{ word.strip() }}</a></strong>
{% endfor %}
</div>
<br>
@ -37,7 +37,7 @@
{% endfor %}
</div>
<br>
<p>Read more about the <a href="/{{ lang}}/mappings/{{ filenames[0] }}">TF-IDF algorithm and contrast mappings</a>.</p>
<p>Read more about the <a href="/{{ lang }}/mappings/{{ filenames[0] }}">TF-IDF algorithm and contrast mappings</a>.</p>
<br>
<br>
{% endblock %}

20
templates/en/manifesto.html

@ -9,23 +9,9 @@
{% block manifesto %}
<div id="manifesto_content_wrapper">
{% if '.jpg' in link['iframe'] %}
<img src="{{ link }}" />
<br>
{% elif 'vimeo' in link['iframe'] %}
<iframe src="{{ link }}" width="600" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<div><em>
every day, you willingly exchange personal data for custom convenience <br>
lurking behind these transactions, the corporatocracy maps out your every move in the name of security <br>
don't worry, we're on your side <br>
the hors will help you reclaim your life and reprogram the 1s and 0s that build our world <br>
to hack is to create <br>
what we do is self defense, self determin- [end of transmission] <br>
</em></div>
{% else %}
<iframe id="manifesto_content" src="{{ link['iframe'] }}"></iframe>
{% endif%}
{% for line in manifesto %}
<p>{{ line | replace(' •', ' ') }}<br></p>
{% endfor %}
<br>
<div><small style="font-size: 85%;">{{ link['display'] }}</small></div>
</div>
{% endblock %}

20
templates/fr/manifesto.html

@ -9,23 +9,9 @@
{% block manifesto %}
<div id="manifesto_content_wrapper">
{% if '.jpg' in link['iframe'] %}
<img src="{{ link }}" />
<br>
{% elif 'vimeo' in link['iframe'] %}
<iframe src="{{ link }}" width="600" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<div><em>
every day, you willingly exchange personal data for custom convenience <br>
lurking behind these transactions, the corporatocracy maps out your every move in the name of security <br>
don't worry, we're on your side <br>
the hors will help you reclaim your life and reprogram the 1s and 0s that build our world <br>
to hack is to create <br>
what we do is self defense, self determin- [end of transmission] <br>
</em></div>
{% else %}
<iframe id="manifesto_content" src="{{ link['iframe'] }}"></iframe>
{% endif%}
{% for line in manifesto %}
<p>{{ line | replace(' •', ' ') }}<br></p>
{% endfor %}
<br>
<div><small style="font-size: 85%;">{{ link['display'] }}</small></div>
</div>
{% endblock %}

Loading…
Cancel
Save