1
0
mirror of https://github.com/Tygs/0bin.git synced 2023-08-10 21:13:00 +03:00

ScrollTop when alert appear

This commit is contained in:
max 2012-05-01 20:46:18 +07:00
parent 729aac96f5
commit e65ab51d74
3 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import os
import math
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
STATIC_FILES_ROOT = os.path.join(ROOT_DIR, 'static')
@ -29,3 +30,4 @@ GROUP = None
# limit size of pasted text in bytes. Be carefull allowing too much size can slow down user's
# browser
MAX_SIZE = 1024 * 500
MAX_SIZE_KB = int(math.ceil(MAX_SIZE / 1024.0))

View File

@ -32,8 +32,7 @@ app = Bottle()
@app.route('/')
@view('home')
def index():
max_size_kb = int(math.ceil(settings.MAX_SIZE / 1024.0))
return {'max_size': settings.MAX_SIZE, 'max_size_kb': max_size_kb}
return {'max_size': settings.MAX_SIZE, 'max_size_kb': settings.MAX_SIZE_KB}
@app.route('/paste/create', method='POST')
@ -93,7 +92,7 @@ def display_paste(paste_id):
except (TypeError, ValueError):
abort(404, u"This paste doesn't exist or has expired")
return {'paste': paste, 'keep_alive': keep_alive}
return {'paste': paste, 'keep_alive': keep_alive, 'max_size': settings.MAX_SIZE, 'max_size_kb': settings.MAX_SIZE_KB}
@clize.clize

View File

@ -74,4 +74,4 @@
</span>
%rebase base
%rebase base max_size=max_size