PageSourceSearch

https://www.livingwithbirds.com/assets/custom/searches-31f03d15eb7…e94eb58e425f57698a79429dd2ade5915d0754c2.js

js livingwithbirds.com collected 2026-09-26 12:18:50 UTC 1,972 bytes, 80 lines download raw bytes

1let Searches;
2
3Searches = (function() {
4  function Searches() {}
5
6  Searches.prototype.init = function() {
7    this.set_auto_complete();
8    this.set_filter_actions();
9    this.set_back_reload();
10  };
11
12  Searches.prototype.set_auto_complete = function() {
13    $('#sw').autocomplete({
14      serviceUrl: '/searches',
15      triggerSelectOnValidInput: false,
16      onSelect: function(suggestion) {
17        $('#top_search').submit();
18      }
19    });
20
21    // new Bootstrap forms
22    $('#bs_sw').autocomplete({
23      serviceUrl: '/searches',
24      triggerSelectOnValidInput: false,
25      onSelect: function(suggestion) {
26        $('#f_bs_s').submit();
27      }
28    });
29    $('#bs_sw_m').autocomplete({
30      serviceUrl: '/searches?m=1',
31      triggerSelectOnValidInput: false,
32      onSelect: function(suggestion) {
33        $('#f_bs_s_m').submit();
34      }
35    });
36  };
37
38  Searches.prototype.set_filter_actions = function() {
39    $('.search_form_main').bind("submit", function() {
40      return false;
41    });
42    $(".filter").bind("click", function() {
43      var sf, sw;
44      sf = '';
45      $(this).closest('form').find('.filter').each(function() {
46        if (this.checked) {
47          sf += $(this).val() + ',';
48        }
49      });
50      sf = sf.replace(/\,$/, '');
51      sw = $('input[name="sw"]').val();
52
53      console.log(sf);
54      console.log(sw);
55
56      $('input[name="sf"]').val(sf);
57      if (window.history.pushState) {
58        window.history.pushState("string", "Title", "/search?sw=" + encodeURI(sw) + "&sf=" + encodeURI(sf));
59        $.post('/search/0', $(this).closest('form').serialize());
60      } else {
61        window.location = "/search?sw=" + encodeURI(sw) + "&sf=" + encodeURI(sf);
62      }
63    });
64  };
65
66  Searches.prototype.set_back_reload = function() {
67    window.onpopstate = function(e) {
68      if (e.state !== null) {
69        window.location.reload();
70      } else {
71
72      }
73    };
74  };
75
76  return Searches;
77
78})();
79
80window.app.searches = new Searches;

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.