From 03ab03f06ef1aa695037aa736e5a4ca849a00f73 Mon Sep 17 00:00:00 2001 From: OzzieIsaacs Date: Wed, 22 Nov 2017 22:08:29 +0100 Subject: [PATCH] Code cosmetics --- cps/static/js/kthoom.js | 16 ++++++++-------- cps/web.py | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cps/static/js/kthoom.js b/cps/static/js/kthoom.js index 28d6ecd2..2f82503f 100644 --- a/cps/static/js/kthoom.js +++ b/cps/static/js/kthoom.js @@ -17,7 +17,7 @@ */ /* global screenfull */ -var start = 0; +// var start = 0; if (window.opera) { window.console.log = function(str) { @@ -271,7 +271,7 @@ kthoom.setProgressMeter = function(pct, optLabel) { //getElem('nav').className = ''; getElem("progress").className = ""; } -} +}; function loadFromArrayBuffer(ab) { var f = []; @@ -301,7 +301,7 @@ function loadFromArrayBuffer(ab) { if (imageFiles.length === currentImage + 1) { updatePage(); } -}; +} function updatePage() { @@ -449,7 +449,7 @@ function updateScale(clear) { var maxheight = innerHeight - 50; if (!clear) { - switch(settings.fitMode) { + switch (settings.fitMode) { case kthoom.Key.B: mainImageStyle.maxWidth = "100%"; mainImageStyle.maxHeight = maxheight + "px"; @@ -556,7 +556,7 @@ function ImageLoadCallback() { } } function init(fileid) { - start = (new Date).getTime(); + // start = (new Date).getTime(); var request = new XMLHttpRequest(); request.open("GET", fileid); request.responseType = "json"; @@ -611,7 +611,7 @@ function init(fileid) { // Fullscreen mode if (typeof screenfull !== "undefined") { - $("#fullscreen").click(function(evt) { + $("#fullscreen").click(function() { screenfull.toggle($("#container")[0]); }); @@ -634,8 +634,8 @@ function init(fileid) { var comicHeight = evt.target.clientHeight; var offsetX = (mainContentWidth - comicWidth) / 2; var offsetY = (mainContentHeight - comicHeight) / 2; - var clickX = !!evt.offsetX ? evt.offsetX : (evt.clientX - offsetX); - var clickY = !!evt.offsetY ? evt.offsetY : (evt.clientY - offsetY); + var clickX = evt.offsetX ? evt.offsetX : (evt.clientX - offsetX); + var clickY = evt.offsetY ? evt.offsetY : (evt.clientY - offsetY); // Determine if the user clicked/tapped the left side or the // right side of the page. diff --git a/cps/web.py b/cps/web.py index 4ae940b3..8c5fff61 100755 --- a/cps/web.py +++ b/cps/web.py @@ -838,7 +838,7 @@ def feed_series(book_id): off = request.args.get("offset") if not off: off = 0 - entries, random, pagination = fill_indexpage((int(off) / (int(config.config_books_per_page)) + 1), + entries, __, pagination = fill_indexpage((int(off) / (int(config.config_books_per_page)) + 1), db.Books, db.Books.series.any(db.Series.id == book_id),db.Books.series_index) xml = render_title_template('feed.xml', entries=entries, pagination=pagination) response = make_response(xml)