PageSourceSearch

https://www.dcbib.dk/modules/contrib/facets_date_range/js/date-range.js?v=11.4.7

js dcbib.dk collected 2026-10-02 18:44:38 UTC 1,235 bytes, 37 lines download raw bytes

1/**
2* DO NOT EDIT THIS FILE.
3* See the following change record for more information,
4* https://www.drupal.org/node/2815083
5* @preserve
6**/
7
8(function ($) {
9  Drupal.facets = Drupal.facets || {};
10  Drupal.behaviors.facetsDateRange = {
11    attach: function attach(context, settings) {
12      function toTimestamp(strDate) {
13        var datum = Date.parse(strDate);
14        return datum / 1000;
15      }
16
17      function autoSubmit() {
18        var $this = $(this);
19        var facetId = $this.parents(".facets-widget-date_range").find("ul").attr("data-drupal-facet-id");
20        var daterange = settings.facets.daterange[facetId];
21        var min = toTimestamp($("input[id=".concat(facetId, "_min]")).val()) || "";
22        var max = toTimestamp($("input[id=".concat(facetId, "_max]")).val()) || "";
23        window.location.href = daterange.url.replace("__date_range_min__", min).replace("__date_range_max__", max);
24      }
25
26      $("input.facet-date-range", context).on("change", autoSubmit);
27      $("input.facet-date-range", context).on("keypress", function (e) {
28        $(this).off("change blur");
29        $(this).on("blur", autoSubmit);
30
31        if (e.keyCode === 13) {
32          autoSubmit();
33        }
34      });
35    }
36  };
37})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.