dfdfs
This commit is contained in:
parent
eadf6a7708
commit
5f6980ea6e
6 changed files with 7 additions and 14 deletions
|
@ -1 +0,0 @@
|
||||||
importScripts();
|
|
1
files/assets/js/service-worker.js
Normal file
1
files/assets/js/service-worker.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
importScripts("https://js.pusher.com/beams/service-worker.js");
|
|
@ -8,11 +8,9 @@ def lazy(f):
|
||||||
|
|
||||||
o = args[0]
|
o = args[0]
|
||||||
|
|
||||||
if "_lazy" not in o.__dict__:
|
if "_lazy" not in o.__dict__: o.__dict__["_lazy"] = {}
|
||||||
o.__dict__["_lazy"] = {}
|
|
||||||
|
|
||||||
if f.__name__ not in o.__dict__["_lazy"]:
|
if f.__name__ not in o.__dict__["_lazy"]: o.__dict__["_lazy"][f.__name__] = f(*args, **kwargs)
|
||||||
o.__dict__["_lazy"][f.__name__] = f(*args, **kwargs)
|
|
||||||
|
|
||||||
return o.__dict__["_lazy"][f.__name__]
|
return o.__dict__["_lazy"][f.__name__]
|
||||||
|
|
||||||
|
|
|
@ -132,10 +132,6 @@ def log_item(id, v):
|
||||||
action=action
|
action=action
|
||||||
)
|
)
|
||||||
|
|
||||||
@app.route("/sex")
|
|
||||||
def index():
|
|
||||||
return render_template("index.html", **{"greeting": "Hello from Flask!"})
|
|
||||||
|
|
||||||
@app.get("/assets/favicon.ico")
|
@app.get("/assets/favicon.ico")
|
||||||
def favicon():
|
def favicon():
|
||||||
return send_file(f"./assets/images/{site_name}/icon.webp")
|
return send_file(f"./assets/images/{site_name}/icon.webp")
|
||||||
|
@ -248,8 +244,7 @@ def googleplayapp():
|
||||||
|
|
||||||
@app.route("/service-worker.js")
|
@app.route("/service-worker.js")
|
||||||
def serviceworker():
|
def serviceworker():
|
||||||
return redirect("https://js.pusher.com/beams/service-worker.js")
|
with open("files/assets/js/service-worker.js", "r") as f: return Response(f.read(), mimetype='application/javascript')
|
||||||
|
|
||||||
|
|
||||||
@app.get("/settings/security")
|
@app.get("/settings/security")
|
||||||
@auth_required
|
@auth_required
|
||||||
|
|
|
@ -156,5 +156,5 @@ def api_vote_comment(comment_id, new, v):
|
||||||
comment.downvotes = g.db.query(CommentVote).options(lazyload('*')).filter_by(comment_id=comment.id, vote_type=-1).count()
|
comment.downvotes = g.db.query(CommentVote).options(lazyload('*')).filter_by(comment_id=comment.id, vote_type=-1).count()
|
||||||
g.db.add(comment)
|
g.db.add(comment)
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
except: g.db.rolleback()
|
except: g.db.rollback()
|
||||||
return "", 204
|
return "", 204
|
|
@ -209,8 +209,8 @@
|
||||||
|
|
||||||
{% if p.award_count("stars") %}
|
{% if p.award_count("stars") %}
|
||||||
<script src="/assets/js/star.js" type="text/javascript"></script>
|
<script src="/assets/js/star.js" type="text/javascript"></script>
|
||||||
{% set minbugs = 30*p.award_count("stars") if p.award_count("stars") <= 5 else 100 %}
|
{% set minbugs = 10*p.award_count("stars") if p.award_count("stars") <= 5 else 50 %}
|
||||||
{% set maxbugs = 60*p.award_count("stars") if p.award_count("stars") <= 5 else 200 %}
|
{% set maxbugs = 20*p.award_count("stars") if p.award_count("stars") <= 5 else 100 %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
new BugController({
|
new BugController({
|
||||||
imageSprite: "/assets/images/star.png",
|
imageSprite: "/assets/images/star.png",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue