Commit 50504c55 authored by Sacha's avatar Sacha Committed by SXibolet@2PITAU
Browse files

removes nonsense with browser detection

parent 6f01b40c
......@@ -61,14 +61,6 @@ def handle_500(error):
raise UsageError('our-fault', status_code=500)
def added_style(name):
return digest('%s.css' % name) if session.get(name) == name else None
def get_added_styles():
return added_style('webkit'), added_style('safari')
def loggedin():
return session.get('username') is not None
......@@ -114,13 +106,6 @@ def login(username):
username=username or '')
@application.route("/set/<name>")
def set_browser(name):
if name not in {'webkit', 'safari'}:
return plain_text_resp('no', code=400)
session[name] = name
return plain_text_resp('yes')
@application.route("/register", methods=['GET', 'POST'])
def register():
......@@ -191,11 +176,8 @@ def index():
"""all pages for the app are loaded through here.
Angular handles partials, which are rendered through ``/partial``
"""
webkit, safari = get_added_styles()
return render_template('app.html',
user=session['user'],
safari=safari,
webkit=webkit,
css=digest('app.css'),
js=digest('home.js'),
angular='Home')
......
......@@ -3,8 +3,6 @@ sass home.scss:home.css --style compressed
sass app.scss:app.css --style compressed
sass login.scss:login.css --style compressed
sass account.scss:account.css --style compressed
sass webkit.scss:webkit.css --style compressed
sass safari.scss:safari.css --style compressed
cd mturk
sass highlight.scss:highlight.css --style compressed
cd ..
......@@ -6,15 +6,7 @@ document.getElementsByTagName('form')[0].style.display = 'block';
if (!window.jQuery) {
document.getElementsByTagName('form')[0].style.display = 'none';
} else {
var isWebKit = 'WebkitAppearance' in document.documentElement.style;
var isSafari = (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1);
if (isWebKit) {
$.ajax({url: '/set/webkit'});
}
if (isSafari) {
$.ajax({url: '/set/safari'});
}
document.getElementById('anon_login').style.display = 'none';
}
$(document).ready(function() {
......@@ -27,7 +19,7 @@ $(document).ready(function() {
$("#bugs_a").text('Report a bug')
}, function() {
issues = '?';
}, 'https://api.github.com/repos/gdyer/controversy/issues');
}, 'https://api.github.com/repos/SXibolet/controversy/issues');
});
......
ul.tweets{width:310px;-webkit-column-count:1;-moz-column-count:1;column-count:1}ul.tweets li{width:300px}@media (min-width: 920px){ul.tweets{-webkit-column-count:1;-moz-column-count:1;column-count:1}ul.tweets li{width:320px}}@media (min-width: 1320px){ul.tweets{width:350px;-webkit-column-count:1;-moz-column-count:1;column-count:1}}
/*# sourceMappingURL=safari.css.map */
@import 'vars';
ul.tweets {
width: 310px;
li { width: 300px; }
@include column-count(1);
}
@media (min-width: 920px) {
ul.tweets {
li { width: 320px; }
@include column-count(1); }
}
@media (min-width: 1320px) {
ul.tweets {
width: 350px;
@include column-count(1); }
}
@media (min-width: 920px){ul.articles{width:850px;-webkit-column-count:2;-moz-column-count:2;column-count:2}ul.tweets{width:850px;-webkit-column-count:4;-moz-column-count:4;column-count:4}ul.tweets li{width:180px}}@media (min-width: 1320px){ul.articles{width:1250px;-webkit-column-count:3;-moz-column-count:3;column-count:3}ul.tweets{width:1250px;-webkit-column-count:6;-moz-column-count:6;column-count:6}}
/*# sourceMappingURL=webkit.css.map */
@import 'vars';
@media (min-width: 920px) {
ul.articles {
width: 850px;
@include column-count(2); }
ul.tweets {
li {width: 180px; }
width: 850px;
@include column-count(4); }
}
@media (min-width: 1320px) {
ul.articles {
width: 1250px;
@include column-count(3); }
ul.tweets {
width: 1250px;
@include column-count(6); }
}
......@@ -14,18 +14,6 @@ Controversy &middot; hotspots of news articles</title>
<link rel=icon href="{{ url_for('static', filename='img/fav.ico') }}" />
<link rel=stylesheet href="{{ css }}" />
{% if webkit is not none %}
{% if webkit is not none and webkit|length > 0%}
<!-- added styles for webkit browsers -->
<link rel=stylesheet href="{{ webkit }}" />
{% endif %}
{% endif %}
{% if safari is not none %}
{% if safari|length > 0 %}
<!-- added styles for Safari -->
<link rel=stylesheet href="{{ safari }}" />
{% endif %}
{% endif %}
{% block content %}{% endblock %}
<footer>
......
......@@ -47,7 +47,7 @@
<input type=submit value="log in" />
</center>
<center>
<b>Or &hellip;&nbsp;</b><i><a href=bourbaki>I don't want an account; take me to the action already &rarr;</a></i>
<b>Or &hellip;&nbsp;</b><i><a id=anon_login href=bourbaki>I don't want an account; take me to the action already &rarr;</a></i>
</center>
</form>
</div>
......
......@@ -18,11 +18,9 @@
</span>
</div>
</header>
{% if user['Logins'] < 3 %}
<header id=sub>
Uncached queries take around a minute to score!
</header>
{% endif %}
{% raw %}
<main style="padding: 8em 1em">
<form ng-submit="submit()">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment