PageSourceSearch

https://www.dwellcc.org/Themes/Dwell/Assets/Scripts/theme.js?v=638506863169933628

js dwellcc.org collected 2026-10-01 15:41:46 UTC 10,970 bytes, 281 lines download raw bytes

1var postbackCount = 0;
2
3$(window).bind('pageshow', function (e) {if ( e.originalEvent.persisted ){$('#updateProgress').hide();}});
4
5function navInteractions() {
6    // if .site-header exists
7    if ($('.site-header').length) {
8        // get height of .site-header
9        var siteHeaderHeight = $('.site-header').outerHeight();
10        // set site-header height as css variable on body
11        document.documentElement.style.setProperty('--site-header-height', siteHeaderHeight + 'px');
12    }
13
14    if (window.innerWidth > 1024) {
15        $('.navbar-nav .dropdown').each(function () {
16            if ($(this).find('a[data-bs-toggle]').length > 0) {
17                // this on mouseover
18                let el_link = $(this).find('a[data-bs-toggle]');
19                el_link.off('.nav');
20                $(this).off('.nav').on('mouseover.nav', function (e) {
21                    el_link.addClass('active').next().addClass('show');
22                });
23                // this on mouseleave
24                $(this).on('mouseleave.nav', function (e) {
25                    el_link.removeClass('active').next().removeClass('show');
26                });
27            }
28        });
29    } else {
30        $('.navbar-nav .dropdown').each(function () {
31            $(this).off('.nav').find('a[data-bs-toggle]').off('.nav').on('click.nav', function (e) {
32                e.preventDefault();
33                // if next element is dropdown menu
34                if ($(this).next().hasClass('dropdown-menu')) {
35                    $(this).next().show().closest('.dropdown').toggleClass('dropdown-open');
36                }
37            });
38        });
39    }
40}
41
42
43// DOMContentLoaded end
44document.addEventListener('DOMContentLoaded', function () {
45    Sys.Application.add_load(function () {
46        // increment postback
47        postbackCount++;
48
49        navInteractions();
50        $(window).on('resize', function () {
51            navInteractions();
52        });
53
54
55        $('.js-mobile-menu-back').on('click', function (e) {
56            e.preventDefault();
57            // get parent dropdown-open and remove
58            $(this).closest('.dropdown-open').removeClass('dropdown-open');
59        });
60
61        $('.js-launch-modal').click(function (e) {
62            e.preventDefault();
63            var url = $(this).attr('href');
64            var modalTitle = $(this).data('modal-title');
65            var modalConfirm = $(this).data('modal-close-confirmation');
66            var closeMessage = $(this).data('modal-close-message');
67            doDynamicModal(url, modalConfirm, modalTitle, closeMessage);
68        });
69
70        // if js-filter-items
71        if ($('.js-filter-items').length) {
72            var filterItems = [];
73
74            $('.js-filter-items-search').on('keyup', function () {
75                if ($('.js-filter-items > .panel-group').length > 0) {
76                    filterItems = $('.js-filter-items .panel-group > .panel');
77                } else {
78                    filterItems = $('.js-filter-item');
79                }
80                // get value of js-filter-items-search
81                var searchValue = $(this).val().toLowerCase();
82                // loop through .js-filter-items
83                filterItems.each(function () {
84                    // get value of .js-filter-items
85                    var filterValue = $(this).text().toLowerCase();
86                    // if filterValue does not contain searchValue
87                    if (filterValue.indexOf(searchValue) > -1) {
88                        $(this).show();
89                    } else {
90                        $(this).hide();
91                    }
92                });
93                // if all .js-filter-items are hidden
94                if ($('.js-filter-item:visible').length == 0) {
95                    // show .js-filter-items-empty
96                    $('.js-filter-items-empty').show();
97                } else {
98                    // hide .js-filter-items-empty
99                    $('.js-filter-items-empty').hide();
100                }
101
102            });
103        }
104
105        // if .group-finder 
106        if ($('.group-finder,.connection-opportunity-search').length) {
107            $('.group-finder,.connection-opportunity-search').find('.control-label').on('click', function () {
108                $(this).parent('.form-group').toggleClass('open');
109                // select sibling .control-wrapper
110                $(this).siblings('.control-wrapper').slideToggle();
111            });
112        }
113
114        $('.js-collapse-main-nav').on('click', function (e) {
115            e.preventDefault();
116            // scroll to top
117            $('html, body').animate({ scrollTop: 0 }, 250);
118            $(this).toggleClass('collapsed');
119            $('body').toggleClass('modal-open');
120            // if main-navcol is not in
121            $('#main-navcol').addClass('overflow-hidden').toggleClass('in');
122            if (!$('#main-navcol').hasClass('in')) {
123                $('#main-navcol').find('.dropdown-open').removeClass('dropdown-open');
124            }
125
126            setTimeout(function() {
127                $('#main-navcol').removeClass('overflow-hidden');
128            }, 250);
129        });
130
131        
132        $('.js-pagesearch-btn, .search-close').on('click', function (e) {
133            $('.search-wrapper').toggleClass('is-open');
134        });
135
136
137        if (postbackCount > 1) {
138            document.body.classList.add("has-postback");
139        }
140
141        if (self !== top) {
142            window.parent.resizeDynamicModal();
143
144            // create an Observer instance
145            const resizeObserver = new ResizeObserver(entries => {
146                window.parent.resizeDynamicModal()
147            });
148
149            // start observing a DOM node
150            resizeObserver.observe(document.body)
151
152            if (document.querySelectorAll('.js-workflow-entry-message-notification-box.alert-success,.alert.alert-success>.js-notification-text,.js-allow-modal-close').length > 0) {
153                window.parent.allowCloseModal();
154            }
155
156            var jsCloseModal = document.querySelectorAll('.js-close-modal');
157            if (jsCloseModal.length > 0) {
158                for (var i = 0; i < jsCloseModal.length; i++) {
159                    jsCloseModal[i].addEventListener('click', function (e) {
160                        e.preventDefault();
161                        window.parent.closeModal();
162                    }, false);
163                }
164            }
165        }
166        
167    // Autofocus on search bar when search button is clicked
168    $('.js-pagesearch-btn').on('click',function(){
169        $('.gsc-input-box input').val(''); 
170        $('.gsc-input-box input').focus(); 
171    });
172    
173    });
174    
175}, false);
176
177window.resizeDynamicModal = function (e) {
178    resizeDynamicIframe();
179}
180
181window.closeModal = function () {
182    $('#dynamicModal').modal('hide');
183}
184
185window.allowCloseModal = function () {
186    $('.js-close-confirmation').off('.dynamicModal').removeClass('js-close-confirmation').attr('data-dismiss', 'modal');
187}
188
189function doDynamicModal(url, closeConfirmation, modalTitle, closeConfirmationMessage) {
190    if (url) {
191        // Append querystring to url if it doesn't already exist
192        if (url.indexOf('?') === -1) {
193            url += '?modal=true';
194        } else {
195            url += '&modal=true';
196        }
197        var html = '<div class="modal modal-lg fade" id="dynamicModal" tabindex="-1" role="dialog">';
198        html += '<div class="modal-dialog" role="document">';
199        html += '<div class="modal-content">';
200        html += '<div class="absolute-close">';
201        if (closeConfirmation && closeConfirmation === true) {
202            html += '<button type="button" class="close js-close-confirmation" aria-label="Close">✕</button>';
203        } else {
204            html += '<button type="button" class="close" data-dismiss="modal" aria-label="Close">✕</button>';
205        }
206        html += '</div>';
207        if (modalTitle && modalTitle !== '') {
208            html += '<div class="modal-header border-0"><h4 class="modal-title">' + modalTitle + '</h4></div>';
209        }
210        html += '<div class="modal-body p-0">';
211        html += '<div id="modalLoading" class="w-100 bg-white d-none" style="height:2000px;"></div>';
212        html += '<iframe loading="eager" src="' + url + '" frameborder="0" id="dynamicModalIframe" class="dwell-modal-iframe w-100" style="display:block;opacity: 0;height:200px;" scrolling="yes"></iframe>';
213        html += '</div>';
214        html += '</div>';
215        html += '</div>';
216        html += '</div>';
217        $('body').append(html);
218        if (closeConfirmation && closeConfirmation === true) {
219            $('#dynamicModal').modal({ backdrop: 'static', keyboard: false }).modal('show');
220        } else {
221            $('#dynamicModal').modal().modal('show');
222        }
223        $('#dynamicModalIframe').on('load', function (e) {
224            resizeDynamicIframe(this, $('#dynamicModal'));
225            $(this).delay(100).animate({ opacity: "1" }, 600);
226        });
227
228        $('#dynamicModal').on('destroyed.modalmanager', function (e) {
229            $('#dynamicModal').remove();
230        });
231
232        if (closeConfirmation && closeConfirmation === true) {
233            if (closeConfirmationMessage && closeConfirmationMessage !== '') {
234                var confirmationMessage = closeConfirmationMessage;
235            } else {
236                var confirmationMessage = "Are you sure you want to exit the form? Your data will be lost if you haven't submitted it.";
237            }
238
239            $('.js-close-confirmation').on('click.dynamicModal', function () { //Close Button on Form Modal to trigger Warning Modal
240                bootbox.confirm({
241                    message: confirmationMessage,
242                    className: "modal-confirmation",
243                    buttons: {
244                        confirm: {
245                            label: 'Yes, Exit',
246                            className: 'btn-primary'
247                        },
248                        cancel: {
249                            label: 'No, Stay',
250                            className: 'btn-gray'
251                        }
252                    },
253                    callback: function (result) {
254                        if (result === true) {
255                            $('#dynamicModal').modal('hide');
256                        }
257                    }
258                });
259            });
260        }
261    }
262}
263
264function resizeDynamicIframe(el, modal) {
265    if (!el) {
266        el = document.getElementById('dynamicModalIframe');
267    }
268    
269    el.style.height = el.contentWindow.document.documentElement.offsetHeight + 'px';
270
271    var modalOverflow = $(window).height() - 10 < $('#dynamicModal').height();
272    if (modalOverflow) {
273        $('#dynamicModal')
274            .css('margin-top', 0)
275            .addClass('modal-overflow');
276    } else {
277        $('#dynamicModal')
278            .css('margin-top', 0 - $('#dynamicModal').height() / 2)
279            .removeClass('modal-overflow');
280    }
281}

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.