1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

query: fix query for IE11, don't use ES6 syntax, add URL polyfill (#514)

This commit is contained in:
Ilya Kreymer 2019-10-31 17:09:42 -07:00 committed by GitHub
parent 8baa8cbdb7
commit 02cc7035e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 17 deletions

View File

@ -291,7 +291,9 @@ RenderCalendar.prototype.makeCDXRequest = function() {
var spinner = document.getElementById(
renderCal.domStructureIds.updatesSpinner
);
if (spinner) spinner.remove();
if (spinner && spinner.parentNode) {
spinner.parentNode.removeChild(spinner);
}
}
};
queryWorker.postMessage({
@ -330,7 +332,9 @@ RenderCalendar.prototype.makeCDXRequest = function() {
var spinner = document.getElementById(
renderCal.domStructureIds.updatesSpinner
);
if (spinner) spinner.remove();
if (spinner && spinner.parentNode) {
spinner.parentNode.removeChild(spinner);
}
}
});
};
@ -545,24 +549,32 @@ RenderCalendar.prototype.renderDateCalPart = function(
if (memoizedYMDT[timeInfo.year] == null) {
// we have not seen this year month day before
// create the year month day structure (occurs once per result year)
memoizedYMDT[timeInfo.year] = {
[timeInfo.month]: {
[timeInfo.day]: {
[timeInfo.time]: 1
}
}
};
var timeVal = {};
timeVal[timeInfo.time] = 1;
var dayVal = {};
dayVal[timeInfo.day] = timeVal;
var monthVal = {};
monthVal[timeInfo.month] = dayVal;
memoizedYMDT[timeInfo.year] = monthVal;
this.addRegYearListItem(timeInfo, active);
this.addRegYearMonthListItem(timeInfo, active);
return this.addRegYearMonthDayListItem(cdxObj, timeInfo, 1, active);
} else if (memoizedYMDT[timeInfo.year][timeInfo.month] == null) {
// we have seen the year before but not the month and day
// create the month day structure (occurs for every new month encountered for an existing year)
memoizedYMDT[timeInfo.year][timeInfo.month] = {
[timeInfo.day]: {
[timeInfo.time]: 1
}
};
var timeVal = {};
timeVal[timeInfo.time] = 1;
var dayVal = {};
dayVal[timeInfo.day] = timeVal;
memoizedYMDT[timeInfo.year][timeInfo.month] = dayVal;
this.addRegYearMonthListItem(timeInfo, active);
return this.addRegYearMonthDayListItem(cdxObj, timeInfo, 1, active);
}
@ -571,9 +583,10 @@ RenderCalendar.prototype.renderDateCalPart = function(
var month = memoizedYMDT[timeInfo.year][timeInfo.month];
if (month[timeInfo.day] == null) {
// never seen this day (case 1)
month[timeInfo.day] = {
[timeInfo.time]: count
};
var timeVal = {};
timeVal[timeInfo.time] = count;
month[timeInfo.day] = timeVal;
} else if (month[timeInfo.day][timeInfo.time] == null) {
// we have seen this day before but not at this time (case 2)
month[timeInfo.day][timeInfo.time] = count;

View File

@ -7,6 +7,7 @@
{% block head %}
{{ super() }}
<link rel="stylesheet" href="{{ static_prefix }}/css/query.css">
<script src="{{ static_prefix }}/url-polyfill.min.js"></script>
<script src="{{ static_prefix }}/query.js"></script>
{% endblock %}

2
static/url-polyfill.min.js vendored Normal file

File diff suppressed because one or more lines are too long