mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
static files:
- formatted them according to project - query.js: ensured correct timestamp to date function is used templates: - head_insert.html: is_framed check is no longer a string it is a boolean, corrected redirect check tests: - test_html_rewriter.py: added missing rewrite modifier test checking i.style containing a background image html encoded warcserver: - added missing quote_plus import and cleaned up imports
This commit is contained in:
parent
61b6ff21e1
commit
e34606cecb
@ -256,7 +256,7 @@ r"""
|
||||
<i style="background-image: url("/web/20131226101010oe_/http://foo.example.com/")"></i>
|
||||
|
||||
>>> parse('<i style=\'background-image: url('http://foo.example.com/')\'></i>')
|
||||
<i style="background-image: url('/web/20131226101010/http://foo.example.com/')"></i>
|
||||
<i style="background-image: url('/web/20131226101010oe_/http://foo.example.com/')"></i>
|
||||
|
||||
>>> parse("<i style='background-image: url('http://foo.example.com/')'></i>")
|
||||
<i style="background-image: url('/web/20131226101010oe_/http://foo.example.com/')"></i>
|
||||
|
@ -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
|
||||
@ -588,7 +586,12 @@ RenderCalendar.prototype.renderDateCalPart = function(
|
||||
*/
|
||||
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) +
|
||||
|
@ -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, "");
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user