PageSourceSearch

https://bul.co.ug/assets/javascript/scripts.js

js bul.co.ug collected 2026-10-08 11:11:33 UTC 9,341 bytes, 249 lines download raw bytes

1$(function () {
2    var isMobile = isMobileDevice();
3
4    $(window).on('resize',function(){
5        responsive_pagebanner();
6        nav_affix();
7    });
8
9    responsive_pagebanner();
10    nav_affix();
11
12    function responsive_pagebanner(){
13        var el = $(".page-banner-bg");
14
15        if (!(isMobileDevice())) {
16            var headerHeight = "-" + $('.navbar-laptop').outerHeight() + "px";
17            el.css({
18                'top': headerHeight,
19                'margin-bottom': headerHeight
20            });
21        }else{
22            el.css({
23                'top': 0,
24                'margin-bottom': 0
25            });
26        }
27    }
28
29    //Align row headers to the container
30    var leftSpaceContainer = parseInt($('.container').css('padding-left')) + parseInt($('.container').css('margin-left')) + parseInt($('.col-md-12').css('padding-left')) - 2;
31    if ($(window).width() > 1400) {
32        $('.aligned-container-margin').width(leftSpaceContainer);
33    }
34
35    // Initiating the Parallax affect for History Page
36    //new WOW().init();
37
38    //Align to Container Class
39    // containerLeftAttr = parseInt($('.container').css('padding-left')) + parseInt($('.container').css('margin-left'));
40    //$('.left-align-container').css('left', containerLeftAttr + 'px')
41    //Navbar Secondarymenu arrow toggle
42    $(".mobile-navbar .dropdown-header .glyphicon.glyphicon-chevron-down").click(function () {
43        $(this).toggleClass("open");
44    });
45    //Redirect to page link upon clicking icon
46    $('body').on('click', '.dropdown_icons', function () {
47        var headerMenu = $(this).parents('.main-links');
48        window.location.href = $(".headerLinks", headerMenu).attr('href');
49    });
50
51    //Check if image has a dark background
52    if ($("body").find(".bright-background").length > 0) {
53        var el = $("#brand-underneath");
54        if(el.length){
55            var darkImageLink = el.attr('src').replace('header-brand-underneath', 'header-brand-underneath_dark');
56            el.attr("src", darkImageLink);
57        }
58    }
59    //Toggle icons for accordion
60    //    function toggleIcon(e) {
61    //        $(e.target)
62    //            .prev('.panel-heading')
63    //            .find(".more-less")
64    //            .toggleClass('glyphicon-triangle-bottom glyphicon-triangle-top');
65    //    }
66    //    $('.panel-group').on('hidden.bs.collapse', toggleIcon);
67    //    $('.panel-group').on('shown.bs.collapse', toggleIcon);
68
69    //Add Active class to the open Accordion
70    $('.panel-collapse').on('show.bs.collapse', function () {
71        $(this).siblings('.panel-heading').addClass('active');
72    });
73
74    $('.panel-collapse').on('hide.bs.collapse', function () {
75        $(this).siblings('.panel-heading').removeClass('active');
76    });
77
78    // .video Play/Stop Button
79    if($('.video').length){
80        $('.video').each(function(){
81            attach_playpause_behaviour($(this));
82        });
83    }
84
85    if($('video').length){
86        var videos = $('video');
87        videos.each(function(){
88            var vid = $(this);
89
90            if(!vid.hasClass('video')){
91                vid.addClass('video');
92                vid.wrap('<div class="video-wrapper"></div>');
93                vid.after('<div class="playpause"></div>');
94                vid.before('<div class="video-poster"></div>');
95                vid.removeAttr('controls');
96                attach_playpause_behaviour(vid);
97            }
98        });
99    }
100
101    function attach_playpause_behaviour(video_el){
102
103        video_el.parent().on('click',function (e) {
104            e.preventDefault();
105            e.stopPropagation();
106
107            play_visuals($(this).children('.video'));
108            toggle_playpause($(this).children('.video'));
109        });
110
111        function toggle_playpause(vid){
112            if (vid.get(0).paused) {
113                vid.get(0).play();
114            } else {
115                vid.get(0).pause();
116            }
117        }
118
119        function play_visuals(vid){
120            var playpause = vid.siblings('.playpause');
121            var poster = vid.siblings('.video-poster');
122
123            if(!playpause.hasClass('deactived'))playpause.addClass('deactived');
124            vid.attr('controls','control');
125
126            if(poster.length)poster.hide();
127        }
128    }
129
130});
131
132//Apply Same Height Function for Tab Navigations
133/*$(document).ready(function () {
134    var maxHeight = -1;
135
136    $('.tab-navigation ul li a').each(function () {
137        maxHeight = maxHeight > $(this).height() ? maxHeight : $(this).height();
138    });
139    $('.tab-navigation ul li a').each(function () {
140        $(this).height(maxHeight);
141    });
142    $('.tab-navigation ul li.active a').height(maxHeight + 15);
143    $(".tab-navigation ul li a").on({
144        mouseenter: function () {
145            var hoveredSize = maxHeight + 35 + "px";
146            //            alert(hoveredSize);
147            $(this).animate({
148                height: hoveredSize
149            });
150        },
151        mouseleave: function () {
152            if (!$(this).parent().hasClass("active")) {
153                $(this).animate({
154                    height: maxHeight + 20
155                });
156            }
157        }
158    });
159});*/
160
161$(".card-quote").click(function () {
162
163    $(".tab-pane.active.in:visible").each(function (e, v) {
164        $(this).removeClass("active");
165        $(this).removeClass("in");
166    });
167
168
169    $("li.card-quote.active:visible").each(function (e, v) {
170        $(this).removeClass("active");
171    });
172});
173// back to top button
174$(document).ready(function () {
175    //Intialize all the Select Bootstrap's
176
177    $(window).scroll(function () {
178        if ($(this).scrollTop() > 50) {
179            $('#back-to-top').fadeIn();
180        } else {
181            $('#back-to-top').fadeOut();
182        }
183    });
184    // scroll body to 0px on click
185    // $('#back-to-top').click(function () {
186    //     $('#back-to-top').tooltip('hide');
187    //     $('body,html').animate({
188    //         scrollTop: 0
189    //     }, 800);
190    //     return false;
191    // });
192
193    //$('#back-to-top').tooltip('show');
194
195});
196
197
198//Navigation Bar
199
200$(".dropdownSection").on({
201    mouseenter: function () {
202        $($(this).find('img')).attr("src", $(this).find('img').attr('onHover'));
203        $($(this).find('.dropdown-header')).css("color", "#FAA434");
204    },
205    mouseleave: function () {
206        if (!$(this).hasClass("active")) {
207            $($(this).find('img')).attr("src", $(this).find('img').attr('mouseOut'));
208            $($(this).find('.dropdown-header')).css("color", "#2A8A8E");
209        }
210    }
211});
212
213if ($(".dropdownSection").hasClass("active")) {
214    $(".dropdownSection.active").trigger('mouseenter');
215}
216
217function nav_affix(){
218    if(!isMobileDevice()){
219        // $('.navbar-laptop').affix({
220        //     offset: {
221        //         top: $('.container-fluid').height()
222        //     }
223        // });
224    }
225}
226
227$(".searchIconHeader").on("click", function () {
228    var $this = $(this);
229    var input = $this.find('input');
230    if($this.hasClass('active')){
231        $this.removeClass("active");
232        input.val('').blur();
233        return;
234    }
235    $this.addClass("active");
236});
237
238
239// Detect Mobile Devices
240
241function isMobileDevice() {
242
243    var isMobile = false; //initiate as false
244    // device detection
245    if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.
245substr(0, 4))) isMobile = true
246    if(window.innerWidth < 1024) isMobile = true;
247    return isMobile;
248}
249

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.