diff --git a/pywb/rewrite/test/test_html_rewriter.py b/pywb/rewrite/test/test_html_rewriter.py index cd7ab24b..151523b5 100644 --- a/pywb/rewrite/test/test_html_rewriter.py +++ b/pywb/rewrite/test/test_html_rewriter.py @@ -256,7 +256,7 @@ r""" >>> parse('') - + >>> parse("") diff --git a/pywb/static/query.js b/pywb/static/query.js index 6bba8fb0..d78cda40 100644 --- a/pywb/static/query.js +++ b/pywb/static/query.js @@ -249,14 +249,12 @@ RenderCalendar.prototype.makeCDXRequest = function() { var queryWorker = new window.Worker(this.staticPrefix + '/queryWorker.js'); var cdxRecordMsg = 'cdxRecord'; var done = 'finished'; - var months = this.text.months; queryWorker.onmessage = function(msg) { var data = msg.data; var terminate = false; if (data.type === cdxRecordMsg) { - data.timeInfo.month = months[data.timeInfo.month]; // render the results sent to us from the worker @@ -586,9 +584,14 @@ RenderCalendar.prototype.renderDateCalPart = function( * Updates the advanced view with the supplied cdx information * @param {Object} cdxObj - CDX object for this capture */ -RenderCalendar.prototype.renderAdvancedSearchPart = function (cdxObj) { +RenderCalendar.prototype.renderAdvancedSearchPart = function(cdxObj) { // display the URL of the result - var displayedInfo = [{ tag: 'small', innerText: this.text.dateTime + this.ts_to_date(cdxObj.timestamp) }]; + var displayedInfo = [ + { + tag: 'small', + innerText: this.text.dateTime + this.tsToDate(cdxObj.timestamp) + } + ]; // display additional information about the result under the URL if (cdxObj.mime) { displayedInfo.push({ @@ -1024,7 +1027,7 @@ RenderCalendar.prototype.dateOrdinal = function(d) { * @param {boolean} [is_gmt] - Should the timestamp be converted to a gmt string * @returns {string} */ -RenderCalendar.prototype.tsToDate = function ts_to_date(ts, is_gmt) { +RenderCalendar.prototype.tsToDate = function(ts, is_gmt) { if (ts.length < 14) return ts; var datestr = ts.substring(0, 4) + diff --git a/pywb/templates/head_insert.html b/pywb/templates/head_insert.html index 2527d89c..e6deac41 100644 --- a/pywb/templates/head_insert.html +++ b/pywb/templates/head_insert.html @@ -3,7 +3,7 @@ {% set urlsplit = cdx.url | urlsplit %} wbinfo = {}; wbinfo.top_url = "{{ top_url }}"; -{% if is_framed == 'true' %} +{% if is_framed %} // Fast Top-Frame Redirect if (window == window.top && wbinfo.top_url) { var loc = window.location.href.replace(window.location.hash, ""); diff --git a/pywb/warcserver/index/indexsource.py b/pywb/warcserver/index/indexsource.py index 9aa8ebe3..afd9dce6 100644 --- a/pywb/warcserver/index/indexsource.py +++ b/pywb/warcserver/index/indexsource.py @@ -1,21 +1,12 @@ -import logging -import re - -import redis -import requests +from six.moves.urllib.parse import quote_plus from warcio.timeutils import PAD_14_DOWN, http_date_to_timestamp, pad_timestamp, timestamp_now, timestamp_to_http_date from pywb.utils.binsearch import iter_range from pywb.utils.canonicalize import canonicalize -from pywb.utils.wbexception import NotFoundException, BadRequestException - -from warcio.timeutils import timestamp_to_http_date, http_date_to_timestamp -from warcio.timeutils import timestamp_now, pad_timestamp, PAD_14_DOWN - from pywb.utils.format import res_template from pywb.utils.io import no_except_close from pywb.utils.memento import MementoUtils -from pywb.utils.wbexception import NotFoundException +from pywb.utils.wbexception import BadRequestException, NotFoundException from pywb.warcserver.http import DefaultAdapters from pywb.warcserver.index.cdxobject import CDXObject from pywb.warcserver.index.cdxops import cdx_sort_closest