PageSourceSearch

https://www.galliardhomes.com/modules/custom/galliard_forms/galliard_forms/js/search.js?tltn2f

js galliardhomes.com collected 2026-10-02 11:35:22 UTC 8,624 bytes, 208 lines download raw bytes

1/*
2(function(window, document, Drupal, $) {
3    var mapInitialView;
4
5    function toggleFilters(context) {
6        $(context).toggleClass('active');
7        $(context).parents('.form-inline').toggleClass('filters-visible');
8    }
9
10    function addMapParameter() {
11        var $form = $('#views-exposed-form-galliard-developments-page-1');
12        $form.append('<input type="hidden" name="map" value="1">');
13    }
14
15    function removeMapParameter() {
16      var $form = $('#views-exposed-form-galliard-developments-page-1');
17      $form.find(':input[name="map"]').detach();
18    }
19
20    Drupal.behaviors.galliardFormsSearch = {
21        attach: function (context, settings) {
22            if ($('.view-galliard-developments.view-display-id-page_1').length !== 0) {
23                $('#edit-filters').once('addHandler').click(function(e) {
24                    e.preventDefault();
25                    toggleFilters(this);
26                });
27
28                $('.map-view').hide();
29                $('.map-view .dev-links').hide();
30
31                // show hide map or list developments
32                $('#map-view').once('addHandler').click(function (e) {
33                    e.preventDefault();
34                    $('#list-view').removeClass('btn-default active');
35                    $(this).addClass('btn-default active');
36                    $('.fields-list').hide();
37                    $('.pager-nav').hide();
38                  $('body').addClass('development-map-visible');
39                    google.maps.event.trigger($('.gm-style')[0], 'resize');
40                  addMapParameter();
41                });
42
43                $('#list-view').once('addHandler').click(function (e) {
44                    e.preventDefault();
45                    $('#map-view').removeClass('btn-default active');
46                    $(this).addClass('btn-default active');
47                    $('.fields-list').show();
48                    $('.pager-nav').show();
49                  $('body').removeClass('development-map-visible');
50                  removeMapParameter();
51                });
52
53                // Submit the form as soon as any filter changes
54                // $('.view-galliard-developments.view-display-id-page_1 :input').once('galliardFormsSearch').on('change', function() {
55                //     $(this).parents('form').submit();
56                // });
57            }
58
59            if ($('.view-property-search.view-display-id-page_seo').length !== 0) {
60
61                $('.map-view').hide();
62                $('.map-view .dev-links').hide();
63
64                // show hide map or list developments
65                $('#map-view').once('addHandler').click(function (e) {
66                  e.preventDefault();
67                  $('#list-view').removeClass('btn-default');
68                  $(this).addClass('btn-default');
69                  $('.map-view').removeClass('hidden').show();
70                  $('.fields-list').hide();
71                  $('.pager-nav').hide();
72                  $('body').addClass('development-map-visible');
73                  google.maps.event.trigger($('.gm-style')[0], 'resize');
74                  addMapParameter();
75                });
76
77                $('#list-view').once('addHandler').click(function (e) {
78                  e.preventDefault();
79                  $('#map-view').removeClass('btn-default');
80                  $(this).addClass('btn-default');
81                  $('.fields-list').show();
82                  $('.pager-nav').show();
83                  $('.map-view').hide();
84                  $('body').removeClass('development-map-visible');
85                  removeMapParameter();
86                });
87            }
88
89            if ($('.view-property-search.view-display-id-page_1, .view-property-search.view-display-id-page_seo').length !== 0) {
90                // Filters are visible on load only if search params are not in use
91                $('body').once('filtersVisibleOnLoad').each(function () {
92                    // if ($('.view-property-search.view-display-id-page_seo').length === 0 && !/\?/.test(location.search)) {
93                    //     toggleFilters('#edit-filters');
94                    // } else {
95                        $('#edit-filters').parents('.form-inline').toggleClass('buttons-visible');
96                    // }
97                });
98
99                $('#edit-filters').once('addHandler').click(function (e) {
100                    e.preventDefault();
101                    toggleFilters(this);
102                });
103            }
104
105            if ($('.view-property-search.view-display-id-property_sold_embed').length !== 0) {
106                // Filters never visible on load
107                $('body').once('filtersVisibleOnLoad').each(function() {
108                    $('#edit-filters').parents('.form-inline').toggleClass('buttons-visible');
109                });
110
111                $('#edit-filters').once('addHandler').click(function (e) {
112                    e.preventDefault();
113                    toggleFilters(this);
114                });
115            }
116
117            if ($('.view-id-topictaxonomy.view-display-id-page_1').length !== 0) {
118
119                if (/\?/.test(location.search)) {
120                    // Filters are visible on load if search params are in use
121                    $('body').once('filtersVisibleOnLoad').each(function() {
122                        toggleFilters('#edit-filters');
123                    });
124                }
125
126                $('#edit-filters').once('addHandler').click(function(e) {
127                    e.preventDefault();
128                    toggleFilters(this);
129                });
130
131
132            }
133
134            var $this_week_exposed_form = $('#views-exposed-form-this-week-at-galliard-articles-block-1');
135
136            if ($this_week_exposed_form.length !== 0) {
137                $this_week_exposed_form.find(':input[name="offer_or_development"]').once('addHandler').change(function (e) {
138                    $this_week_exposed_form.find('.form-submit').click();
139                });
140            }
141
142            // News and opinion filter
143            var $news_and_op_form = $('#views-exposed-form-news-opinion-block-1');
144
145            if ($news_and_op_form.length !== 0) {
146                $news_and_op_form.find(':input[name="topic_filter"]').once('addHandler').change(function (e) {
147                    $news_and_op_form.find('.form-submit').click();
148                });
149            }
150
151            // Sorting properties
152            var $sorting_properties = $('#views-exposed-form-property-search-page-1');
153            if($sorting_properties.length === 0) {
154                $sorting_properties = $('#views-exposed-form-property-search-page-seo');
155            }
156
157            if ($sorting_properties.length !== 0) {
158                $sorting_properties.find('select[name="sort_by"]').once('addHandler').change(function (e) {
159                    $sorting_properties.find('.form-submit').click();
160                });
161            }
162
163            var $properties_table_form = $('#views-exposed-form-properties-list-table-default');
164            if ($properties_table_form.length !== 0) {
165                $properties_table_form.find('select.form-select').once('addHandler').change(function (e) {
166                    $properties_table_form.find('.form-submit').click();
167                });
168            }
169
170            $('.btn.btn-danger.register-interest-button').click(function () {
171
172                var thisButton = this;
173
174                $(document).on('shown.bs.modal', function(e) {
175
176                    var markup_id = $(thisButton).data("markupid");
177                    var dev_id = $(thisButton).data("devid");
178                    $('input[name="hidden_entity"]').val(markup_
178id);
179                    if (dev_id){
180                        $('input[name="hidden_development"]').val(dev_id);
181                    }
182                });
183
184                $('.ui-front').on('change', function(){
185                    var markup_id = $(thisButton).data("markupid");
186                    var dev_id = $(thisButton).data("devid");
187                    $('input[name="hidden_entity"]').val(markup_id);
188                    if (markup_id){
189                        $('input[name="hidden_development"]').val(markup_id);
190                    }
191                })
192
193            });
194
195
196
197
198            if (window.location.href.match(/map=1/) && typeof mapInitialView === 'undefined') {
199              mapInitialView = true;
200              addMapParameter();
201
202              $('#list-view').removeClass('btn-default active');
203              $('#map-view').addClass('btn-default active');
204            }
205        }
206    };
207})(window, document, Drupal, jQuery);
208*/

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.