PageSourceSearch

https://piperalderman.com.au/wp-content/themes/piperalderman-child-new/js/auto-complete.js?ver=1790280442

js piperalderman.com.au collected 2026-09-24 20:18:55 UTC 4,484 bytes, 105 lines download raw bytes

1jQuery(document).ready(function($){
2
3    $('#lawyer-search-input').autoComplete({
4        minChars:3,
5        source: function(name, response) {
6            $.ajax({
7                type: 'POST',
8                dataType: 'json',
9                url: '/wp-admin/admin-ajax.php',
10                data: 'action=get_listing_names&name='+name,
11                success: function(data) {
12                    response(data);
13                }
14            });
15        },
16        renderItem: function (item, search){
17            console.log('item: ', item,'search: ',search);
18            // escape special characters
19            search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
20            var re = new RegExp("(" + search.split(' ').join('|') + ")", "gi");
21            return '<div class="autocomplete-suggestion" data-val="' + item + '">' + item.replace(re, "<b>$1</b>").replace("\\", "") + '</div>';
22        },
23        onSelect: function(e, term, item){
24            var url = "/member/"+ term.replace(" ", "-").replace(/\\/g,'').replace("’",'');
25            window.open(url,'_blank');
26        }
27    });
28
29    $('#insight-search-authors-input').autoComplete({
30        minChars:3,
31        source: function(name, response) {
32            $.ajax({
33                type: 'POST',
34                dataType: 'json',
35                url: '/wp-admin/admin-ajax.php',
36                data: 'action=get_listing_names&name='+name,
37                success: function(data) {
38                    response(data);
39                }
40            });
41        },
42        renderItem: function (item, search){
43            console.log('item: ', item,'search: ',search);
44
45            // escape special characters
46            search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
47            var re = new RegExp("(" + search.split(' ').join('|') + ")", "gi");
48            return '<div class="autocomplete-suggestion" data-val="' + item + '">' + item.replace(re, "<b>$1</b>").replace("\\", "") + '</div>';
49        },
50        onSelect: function(e, term, item){
51            var url = "/?post_type=insight&authors="+ term.replace(/\s-\s|\s/g, "-").replace(/\\/g,'').replace("’",'').replace("‘",'').replace("(",'').replace(")",'');
52            window.open(url,'_self');
53        }
54    });
55
56    $('#insight-search-input').autoComplete({
57        minChars:3,
58        source: function(name, response) {
59            $.ajax({
60                type: 'POST',
61                dataType: 'json',
62                url: '/wp-admin/admin-ajax.php',
63                data: 'action=get_listing_names_2&name='+name,
64                success: function(data) {
65                    response(data);
66                }
67            });
68        },
69        renderItem: function (item, search){
70            // escape special characters
71            search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
72            var re = new RegExp("(" + search.split(' ').join('|') + ")", "gi");
73            return '<div class="autocomplete-suggestion" data-val="' + item + '">' + item.replace(re, "<b>$1</b>").replace("\\", "") + '</div>';
74        },
75        onSelect: function(e, term, item){
76            var url = "/insight/"+ term.replace(/\s-\s|\s/g, "-").replace(/\\/g,'').replace("’",'').replace("‘",'').replace("(",'').replace(")",'');
77            window.open(url,'_blank');
78        }
79    });
80
81    $('#case-study-search-input').autoComplete({
82        minChars:3,
83        source: function(name, response) {
84            $.ajax({
85                type: 'POST',
86                dataType: 'json',
87                url: '/wp-admin/admin-ajax.php',
88                data: 'action=get_listing_names_3&name='+name,
89                success: function(data) {
90                    response(data);
91                }
92            });
93        },
94        renderItem: function (item, search){
95            // escape special characters
96            search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
97            var re = new RegExp("(" + search.split(' ').join('|') + ")", "gi");
98            return '<div class="autocomplete-suggestion" data-val="' + item + '">' + item.replace(re, "<b>$1</b>").replace("\\", "") + '</div>';
99        },
100        onSelect: function(e, term, item){
101            var url = "/case-study/"+ term.replace(/\s-\s|\s/g, "-").replace(/\\/g,'').replace("’",'');
102            window.open(url,'_blank');
103        }
104    });
105});

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.