PageSourceSearch

https://trialinternational.org/wp-content/themes/tri/assets/js/tri-header.js?ver=20160421

js trialinternational.org collected 2026-10-02 03:56:22 UTC 2,988 bytes, 96 lines download raw bytes

1'use strict';
2
3jQuery(document).ready(function($) {
4    var $window = $(window);
5
6    $window.load(function() {
7        var snapAt = 80;
8        var $logo = $('.logo');
9
10        $window.scroll(function() {
11            var yOffset = $window.scrollY || $window.pageYOffset || document.documentElement.scrollTop || window.pageYOffset;
12
13            if ( yOffset > snapAt )
14                $logo.addClass('shrink');
15            else
16                $logo.removeClass('shrink');
17
18        });
19    });
20
21    var $searchIcon = $('.search-icon');
22    var $switcher = $('.utils .language-switcher');
23    var $socials = $('.utils .social-links');
24    var $form = $('.header-search-form');
25
26    $searchIcon.click(function(e) {
27        e.preventDefault();
28        
29        if ( ! $form.hasClass('fadeIn') ) {
30            $form.addClass('fadeIn');
31            $form.removeClass('fadeOut');
32            $form.find('input').focus();
33            $switcher.hide();
34            $socials.hide();
35            $searchIcon.hide();
36        }
37    });
38
39    $form.find('input').blur(function() {
40        if ( $form.hasClass('fadeIn') ) {
41            $form.addClass('fadeOut');
42            $form.removeClass('fadeIn');
43            $switcher.show();
44            $socials.show();
45            $searchIcon.show();
46        }
47    });
48    
49    var $mobileMenuIcon = $('.mobile-menu-icon');
50    var $mobileMenuClose = $('.mobile-menu-close');
51    var $navigation = $('.navigation');
52    var $utils = $('.utils');
53
54    var prependUtils = function() {
55        var exists = $navigation.find('nav .utils-copy').length;
56        if ( ! exists ) {
57            var utilsCopy = $utils.clone().removeClass().addClass('utils utils-copy');
58            $navigation.find('nav').prepend(utilsCopy);
59        }
60    };
61
62    $mobileMenuIcon.click(function(event) {
63        event.preventDefault();
64        prependUtils();
65        $navigation.addClass('zoomIn').removeClass('zoomOut hidden-md-down');
66        $mobileMenuIcon.addClass('zoomOut').removeClass('zoomIn');
67        $mobileMenuClose.addClass('zoomIn').removeClass('zoomOut hidden');
68
69        setTimeout(function() {
70            // $utils.removeClass('hidden-md-down');
71        }, 600);
72    });
73
74    $mobileMenuClose.click(function(event) {
75        event.preventDefault();
76        $navigation.addClass('zoomOut hidden-md-down').removeClass('zoomIn');
77        $navigation.find('.utils-copy').remove();
78        // $utils.addClass('hidden-md-down');
79        $mobileMenuClose.addClass('zoomOut hidden').removeClass('zoomIn');
80        $mobileMenuIcon.addClass('zoomIn').removeClass('zoomOut');
81    });
82    
83    $window.resize(function() {
84        var windowWidth = $window.width();
85
86        if ( windowWidth < 992 ) {
87            prependUtils();
88            //$navigation.removeClass('zoomOut zoomIn hidden');
89        }
90
91        if ( windowWidth > 991 ) {
92            $navigation.removeClass('zoomOut zoomIn hidden');
93            $navigation.find('.utils-copy').remove();
94        }
95    });
96});

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.