diff --git a/pywb/static/query.js b/pywb/static/query.js
index fd0a0450..ec69033e 100644
--- a/pywb/static/query.js
+++ b/pywb/static/query.js
@@ -956,11 +956,11 @@ RenderCalendar.prototype.niceDateRange = function() {
var from = this.queryInfo.searchParams.from;
var to = this.queryInfo.searchParams.to;
if (from && to) {
- return 'From ' + from + ' to ' + to;
+ return [text.from, from, text.until, to].join(' ');
} else if (from) {
- return 'From ' + from + ' until ' + 'present';
+ return [text.from, from, text.until, text.present].join(' ');
}
- return 'From earliest until ' + to;
+ return [text.from, text.earliest, text.until, to].join(' ');
};
/**
diff --git a/pywb/static/search.js b/pywb/static/search.js
index eafa0023..d9ca082b 100644
--- a/pywb/static/search.js
+++ b/pywb/static/search.js
@@ -14,17 +14,33 @@ var elemIds = {
},
dateTime: {
from: 'dt-from',
+ fromTime: 'ts-from',
fromBad: 'dt-from-bad',
to: 'dt-to',
+ toTime: 'ts-to',
toBad: 'dt-to-bad'
},
match: 'match-type-select',
url: 'search-url',
form: 'search-form',
resultsNewWindow: 'open-results-new-window',
- advancedOptions: 'advanced-options'
+ advancedOptions: 'advanced-options',
+ clearOptions: 'clear-options',
};
+function clearOptions(event) {
+ for (const field of [
+ elemIds.match,
+ elemIds.dateTime.from,
+ elemIds.dateTime.fromTime,
+ elemIds.dateTime.to,
+ elemIds.dateTime.toTime,
+ ]) {
+ document.getElementById(field).value = '';
+ }
+ clearFilters(event);
+}
+
function makeCheckDateRangeChecker(dtInputId, dtBadNotice) {
var dtInput = document.getElementById(dtInputId);
dtInput.onblur = function() {
@@ -138,11 +154,13 @@ function performQuery(url) {
}
var fromT = document.getElementById(elemIds.dateTime.from).value;
if (fromT) {
- query.push('from=' + fromT.trim());
+ fromT += document.getElementById(elemIds.dateTime.fromTime).value;
+ query.push('from=' + fromT.replace(/[^0-9]/g, ''));
}
var toT = document.getElementById(elemIds.dateTime.to).value;
if (toT) {
- query.push('to=' + toT.trim());
+ toT += document.getElementById(elemIds.dateTime.toTime).value;
+ query.push('to=' + toT.replace(/[^0-9]/g, ''));
}
var builtQuery = query.join('&');
if (document.getElementById(elemIds.resultsNewWindow).checked) {
@@ -188,6 +206,7 @@ $(document).ready(function() {
elemIds.dateTime.to,
document.getElementById(elemIds.dateTime.toBad)
);
+ document.getElementById(elemIds.clearOptions).onclick = clearOptions;
document.getElementById(elemIds.filtering.add).onclick = addFilter;
document.getElementById(elemIds.filtering.clear).onclick = clearFilters;
var searchURLInput = document.getElementById(elemIds.url);
@@ -195,9 +214,6 @@ $(document).ready(function() {
form.addEventListener('submit', function(event) {
submitForm(event, form, searchURLInput);
});
- document.getElementById(elemIds.advancedOptions).onclick = function() {
- validateFields(form);
- }
var filteringExpression = document.getElementById(elemIds.filtering.expression);
filteringExpression.addEventListener("keypress", function(event) {
if (event.key === "Enter") {
diff --git a/pywb/templates/instructions.html b/pywb/templates/instructions.html
new file mode 100644
index 00000000..211df2d1
--- /dev/null
+++ b/pywb/templates/instructions.html
@@ -0,0 +1,216 @@
+
+
+
+
+
{{ _("Search instructions") }}
+
+
+
+
{{ _("URL") }}
+
+
+
+
+ {%trans%}A URL consists of several parts:{%endtrans%}
+ {%trans%}protocol://host:port/path?query{%endtrans%}
+
+
+
+ {%trans%}The protocol:// prefix is ignored when searching as it's not part of the searchable data.{%endtrans%}
+
+
+ {%trans%}A leading www. in the host will also be ignored for the same reason.{%endtrans%}
+
+
+
+ {%trans%}The host contains one or more parts separated by periods (.).{%endtrans%}
+ {%trans%}The part before the first period is called the hostname.{%endtrans%}
+ {%trans%}The part after the last period is the top level domain.{%endtrans%}
+ {%trans%}Every part added to the left of the top level domain sub-domain.{%endtrans%}
+ {%trans%}I.e. x.y.z is a sub-domain of y.z{%endtrans%}
+ {%trans%}which in turn is a sub-domain of the top level domainz{%endtrans%}
+
+
+
+ {%trans%}See Match Type below for interpretations of the search string.{%endtrans%}
+
+
+
+
+
+
{{ _("Results Display") }}
+
+
+
+
+ {%trans%}For the Default search mode, the results are shown in a calendar view unless a filter is also added.{%endtrans%}
+ {%trans%}For all other cases the results will be displayed in a list.{%endtrans%}
+
+
+
+
+
+
{{ _("Search Options") }}
+
{{ _("Match Type") }}
+
{{ _("There are four different search modes:") }}
+
+
+
+
{{ _("Default") }}
+
+
+ {%trans%}In the default mode the exact URL (minus the ignored prefixes mentioned above) is searched for.{%endtrans%}
+ {%trans%}If one leading or trailing wildcard asterisk (*) is added, see Prefix and Domain below.{%endtrans%}
+
+
+ {%trans%}Any other asterisks will be considered literal parts of the search string.{%endtrans%}
+ {%trans%}Hence, adding both a leading and a trailing wildcard asterisk is not possible.{%endtrans%}
+
+ {%trans%}This will return all URL:s that begin with the given string.{%endtrans%}
+ {%trans%}It returns the same results as Default with a trailing wildcard asterisk.{%endtrans%}
+
+ {%trans%}This is similar to the previous but doesn't require the whole host.{%endtrans%}
+ {%trans%}It returns the same results as Default with a leading wildcard asterisk and a period (i.e. *.).{%endtrans%}
+ {%trans%}The leading wildcard matches zero or more sub-domains as well as zero or one hostname.{%endtrans%}
+
+ {%trans%}One may specify a start and/or an end timestamp to further restrict the search - both are inclusive.{%endtrans%}
+ {%trans%}The timestamps consist of a date and an optional time of day.{%endtrans%}
+ {%trans%}The layout of these input fields are subject to which browser is used.{%endtrans%}
+
+ {%trans%}Finally one may add extra filters for Mime Type, Status and URL.{%endtrans%}
+ {%trans%}For each filter one needs to specify one of the three attributes, one of a set of relations and a string.{%endtrans%}
+ {%trans%}If more than one filter is added, they will all be applied to the list of results.{%endtrans%}
+
+
{%trans%}Remember to actually add the filter before submitting the search.{%endtrans%}