PageSourceSearch

https://www.diaglobal.org/_JS/custom.js?bust=v8

js diaglobal.org collected 2026-09-24 08:36:33 UTC 13,479 bytes, 326 lines download raw bytes

1$(function () {
2    /*sticky header*/
3    window.onscroll = function () {
4        var header = document.getElementById("fix-header");
5        if (window.pageYOffset > header.offsetTop) {
6            header.classList.add("sticky");
7        } else {
8            header.classList.remove("sticky");
9        }
10    };
11	
12	/* Interest areas filter radio */
13	$('.topic-rail-lbl').click(function() {
14		 var item = $(this);
15		 var checked = item.find("input");
16		 if (item.hasClass('interest-area-tags-navigation-tag-active')) {
17            checked.prop( "checked", true );
18        } else {
19            checked.prop( "checked", true );
20        }		
21    })
22
23    $('.nav-button--search').click(function () {
24        var oHeaderSearch = $(this).parent().parent();
25        performSearch(oHeaderSearch);
26    })
27
28    $("#header-search-input").keypress(function (event) {
29        if (event.which == 13) {
30            event.preventDefault();
31            var oHeaderSearch = $(this).parent().parent();
32            performSearch(oHeaderSearch);
33        }
34    });
35
36    function performSearch(oHeaderSearch) {
37        //          var sSearchUrl = oHeaderSearch.data('search-url');
38        var sSearchUrl = '/search20';
39        var oSearchQuery = oHeaderSearch.find(".header-search__input");
40        var sQuery = oSearchQuery.val().trim();
41        if (sQuery.length > 0) {
42            sSearchUrl = sSearchUrl + "?query=" + encodeURIComponent(sQuery);
43            console.log(sSearchUrl);
44            window.location.href = sSearchUrl;
45        }
46    }
47
48
49    $('.search--button').click(function () {
50        var oHeaderSearch = $(this).parent();
51        performNewSearch(oHeaderSearch);
52    })
53
54    $("#input-header-search").keypress(function (event) {
55        if (event.which == 13) {
56            event.preventDefault();
57            var oHeaderSearch = $(this).parent();
58            performNewSearch(oHeaderSearch);
59        }
60    });
61
62    function performNewSearch(formSearch) {
63        var sSearchUrl = '/search20';
64        var oSearchQuery = formSearch.find("#input-header-search");
65        var sQuery = oSearchQuery.val().trim();
66        if (sQuery.length > 0) {
67            sSearchUrl = sSearchUrl + "?query=" + encodeURIComponent(sQuery);
68            console.log(sSearchUrl);
69            window.location.href = sSearchUrl;
70        }
71    }
72	
73	// $('.header-nav__item').on('click', function (e) {
74	// 	var menuItem = $( e.currentTarget );
75	// 	if (menuItem.attr( 'aria-expanded') === 'true') {
76	// 		$(this).attr( 'aria-expanded', 'false');
77	// 		$(".header__overlay").removeClass("header__overlay--show");
78	// 	} else {
79	// 		$(this).attr( 'aria-expanded', 'true');
80	// 		$(".header__overlay").addClass("header__overlay--show");
81	// 	}
82	// });
83	
84	// $('.header__menu').on('click', function (e) {
85		
86	// 	var mobItem = $(".header-nav");
87	// 	if (mobItem.attr( 'aria-expanded') === 'false') {
88	// 		$(mobItem).attr( 'aria-expanded', 'true');
89	// 		$(".header__overlay").removeAttr("hidden");
90	// 		console.log("2");
91	// 	} else {
92	// 		$(mobItem).attr( 'aria-expanded', 'false');
93	// 		//$(".header__overlay").attr("hidden", "");
94	// 		console.log("3");
95	// 	}
96	// 	e.preventDefault();
97	// });
98});
99
100/* \vuejs\src\components */
101
102// Nav
103(function () {
104    function initThisComponent() {
105        var header = document.querySelector('.header');
106
107        if (!header) {
108            header = document.querySelector(".header-main")
109        }
110
111        if (header) {
112            initHeader();
113        }
114
115        function initHeader() {
116
117            let allHeaderL1 = header.querySelectorAll(".header-nav__item")
118            var nav = header.querySelector('.header-nav')
119
120            if (header.classList.contains("header-main")) {
121                nav = header
122            }
123            let navMenu = header.querySelector('.header__menu')
124            let overlay = header.querySelector('.header__overlay')
125            let loginMenu = header.querySelector('.utility__link__list-wrapper'); //This script is for menu dropdown and add active class to parent div
126            let menuParent = header.querySelector('.utility_link_ddd'); //This script is for menu dropdown and add active class to parent div
127            let userDropdown = header.querySelector('.utility__link__list-wrapper > div'); // User dropdown hide when clicked anywhere in the page
128
129            for (let i = 0; i < allHeaderL1.length; i++) {
130
131                let headerL1 = allHeaderL1[i].querySelector('.header-nav__l1')
132
133                if (headerL1) {
134                    headerL1.addEventListener('click', function () {
135                        for (let j = 0; j < allHeaderL1.length; j++) {
136                            let headerL2Container = allHeaderL1[j]
137                            if (j == i) {
138                                if (headerL2Container.getAttribute('aria-expanded') !== "true") {
139                                    headerL2Container.setAttribute('aria-expanded', true)
140                                    if (overlay) {
141                                        overlay.classList.add('header__overlay--show')
142                                    }
143                                }
144                                else {
145                                    if (overlay) {
146                                        overlay.classList.remove('header__overlay--show')
147                                    }
148                                    headerL2Container.setAttribute('aria-expanded', false)
149                                }
150                            }
151                            else {
152                                headerL2Container.setAttribute('aria-expanded', false)
153                            }
154                        }
155                    }, false)
156                }
157            }
158            if (navMenu) {
159                navMenu.addEventListener('click', function () {
160                    if (nav.getAttribute('aria-expanded') !== "true") {
161                        nav.setAttribute('aria-expanded', true)
162                        if (overlay) {
163                            overlay.removeAttribute('hidden')
164                        }
165                        document.body.classList.add("body-freeze")
166                    }
167
168                    else {
169                        nav.setAttribute('aria-expanded', false)
170                        if (overlay) {
171                            overlay.setAttribute('hidden', '')
172                        }
173                        document.body.classList.remove("body-freeze")
174                    }
175
176                })
177            }
178
179
180            if (overlay) {
181                overlay.addEventListener('click', function () {
182                    for (let j = 0; j < allHeaderL1.length; j++) {
183                        allHeaderL1[j].setAttribute('aria-expanded', false);
184                    }
185                    nav.setAttribute('aria-expanded', false)
186                    overlay.classList.remove('header__overlay--show')
187                });
188            }
189
190
191            if (loginMenu) {
192                loginMenu.addEventListener('click', function () {
193                    if (loginMenu.getAttribute('aria-expanded') !== "true") {
194                        loginMenu.setAttribute('aria-expanded', true);
195                        menuParent.classList.add('active')
196                    }
197
198                    else {
199                        loginMenu.setAttribute('aria-expanded', false)
200                        menuParent.classList.remove('active')
201                    }
202                });
203            }
204
205            var userLogged = document.getElementsByClassName('utility_link_ddd');
206            if (userLogged.length > 0) {
207                document.addEventListener("click", function (event) {
208                    if (event.target == userDropdown) {
209                        loginMenu.setAttribute('aria-expanded', true);
210                        menuParent.classList.add('active');
211                    }
212                    else {
213                        loginMenu.setAttribute('aria-expanded', false);
214                        menuParent.classList.remove('active');
215                    }
216                })
217            }
218        }
219    }
220    document.addEventListener("DOMContentLoaded", initThisComponent, false);
221})();
222
223// Testimonial
224(function () {
225    function initThisComponent() {
226        var testimonial = document.querySelector('.testimonial');
227
228        if (testimonial) {
229            initTestimonial();
230        }
231
232        function initTestimonial() {
233            let testimonialProfileList = testimonial.querySelectorAll('.testimonial-profile');
234
235            let testimonialText = testimonial.querySelector('.testimonial-spotlight__text');
236            let testimonialTitle = testimonial.querySelector('.testimonial-spotlight__title');
237            let testimonialName = testimonial.querySelector('.testimonial-spotlight__name');
238            let testimonialButton = testimonial.querySelector('.testimonial-spotlight__button');
239
240            let testimonialSpotlight = testimonial.querySelector('.testimonial-spotlight');
241            let testimonialIcon = testimonialSpotlight.querySelector('.testimonial-icon')
242            let testimonialIconText = testimonialSpotlight.querySelector('.testimonial-icon-text')
243            let testimonialImg = testimonialSpotlight.querySelector('.testimonial-spotlight__img')
244
245
246            if (testimonialProfileList) {
247                for (let i = 0; i < testimonialProfileList.length; i++) {
248                    let profile = testimonialProfileList[i]
249                    profile.addEventListener('click', function () {
250                        testimonialSpotlight.classList.add('testimonial-spotlight--hidden')
251                        for (let j = 0; j < testimonialProfileList.length; j++) {
252                            testimonialProfileList[j].classList.remove('testimonial-profile--active')
253
254                            if (j == i) {
255                                testimonialProfileList[j].classList.add('testimonial-profile--active')
256                            }
257                        }
258                        setTimeout(function () {                // delay and 
259                            let profileText = profile.querySelector('.testimonial-profile__quote')
260                            let profileName = profile.querySelector('.testimonial-profile__name')
261                            let profileTitle = profile.querySelector('.testimonial-profile__title')
262                            let profileButton = profile.querySelector('.testimonial-profile__button')
263                            let profileIcon = profile.querySelector('.testimonial-icon')
264                            let profileIconText = profile.querySelector('.testimonial-icon-text')
265                            let profileImg = profile.querySelector('.testimonial-profile__img')
266
267                            testimonialImg.src = profileImg.src
268                            testimonialText.textContent = profileText.textContent
269                            testimonialName.textContent = profileName.textContent
270                            testimonialTitle.textContent = profileTitle.textContent
271                            if (profileButton && testimonialButton) {
272                                testimonialButton.textContent = profileButton.textContent
273                                testimonialButton.href = profileButton.href
274                            }
275                            testimonialIcon.textContent = profileIcon.textContent
276                            if (profileIconText && testimonialIconText) {
277                                testimonialIconText.textContent = profileIconText.textContent
278                            }
279                            testimonialSpotlight.classList.remove('testimonial-spotlight--hidden')
280                        }, 300);
281                    })
282                }
283            }
284        }
285    }
286    document.addEventListener("DOMContentLoaded", initThisComponent, false);
287})();
288
289// Footer
290(function () {
291    function initThisComponent() {
292        var footer = document.querySelector('.footer-redesign');
293
294        if (footer) {
295            initFooter();
296        }
297
298        function initFooter() {
299            var footerCols = footer.querySelectorAll(".footer__col")
300
301
302            footerCols.forEach(footerCol => {
303                footerCol.setAttribute('aria-expanded', false)
304
305                footerCol.querySelector(".footer__toggle").addEventListener("click", function () {
306                    if (footerCol.getAttribute('aria-expanded') !== "true") {
307                        footerCol.setAttribute('aria-expanded', true)
308                    }
309                    else {
310                        footerCol.setAttribute('aria-expanded', false)
311                    }
312                })
313            })
314        }
315    }
316    document.addEventListener("DOMContentLoaded", initThisComponent, false);
317})();
318
319
320function doHeaderSearch() {
321    var oHeaderSearch = $(this).closest('.header-search');
322    var sSearchUrl = oHeaderSearch.data('search-url');
323    var oSearchQuery = oPrices.find("header-search__input");
324    sSearchUrl = sSearchUrl + "?q=" + oSearchQuery.val();
325    alert(sSearchUrl);
326}

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.