aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorofshellohicy <ofshellohicy@gmail.com>2014-07-18 14:50:32 +0800
committerofshellohicy <ofshellohicy@gmail.com>2014-07-18 14:50:32 +0800
commit35d68cc0769f2f3c8fb0d63f85fc780b856a8209 (patch)
tree33821cc31b3fee53c20edd3da69784beea78d7f6
parentrst -> txt (diff)
downloadstackbin-35d68cc0769f2f3c8fb0d63f85fc780b856a8209.tar.gz
stackbin-35d68cc0769f2f3c8fb0d63f85fc780b856a8209.tar.bz2
stackbin-35d68cc0769f2f3c8fb0d63f85fc780b856a8209.zip
remove useless feature
-rw-r--r--pastebin.py1
-rw-r--r--static/pastebin.js16
-rw-r--r--static/small.css4
-rw-r--r--static/style.css9
-rw-r--r--templates/layout.html16
-rw-r--r--templates/show_paste.html3
6 files changed, 22 insertions, 27 deletions
diff --git a/pastebin.py b/pastebin.py
index 3824285..1a54812 100644
--- a/pastebin.py
+++ b/pastebin.py
@@ -89,6 +89,7 @@ def new_paste():
return render_template('new_paste.html', parent=parent)
+@app.route('/<int:paste_id>/')
@app.route('/<int:paste_id>')
def show_paste(paste_id):
paste = Paste.query.options(db.eagerload('children')).get_or_404(paste_id)
diff --git a/static/pastebin.js b/static/pastebin.js
index 8507726..4412595 100644
--- a/static/pastebin.js
+++ b/static/pastebin.js
@@ -1,11 +1,8 @@
(function() {
var global = this;
- var jug = new Juggernaut();
-
var lib = global.pastebin = {
urlRoot : '/',
- jug : jug,
autoHideFlashes : function() {
var flashes = $('p.flash:visible').hide();
@@ -38,19 +35,8 @@
if (reply.author)
msg.append($('<span></span>').text(' ' + reply.author))
lib.flash(msg);
- },
-
- subscribePaste : function(pasteID) {
- jug.subscribe('paste-replies:' + pasteID, function(data) {
- lib.onNewReply(data, 'paste');
- });
- },
-
- subscribeUser : function(userID) {
- jug.subscribe('user-replies:' + userID, function(data) {
- lib.onNewReply(data, 'user');
- });
}
+
};
diff --git a/static/small.css b/static/small.css
new file mode 100644
index 0000000..4ed0712
--- /dev/null
+++ b/static/small.css
@@ -0,0 +1,4 @@
+pre {
+ font-size: 18px;
+ line-height: 1.8em;
+}
diff --git a/static/style.css b/static/style.css
index 7b19c76..7905a59 100644
--- a/static/style.css
+++ b/static/style.css
@@ -1,6 +1,6 @@
body { margin: 0; padding: 0; }
body, input { font-size: 16px; font-family: 'Helvetica Neue', sans-serif; }
-.page { margin: 50px auto; width: 740px; }
+.page { margin: 50px auto; width: 100%; }
h1 { margin: 0; font-weight: normal; color: #c00; }
a { color: black; }
a:hover { color: #c00; }
@@ -13,9 +13,10 @@ dl dt { font-weight: bold; width: 90px; float: left;
clear: left; }
dl dd { float: left; margin: 0; padding: 0; }
pre, textarea { font-family: 'Consolas', monospace; font-size: 14px;
- background: #eee; padding: 0; margin: 0; }
-textarea { border: none; width: 720px; }
-.code, .flash { background: #eee; margin: 10px -30px; padding: 10px 30px; }
+ background: #eee; padding: 0; margin: 0;
+ word-break: break-word; white-space: pre-wrap;}
+textarea { border: none; width: 100%; }
+.code, .flash { background: #eee; padding: 20px; }
.pagination strong,
.pagination span.ellipsis,
.pagination a { border: 1px solid #d00; padding: 2px 6px; text-decoration: none; }
diff --git a/templates/layout.html b/templates/layout.html
index 206f750..229644d 100644
--- a/templates/layout.html
+++ b/templates/layout.html
@@ -1,25 +1,31 @@
<!doctype html>
<title>{% block title %}{% endblock %} | Flask Pastebin</title>
<link rel=stylesheet type=text/css href="{{ url_for('static', filename='style.css') }}">
-<script type=text/javascript src="{{ config.JUGGERNAUT_DRIVER }}"></script>
-<script type=text/javascript src="{{ url_for('static', filename='jquery.js') }}"></script>
+<link rel="stylesheet" media="screen and (max-width: 800px)"
+href="{{ url_for('static', filename='small.css') }}" />
+<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
+<meta name="apple-mobile-web-app-capable" content="yes">
+<meta name="apple-mobile-web-app-status-bar-style" content="black">
+<meta name="format-detection" content="telephone=no">
+
+{#<script type=text/javascript src="{{ url_for('static', filename='jquery.js') }}"></script>
<script type=text/javascript src="{{ url_for('static', filename='pastebin.js') }}"></script>
<script type=text/javascript>
pastebin.urlRoot = {{ request.url_root|tojson|safe }};
-{%- if g.user %}
- pastebin.subscribeUser({{ g.user.id }});
-{%- endif %}
</script>
+#}
<div class=page>
<h1>Flask Pastebin</h1>
<ul class=nav>
<li><a href="{{ url_for('new_paste') }}">New Paste</a>
+ {#
{% if g.user %}
<li><a href="{{ url_for('my_pastes') }}">My Pastes</a>
<li><a href="{{ url_for('logout') }}">Sign out ({{ g.user.display_name }})</a>
{% else %}
<li><a href="{{ url_for('login') }}">Sign in with Facebook</a>
{% endif %}
+ #}
</ul>
{% for message in get_flashed_messages() %}
<p class=flash>{{ message }}
diff --git a/templates/show_paste.html b/templates/show_paste.html
index 7eeaa4b..1c42e99 100644
--- a/templates/show_paste.html
+++ b/templates/show_paste.html
@@ -29,7 +29,4 @@
{% endif %}
</dl>
<div class=code><pre>{{ paste.code }}</pre></div>
- <script type=text/javascript>
- pastebin.subscribePaste({{ paste.id }});
- </script>
{% endblock %}
bgstack15