1;(function ($, window, document, undefined) { 2 'use strict'; 3 4 /** 5 * write your codes here 6 */ 7 8 var w = window, 9 $w = $(window), 10 $body = $('body'); 11 12 /** * mobile nav functionality 13 */ 14 var $mobileNav = $('.mobile-nav'), 15 $closeNavBtn = $('.close-nav-icon'), 16 $openNavBtn = $('.nav-icon'); 17 18 $openNavBtn.on("click", function (e) { 19 e.preventDefault(); 20 $mobileNav.slideDown(); 21 $("body").addClass("menu-opened"); 22 23 setTimeout(function() { 24 $('#hiddenDiv').addClass('show'); 25 }, 600); // Delay for 1 second 26 }); 27 28 $closeNavBtn.on("click", function (e) { 29 e.preventDefault(); 30 $mobileNav.slideUp(); 31 $("body").removeClass("menu-opened"); 32 setTimeout(function() { 33 $('#hiddenDiv').removeClass('show'); 34 }, 600); // Delay for 1 second 35 }); 36 37 $mobileNav.on('click', '.has-submenu > a', function (e) { 38 e.preventDefault(); 39 $(this).closest('li.has-submenu').toggleClass('active'); 40 $(this).siblings('ul').stop().slideToggle(500); 41 }); 42 43 /** 44 * keep footer bottom of page 45 */ 46 47 function footerAlign() { 48 $('.footer').css('height', 'auto'); 49 var footerHeight = $('.footer').outerHeight(); 50 $('body').css('padding-bottom', footerHeight); 51 $('.footer').css('height', footerHeight); 52 } 53 54 55 $(document).ready(function(){ 56 footerAlign(); 57 }); 58 59 $( window ).resize(function() { 60 footerAlign(); 61 }); 62 63 64 /** 65 * sticky footer 66 * reveal functionality 67 */ 68 // var $footer = $('.footer'), 69 // footerStickyClass = 'sticky', 70 // footerHeight, 71 // windowHeight; 72 73 // $w.on('load resize', function () { 74 // footerHeight = $footer.height(); 75 // windowHeight = $w.height(); 76 77 // if (footerHeight > windowHeight) { 78 // $body.css('padding-bottom', 0); 79 // $footer.removeClass(footerStickyClass); 80 // } else { 81 // $body.css('padding-bottom', footerHeight); 82 // $footer.addClass(footerStickyClass); 83 // } 84 // }); 85 86 /** 87 * search overlay component code 88 */ 89 $('[data-vw-action=open-search-popup]').on('click', function (e) { 90 e.preventDefault(); 91 $('.vw-search-popup').first().fadeIn(600, function () { 92 $(this).find('input[type=search]').trigger('focus'); 93 }); 94 }); 95 96 $('[data-vw-action=close-search-popup]').on('click', function (e) { 97 e.preventDefault(); 98 $('.vw-search-popup').first().fadeOut(600); 99 }); 100 101 var $quicklinks = $('.mob-quick-links'), 102 $quicklink = null, 103 $quicklinkUl = null, 104 $quicklinkLi = null, 105 $quickDropdown = null; 106 107$quicklinks.on('click', '.hasquickDropdown > a', function (e) { 108 e.preventDefault(); 109 $quicklink = $(this); 110 $quicklinkLi = $quicklink.closest('li'); 111 $quicklinkUl = $quicklinkLi.closest('ul'); 112 $quickDropdown = $quicklink.siblings('ul.quickDropdown'); 113 114 $quicklinkLi.toggleClass('active'); 115 116 $quickDropdown.css({ 117 'max-width' : 'none', 118 width : $quicklinkUl.innerWidth(), 119 left : - $quicklinkLi.offset().left + $quicklinkUl.offset().left, 120 }).toggle(0); 121 122 if ($quicklinkLi.hasClass('active')) { 123 $quicklinkLi 124 .siblings('.hasquickDropdown.active') 125 .removeClass('active') 126 .removeAttr('style') 127 .find('.quickDropdown') 128 .hide(); 129 130 $quicklinkLi.css('height', $quicklinkLi.height() + $quickDropdown.height() + 5); 131 } else { 132 $quicklinkLi.removeAttr('style'); 133 } 134 }); 135 136 137 $(document).ready(function(){ 138 139 $("ul.link-list li a[href='']").removeAttr('href'); 140 141 $(".footer").removeClass("hidden"); 142 143 if($(window).width() < 991 ) { 144 145 $(".mobile-calendar-icon").click(function(event){ 146 event.stopPropagation(); 147 $(".calender-wrap").toggleClass("expanded"); 148 if ($(".calender-wrap").hasClass('expanded')) { 149 $(".calender-wrap").find('h3').fadeIn(); 150 $(".calender-inn").fadeIn(); 151 } else { 152 $(".calender-inn").fadeOut(); 153 $(".calender-wrap").find('h3').fadeOut(); 154 } 155 156 $("body").click(function(event){ 157 if (!$(event.target).parents().andSelf().is('.calender-wrap')) 158 { 159 160 $(".calender-inn").fadeOut(); 161 $(".calender-wrap").find('h3').fadeOut(); 162 $(".calender-wrap").removeClass("expanded"); 163 164 $("body").unbind("click"); 165 } 166 }); 167 168 }); 169 } 170 171 if($(window).width() > '991' ){ 172 $(".calender-inn").hover(function(e){
173 $('.calender-wrap').addClass('expanded'); 174 }, function(e){ 175 $('.calender-wrap').removeClass('expanded'); 176 }); 177 } 178 else{ 179 $(".calendarclose").on('click', function() { 180 $(".calender-inn").fadeOut(); 181 $(".calender-wrap").find('h3').fadeOut(); 182 }); 183 $(".calender-inn").click(function(){ 184 $(".calender-wrap").toggleClass("expanded"); 185 }); 186 $(".closeCalandar").on('click', function(event) { 187 event.preventDefault(); 188 $(".calender-wrap").toggleClass("expanded"); 189 }); 190 } 191 }); 192 193 // Modal System 194 $('body').on('click', 'a', function(e) { 195 196 if (window.vahara && window.vahara.editMode) { 197 return; 198 } 199 200 var link = $(e.currentTarget).attr('href'); 201 var modalHashPosition = link.indexOf('#popup'); 202 203 if (modalHashPosition > 0) { 204 e.preventDefault(); 205 console.log('modal link'); 206 207 var popupContainer = $('.popup-container'); 208 if (!popupContainer.length) { 209 $('body').append('<div class="popup-container"></div>'); 210 popupContainer = $('.popup-container'); 211 console.log('adding popup container'); 212 } 213 214 // Sample page to test this with is - https://www.ccssd.org/test 215 $.ajax('_load_modal?link=' + link.substring(0, modalHashPosition), { 216 success:function(data) { 217 popupContainer.html(data); 218 // code to show the modal here 219 } 220 }); 221 } 222 }); 223 224 $(document).on('click', '.closeButton', function(event) { 225 event.preventDefault(); 226 if($(this).data('dismiss') == 'modal'){ 227 $(this).closest('.vw-popup').fadeOut(300,function(){ 228 $(this).removeClass('show'); 229 $('body').removeClass('popupOpened'); 230 $(this).children('.vw-popup-wrap').removeClass('smallScreen'); 231 }) 232 } 233 }); 234 235 236/* CODE TO OPEN LAST MENUS LEFT SIDE */ 237 238 239 $(".navigation li").on('mouseenter mouseleave', function (e) { 240 if ($('ul', this).length) { 241 var elm = $('ul:first', this); 242 var off = elm.offset(); 243 var l = off.left; 244 var w = elm.width(); 245 var docH = $(".top-header-strip").height(); 246 var docW = $(".header").width(); 247 var isEntirelyVisible = (l + w <= docW); 248 if (!isEntirelyVisible) { 249 console.log($(this).text()); 250 //$(this).closest('.navigation > li').css({"color": "red", "border": "2px solid red"}); 251 $(this).closest('.navigation > li').addClass('outterEdge'); 252 } else { 253 //$(this).removeClass('edge'); 254 } 255 } 256 }); 257 //$('ul.navigation > li:last-child').prev('li').andSelf().addClass("outterEdge"); 258 $(window).on('load resize', function() { 259 addClassToLi(); 260 }); 261 function addClassToLi(){ 262 console.log($(window).width()); 263 if($(window).width() < '1920'){ 264 console.log(3); 265 $('ul.navigation > li').slice(-2).addClass("outterEdge"); 266 } 267 } 268 269 270 /* CODE TO OPEN LAST MENUS LEFT SIDE */ 271 272 // To open External links in new tab or window == CODE STARTS HERE 273 openAllExternalLinksInNewTab(); 274 function openAllExternalLinksInNewTab(){ 275 let siteHost = location.host; 276 let cleaned_host; 277 if(siteHost.indexOf('www.') === 0){ 278 cleaned_host = siteHost.replace('www.',''); 279 }else{ 280 cleaned_host = siteHost; 281 } 282 $('a').on('click', function(e){ 283 if(this.href != '') { 284 if((this.href.indexOf('http') === 0) || (this.href.indexOf('www.') === 0)){ 285 if(this.href.indexOf(cleaned_host) == -1 && this.href.indexOf('vahara.io') == -1) { 286 window.open(this.href, "target=_blank"); 287 return false; 288 } 289 } 290 } 291 }); 292 } 293 294 $('.vh-js-login-action a').on('click', function(e){ 295 e.preventDefault(); 296 window.open(this.href, "_self"); 297 return false; 298 }); 299 // To open External links in new tab or window == CODE ENDS HERE 300 $('.header-toggle-button a').click(function(){ 301 $('header.header').toggle(); 302 }); 303 304})(jQuery, window, document);
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.