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:
parent
8baa8cbdb7
commit
02cc7035e8
@ -291,7 +291,9 @@ RenderCalendar.prototype.makeCDXRequest = function() {
|
|||||||
var spinner = document.getElementById(
|
var spinner = document.getElementById(
|
||||||
renderCal.domStructureIds.updatesSpinner
|
renderCal.domStructureIds.updatesSpinner
|
||||||
);
|
);
|
||||||
if (spinner) spinner.remove();
|
if (spinner && spinner.parentNode) {
|
||||||
|
spinner.parentNode.removeChild(spinner);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
queryWorker.postMessage({
|
queryWorker.postMessage({
|
||||||
@ -330,7 +332,9 @@ RenderCalendar.prototype.makeCDXRequest = function() {
|
|||||||
var spinner = document.getElementById(
|
var spinner = document.getElementById(
|
||||||
renderCal.domStructureIds.updatesSpinner
|
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) {
|
if (memoizedYMDT[timeInfo.year] == null) {
|
||||||
// we have not seen this year month day before
|
// we have not seen this year month day before
|
||||||
// create the year month day structure (occurs once per result year)
|
// create the year month day structure (occurs once per result year)
|
||||||
memoizedYMDT[timeInfo.year] = {
|
|
||||||
[timeInfo.month]: {
|
var timeVal = {};
|
||||||
[timeInfo.day]: {
|
timeVal[timeInfo.time] = 1;
|
||||||
[timeInfo.time]: 1
|
|
||||||
}
|
var dayVal = {};
|
||||||
}
|
dayVal[timeInfo.day] = timeVal;
|
||||||
};
|
|
||||||
|
var monthVal = {};
|
||||||
|
monthVal[timeInfo.month] = dayVal;
|
||||||
|
|
||||||
|
memoizedYMDT[timeInfo.year] = monthVal;
|
||||||
|
|
||||||
this.addRegYearListItem(timeInfo, active);
|
this.addRegYearListItem(timeInfo, active);
|
||||||
this.addRegYearMonthListItem(timeInfo, active);
|
this.addRegYearMonthListItem(timeInfo, active);
|
||||||
return this.addRegYearMonthDayListItem(cdxObj, timeInfo, 1, active);
|
return this.addRegYearMonthDayListItem(cdxObj, timeInfo, 1, active);
|
||||||
} else if (memoizedYMDT[timeInfo.year][timeInfo.month] == null) {
|
} else if (memoizedYMDT[timeInfo.year][timeInfo.month] == null) {
|
||||||
// we have seen the year before but not the month and day
|
// 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)
|
// create the month day structure (occurs for every new month encountered for an existing year)
|
||||||
memoizedYMDT[timeInfo.year][timeInfo.month] = {
|
var timeVal = {};
|
||||||
[timeInfo.day]: {
|
timeVal[timeInfo.time] = 1;
|
||||||
[timeInfo.time]: 1
|
|
||||||
}
|
var dayVal = {};
|
||||||
};
|
dayVal[timeInfo.day] = timeVal;
|
||||||
|
|
||||||
|
memoizedYMDT[timeInfo.year][timeInfo.month] = dayVal;
|
||||||
|
|
||||||
this.addRegYearMonthListItem(timeInfo, active);
|
this.addRegYearMonthListItem(timeInfo, active);
|
||||||
return this.addRegYearMonthDayListItem(cdxObj, timeInfo, 1, active);
|
return this.addRegYearMonthDayListItem(cdxObj, timeInfo, 1, active);
|
||||||
}
|
}
|
||||||
@ -571,9 +583,10 @@ RenderCalendar.prototype.renderDateCalPart = function(
|
|||||||
var month = memoizedYMDT[timeInfo.year][timeInfo.month];
|
var month = memoizedYMDT[timeInfo.year][timeInfo.month];
|
||||||
if (month[timeInfo.day] == null) {
|
if (month[timeInfo.day] == null) {
|
||||||
// never seen this day (case 1)
|
// never seen this day (case 1)
|
||||||
month[timeInfo.day] = {
|
var timeVal = {};
|
||||||
[timeInfo.time]: count
|
timeVal[timeInfo.time] = count;
|
||||||
};
|
|
||||||
|
month[timeInfo.day] = timeVal;
|
||||||
} else if (month[timeInfo.day][timeInfo.time] == null) {
|
} else if (month[timeInfo.day][timeInfo.time] == null) {
|
||||||
// we have seen this day before but not at this time (case 2)
|
// we have seen this day before but not at this time (case 2)
|
||||||
month[timeInfo.day][timeInfo.time] = count;
|
month[timeInfo.day][timeInfo.time] = count;
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
{% block head %}
|
{% block head %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
<link rel="stylesheet" href="{{ static_prefix }}/css/query.css">
|
<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>
|
<script src="{{ static_prefix }}/query.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
2
static/url-polyfill.min.js
vendored
Normal file
2
static/url-polyfill.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user