1var selectedStartLocation; 2var selectedStartCoords; 3var autoLocationData = []; 4var selectedEndLocation; 5var selectedEndCoords; 6 7$(document).ready(function() { 8 9 $('#startLocation').val(''); 10 $('#endLocation').val(''); 11 12 $('div#block-mainbottomlinks').removeAttr('id'); 13 14 //supplier portal button tooltip 15 $("body.page-node-1933 .advgb-tab-_a5559c-78.advgb-tab-body .wp-block-button .wp-block-button__link:contains(Supplier Portal)").tooltipster({ 16 content: $('<div>Click here for registration, awards and solicitations</div>') 17 }); 18 //open bids button tooltip 19 $("body.page-node-1933 .advgb-tab-_a5559c-78.advgb-tab-body .wp-block-button .wp-block-button__link:contains(Open Bids)").tooltipster({ 20 content: $('<div>Click here for all active public solicitations</div>') 21 }); 22}); 23 24 25$(window).on('load', function () { 26 $('#edit-local').multiselect(); 27 $('#edit-transbay').multiselect(); 28 $('#edit-schools').multiselect(); 29 $('#edit-all-nighter').multiselect(); 30 31 $('#navbarResponsive').addClass('shownav'); 32 33 //if no image add padding to new details 34 $('.news_row').each(function (index, element) { 35 var $this = $(this); 36 if ($this.find('img').length < 1) { 37 $this.addClass('noImg'); 38 } 39 }); 40 41 // auto open tabs in /fares-passes-transfers page 42 var hash = window.location.hash, 43 pageURL = window.location.href, 44 lastURLSegment = pageURL.substr(pageURL.lastIndexOf('/') + 1); 45 var result = pageURL.split('/'); 46 var secondlastURLSegment = result[result.length - 2]; 47 48 var websiteSection = lastURLSegment.split('#'); 49 console.log(websiteSection[0], secondlastURLSegment, window.location.href.indexOf("image-library")) 50 51 if (window.location.href.indexOf("image-library") <= 0) { 52 53 if (hash) { //console.log('foo') 54 $('a[href="' + hash + '"]').trigger('click'); 55 setTimeout(function () { 56 if ($('.wp-block-advgb-accordion-item.advgb-accordion-item:last-child').length > 0) { 57 $('.wp-block-advgb-accordion-item.advgb-accordion-item:last-child').addClass('expanded') 58 } 59 $('body, html').animate({ 60 scrollTop: $('a[href="' + hash + '"]').offset().top - 250 61 }, 300) 62 }, 100); 63 } else if (lastURLSegment == 'fares-passes-transfers') { //console.log('bar') 64 $('a[href="#advgb-tabs-tab1"]').trigger('click'); 65 setTimeout(function () { 66 $('.wp-block-advgb-accordion-item.advgb-accordion-item:last-child').addClass('expanded') 67 if ($('#advgb-tabs-tab1').length > 0) { 68 $('body, html').animate({ 69 scrollTop: $('#advgb-tabs-tab1').offset().top 70 }, 300); 71 } 72 73 }, 100); 74 } 75 } 76 77}); 78 79$(window).scroll(function () { 80 if ($(window).scrollTop() >= 120) { 81 $('header').addClass('sticky-header'); 82 } else { 83 $('header').removeClass('sticky-header'); 84 } 85}); 86 87function linebreaksToBR(str){ 88 return str.replace(/(?:\r\n|\r|\n)/g, '<br>'); 89} 90 91$(document).ready(function () { 92 93 //add linebreaks to board of directors descriptions 94 $(".board_wrap .individualDesc .content-right .description").each(function( index ) { 95 $(this).html( linebreaksToBR($(this).html()).replace(/<br><br>/g,"<br>") ); 96 }); 97 98 /*if ($(".url-inputs-wrapper .editor-url-input input") .length > 0 && $(".url-inputs-wrapper .editor-url-input input").val() != '' ) { 99 console.log ("not empty"); 100 } else { 101 console.log ("add default"); 102 var input = $(".url-inputs-wrapper .editor-url-input input"); 103 input.val( input.val() + "#" ); 104 console.log ("# added"); 105 }*/ 106 107 108 109 110 $(window).resize(function () { 111 // var h = $('.home-banner-image img:visible').outerHeight(); 112 // console.log (h); 113 // ('.views_slideshow_cycle_slide:visible, .views_slideshow_cycle_teaser_section').height(h) 114 }) 115 //header search bar 116 117 $('body').on('click', '#buttonsearch', function () { 118 $('#formsearch').slideToggle('fast'); 119 $('form#searchform').submit(); 120 }) 121 122 $("#edit-field-news-date-value").datepicker({ 123 dateFormat: 'dd-mm-yy', 124 changeMonth: true, 125 changeYear: true 126 }); 127 $("#edit-field-news-date-value").attr("autocomplete", "off"); 128 //copy to clipboard 129 $('.custom-mapbox-outer').prependTo("#block-actransit-theme-content"); 130 131 132 new Clipboard('.copy_event', { 133 text: function (trigger) { 134 return trigger.getAttribute('href'); 135 } 136 }); 137 $('.copy_event').bind('click', function (e) { 138 e.preventDefault(); 139 }); 140 //image gallery show hide 141 $('.image-gallery-view h3').wrapAll("<div class='galleryTab'><ul class='galleryTabul'></ul></div>"); 142 var h3_counter = 1; 143 $('.image-gallery-view h3').each(function () { 144 $(this).wrap('<li><a href="#tabgall' + h3_counter + '"></a></li>'); 145 // $(this).attr('data-tab','#tabgall'+h3_counter); 146 // if(h3_counter == 1) { 147 // $(this).addClass('active'); 148 // } 149 h3_counter++; 150 }); 151 var div_counter = 1; 152 $('.views-view-grid.horizontal.cols-4').each(function () { 153 $(this).wrap('<div id="tabgall' + div_counter + '" ></div>'); 154 // $(this).attr('id','tabgall'+div_counter); 155 // if(div_counter == 1) { 156 // }else{ 157 // $(this).css('display','none'); 158 // } 159 div_counter++; 160 }); 161 var div_counter_detail = 1; 162 $('.image-gallery-view-detail .galleryTabPreview .views-row').each(function () { 163 $(this).wrap('<div id="tabgall' + div_counter_detail + '" ></div>'); 164 div_counter_detail++; 165 }); 166 // $('.views-view-grid.horizontal.cols-4.clearfix').not(':eq(0)').hide(); 167 // $('.image-gallery-view h3:first').addClass('active'); 168 // $('.image-gallery-view h3').click(function() { 169 // $('.image-gallery-view h3.active').removeClass('active'); 170 // $(this).addClass('active'); 171 // $('.views-view-grid.horizontal.cols-4.clearfix').fadeOut(); 172 // $('.views-view-grid.horizontal.cols-4.clearfix').removeClass('show_gallery'); 173 // $(this).next('.views-view-grid.horizontal.cols-4.clearfix').fadeIn(); 174 // $(this).next('.views-view-grid.horizontal.cols-4.clearfix').addClass('show_gallery'); 175 // //$('.views-view-grid.horizontal.cols-4.show_gallery').prependTo("#block-actransit-theme-content"); 176 // }) 177 178 //hover border control 179 $('.features .row > div').on('mouseenter', function () { 180 console.log($(this).parent().parent().parent().prev()) 181 if ($(this).prev().find('.ftr_col_cont').length > 0) { 182 $(this).prev().find('.ftr_col_cont').addClass('noBorderAddMarg') 183 $(this).find('.ftr_col_cont').css('margin-left', '2px'); 184 } 185 }) 186 $('.features .row > div').on('mouseleave', function () { 187 console.log($(this).parent().parent().parent().prev()) 188 if ($(this).prev().find('.ftr_col_cont').length > 0) { 189 $(this).prev().find('.ftr_col_cont').removeClass('noBorderAddMarg') 190 $(this).find('.ftr_col_cont').css('margin-left', '0'); 191 } 192 }) 193 194 $("#navbarResponsive ul").addClass("navbar-nav ml-auto"); 195 $("#navbarResponsive ul ul").removeClass("navbar-nav ml-auto"); 196 $("#navbarResponsive ul ul").addClass("dropdown-menu"); 197 198 /*$(function() { 199 $('#block-languageswitcher ul.links').each(function() { 200 var $select = $('<select class="languageswitcher"/>'); 201 202 $(this).find('a').each(function() { 203 var $option = $('<option />'); 204 $option.attr('value', $(this).attr('href')).html($(this).html()); 205 $select.append($option); 206 }); 207 208 $(this).replaceWith($select); 209 }); 210 });*/ 211 212 //$("body").children().each(function () { 213 // $(this).html( $(this).html().replace(/\<div class=\"statements\"\>00\<div\>/gi," ") ); 214 //}); 215 216 /*$('.statements').each(function() { 217 var text = $(this).text(); 218 $(this).text(text.replace('00', '')); 219 });*/ 220 221 //$('.statements').html($('.statements').html().replace('00','')); 222 223 $('.teamIndiName').each(function () { 224 var text = $(this).text(); 225 $(this).text(text.replace('H E. Christian Peeples', 'H. E. Christian Peeples')); 226 }); 227 //$('.teamInner a').html($('.teamInner a').html().replace('section4H.','section4H')); 228 $("a[href='#section4H.']").attr('href', '#section4H'); 229 230 $('.line_type').each(function () { 231 var text = $(this).text(); 232 $(this).text(text.replace('Local Lines', 'Local Line')); 233 }); 234 $('.line_type').each(function () { 235 var text = $(this).text(); 236 $(this).text(text.replace('Service to Schools Lines', 'Service to Schools Line')); 237 }); 238 $('.line_type').each(function () { 239 var text = $(this).text(); 240 $(this).text(text.replace('Early Bird Lines', 'Early Bird Line')); 241 }); 242 $('.line_type').each(function () { 243 var text = $(this).text(); 244 $(this).text(text.replace('All Nighter Lines', 'All Nighter Line')); 245 }); 246 $('.line_type').each(function () { 247 var text = $(this).text(); 248 $(this).text(text.replace('Transbay Lines', 'Transbay Line')); 249 }); 250 $('.line-type').each(function () { 251 var text = $(this).text(); 252 $(this).text(text.replace('Local Lines', 'Local Line')); 253 }); 254 $('.line-type').each(function () { 255 var text = $(this).text(); 256 $(this).text(text.replace('Service to Schools Lines', 'Service to Schools Line')); 257 }); 258 $('.line-type').each(function () { 259 var text = $(this).text(); 260 $(this).text(text.replace('Early Bird Lines', 'Early Bird Line')); 261 }); 262 $('.line-type').each(function () { 263 var text = $(this).text(); 264 $(this).text(text.replace('All Nighter Lines', 'All Nighter Line')); 265 }); 266 $('.line-type').each(function () { 267 var text = $(this).text(); 268 $(this).text(text.replace('Transbay Lines', 'Transbay Line')); 269 }); 270 $(".bus-lines h3:contains(Service to Schools Lines)").append("<p class=\"school_text\">Lines 600â699 operate school days only, and are suspended during summer. Times vary from day to day to accommodate school bell times. This service is available to everyone at regular fares.</p>"); 271 272 273 274 275 //$("div.statements:contains('00')").remove(); 276 /*document.body.innerHTML = document.body.innerHTML.replace(/section6H./g, 'section6H'); 277 document.body.innerHTML = document.body.innerHTML.replace(/section5H./g, 'section5H'); 278 document.body.innerHTML = document.body.innerHTML.replace(/section4H./g, 'section4H'); 279 document.body.innerHTML = document.body.innerHTML.replace(/section3H./g, 'section3H'); 280 document.body.innerHTML = document.body.innerHTML.replace(/\<div class=\"statements\"\>00\<\/div\>/g, ' '); 281 document.body.innerHTML = document.body.innerHTML.replace(/\<span class=\"line_type\"\>Local Lines \<\/span\>/g, ' \<span class=\"line_type\"\>Local Line \<\/span\>'); 282 document.body.innerHTML = document.body.innerHTML.replace(/\<span class=\"line-type\"\>Local Lines\<\/span\>/g, ' \<span class=\"line-type\"\>Local Line \<\/span\>'); 283 document.body.innerHTML = document.body.innerHTML.replace(/\<span class=\"line_type\"\>Service to Schools Lines \<\/span\>/g, ' \<span class=\"line_type\"\>Service to Schools Line \<\/span\>'); 284 document.body.innerHTML = document.body.innerHTML.replace(/\<span class=\"line-type\"\>Service to Schools Lines\<\/span\>/g, ' \<span class=\"line-type\"\>Service to Schools Line \<\/span\>'); 285 document.body.innerHTML = document.body.innerHTML.replace(/\<span class=\"line_type\"\>Early Bird Lines \<\/span\>/g, ' \<span class=\"line_type\"\>Early Bird Line \<\/span\>'); 286 document.body.innerHTML = document.body.innerHTML.replace(/\<span class=\"line-type\"\>Early Bird Lines\<\/span\>/g, ' \<span class=\"line-type\"\>Early Bird Line \<\/span\>'); 287 document.body.innerHTML = document.body.innerHTML.replace(/\<span class=\"line_type\"\>All Nighter Lines \<\/span\>/g, ' \<span class=\"line_type\"\>All Nighter Line \<\/span\>'); 288 document.body.innerHTML = document.body.innerHTML.replace(/\<span class=\"line-type\"\>All Nighter Lines\<\/span\>/g, ' \<span class=\"line-type\"\>All Nighter Line \<\/span\>'); 289 document.body.innerHTML = document.body.innerHTML.replace(/\<span class=\"line_type\"\>Transbay Lines \<\/span\>/g, ' \<span class=\"line_type\"\>Transbay Line \<\/span\>'); 290 document.body.innerHTML = document.body.innerHTML.replace(/\<span class=\"line-type\"\>Transbay Lines\<\/span\>/g, ' \<span class=\"line-type\"\>Transbay Line \<\/span\>');*/ 291 292 if ($(window).width() > 991) { 293 /* var imageWidth = $('#block-homecontainerleft img').width(); 294 var imageHeight = $('#block-homecontainerleft img').height(); 295 var imageRatio = imageWidth/imageHeight; 296 var imageDivWidth = $('#block-homecontainerleft').width(); 297 var imageDivHeight = $('#block-homecontainerleft').height(); 298 $('#block-homecontainerleft').css('height',imageDivHeight); 299 $('#block-homecontainerleft img').css('height',imageDivHeight); 300 var imageNewWidth = imageDivHeight*imageRatio; 301 $('#block-homecontainerleft img').css('width',imageNewWidth); 302 $('#block-homecontainerleft img').css('max-width','inherit'); 303 304 var imageWidth = $('#block-homecontainerright1 img').width(); 305 var imageHeight = $('#block-homecontainerright1 img').height(); 306 var imageRatio = imageWidth/imageHeight; 307 var imageDivWidth = $('#block-homecontainerright1').width(); 308 var imageDivHeight = $('#block-homecontainerright1').height(); 309 $('#block-homecontainerright1').css('height',imageDivHeight); 310 $('#block-homecontainerright1 img').css('height',imageDivHeight); 311 var imageNewWidth = imageDivHeight*imageRatio; 312 $('#block-homecontainerright1 img').css('width',imageNewWidth); 313 $('#block-homecontainerright1 img').css('max-width','inherit'); 314 315 var imageWidth = $('#block-homecontainerright2 img').width(); 316 var imageHeight = $('#block-homecontainerright2 img').height(); 317 var imageRatio = imageWidth/imageHeight; 318 var imageDivWidth = $('#block-homecontainerright2').width(); 319 var imageDivHeight = $('#block-homecontainerright2').height(); 320 $('#block-homecontainerright2').css('height',imageDivHeight); 321 $('#block-homecontainerright2 img').css('height',imageDivHeight); 322 var imageNewWidth = imageDivHeight*imageRatio; 323 $('#block-homecontainerright2 img').css('width',imageNewWidth); 324 $('#block-homecontainerright2 img').css('max-width','inherit'); 325 326 var imageWidth = $('#block-homecontainerfull img').width(); 327 var imageHeight = $('#block-homecontainerfull img').height(); 328 var imageRatio = imageWidth/imageHeight; 329 var imageDivWidth = $('#block-homecontainerfull').width(); 330 var imageDivHeight = $('#block-homecontainerfull').height(); 331 if (imageDivHeight > 500) { 332 $('#block-homecontainerfull').css('height',imageDivHeight); 333 $('#block-homecontainerfull img').css('height',imageDivHeight); 334 var imageNewWidth = imageDivHeight*imageRatio; 335 $('#block-homecontainerfull img').css('width',imageNewWidth); 336 $('#block-homecontainerfull img').css('max-width','inherit'); 337 } */ 338 339 } 340 341 $(window).resize(function () { 342 if ($(window).width() > 991) { 343 /* var imageWidth = $('#block-homecontainerleft img').width(); 344 var imageHeight = $('#block-homecontainerleft img').height(); 345 var imageRatio = imageWidth/imageHeight; 346 var imageDivWidth = $('#block-homecontainerleft').width(); 347 var imageDivHeight = $('#block-homecontainerleft').height(); 348 $('#block-homecontainerleft').css('height',imageDivHeight); 349 $('#block-homecontainerleft img').css('height',imageDivHeight); 350 var imageNewWidth = imageDivHeight*imageRatio; 351 $('#block-homecontainerleft img').css('width',imageNewWidth); 352 $('#block-homecontainerleft img').css('max-width','inherit'); 353 354 var imageWidth = $('#block-homecontainerright1 img').width(); 355 var imageHeight = $('#block-homecontainerright1 img')
355.height(); 356 var imageRatio = imageWidth/imageHeight; 357 var imageDivWidth = $('#block-homecontainerright1').width(); 358 var imageDivHeight = $('#block-homecontainerright1').height(); 359 $('#block-homecontainerright1').css('height',imageDivHeight); 360 $('#block-homecontainerright1 img').css('height',imageDivHeight); 361 var imageNewWidth = imageDivHeight*imageRatio; 362 $('#block-homecontainerright1 img').css('width',imageNewWidth); 363 $('#block-homecontainerright1 img').css('max-width','inherit'); 364 365 var imageWidth = $('#block-homecontainerright2 img').width(); 366 var imageHeight = $('#block-homecontainerright2 img').height(); 367 var imageRatio = imageWidth/imageHeight; 368 var imageDivWidth = $('#block-homecontainerright2').width(); 369 var imageDivHeight = $('#block-homecontainerright2').height(); 370 $('#block-homecontainerright2').css('height',imageDivHeight); 371 $('#block-homecontainerright2 img').css('height',imageDivHeight); 372 var imageNewWidth = imageDivHeight*imageRatio; 373 $('#block-homecontainerright2 img').css('width',imageNewWidth); 374 $('#block-homecontainerright2 img').css('max-width','inherit'); 375 376 var imageWidth = $('#block-homecontainerfull img').width(); 377 var imageHeight = $('#block-homecontainerfull img').height(); 378 var imageRatio = imageWidth/imageHeight; 379 var imageDivWidth = $('#block-homecontainerfull').width(); 380 var imageDivHeight = $('#block-homecontainerfull').height(); 381 if (imageDivHeight > 500) { 382 $('#block-homecontainerfull').css('height',imageDivHeight); 383 $('#block-homecontainerfull img').css('height',imageDivHeight); 384 var imageNewWidth = imageDivHeight*imageRatio; 385 $('#block-homecontainerfull img').css('width',imageNewWidth); 386 $('#block-homecontainerfull img').css('max-width','inherit'); 387 } 388 */ 389 } 390 391 //responsive banner 392 if ($(window).width() <= 991) { 393 var wWidth = $(window).width(); 394 $('.views_slideshow_cycle_slide, .views_slideshow_cycle_teaser_section').width(wWidth); 395 var totalHeight = 0; 396 $(".views_slideshow_cycle_slide").children().each(function () { 397 398 totalHeight = totalHeight + $(this).outerHeight(true); 399 //console.log($(this).outerHeight(true)); 400 //console.log(totalHeight); 401 }); 402 403 $('.views_slideshow_cycle_slide, .views_slideshow_cycle_teaser_section').height(totalHeight); 404 //console.log(totalHeight); 405 //wWidth/2.664 406 } 407 }); //resize 408 409 //$('.wp-block-advgb-clickable-icons .get_col .img_caption').appendTo(".wp-block-advgb-clickable-icons .get_col_wrp > a"); 410 //$('<figure class="icon-image">').prependTo(".wp-block-advgb-clickable-icons .get_col img"); 411 $('.wp-block-advgb-clickable-icons .get_col img').wrap('<figure class="icon-image"></figure>'); 412 413 var imageWidth = $('.wp-block-advgb-clickable-image img').width(); 414 var imageHeight = $('.wp-block-advgb-clickable-image img').height(); 415 var imageRatio = imageWidth / imageHeight; 416 var imageDivWidth = $('.get_col').width(); 417 var imageDivHeight = $('.get_col').height(); 418 var imageNewWidth = imageDivHeight * imageRatio; 419 var imageNewHeight = imageDivWidth * 3 / 4; 420 $('.wp-block-advgb-clickable-images .get_col').css('width', imageDivWidth); 421 $('.wp-block-advgb-clickable-images .get_col').css('height', imageNewHeight); 422 423 if (imageRatio > 4 / 3) { 424 $('.wp-block-advgb-clickable-images .get_col').css('width', imageDivWidth); 425 $('.wp-block-advgb-clickable-images img').css('height', '100%'); 426 $('.wp-block-advgb-clickable-images img').css('width', imageNewWidth); 427 $('.wp-block-advgb-clickable-images img').css('max-width', 'inherit'); 428 } 429 430 /* var imageExWidth = $('.expanding-grid .teamInner img').width(); 431 var imageExHeight = $('.expanding-grid .teamInner img').height(); 432 var imageExRatio = imageExWidth/imageExHeight; 433 var imageExNewHeight = imageExWidth * 3/2; 434 var imageExDivWidth = $('.expanding-grid .teamInner').width(); 435 $('.expanding-grid .teamInner').css('width',imageExDivWidth); 436 437 438 alert(imageExDivWidth); 439 440 if (imageExRatio < 2/3) { 441 $('.expanding-grid .teamInner a').css('height',imageExNewHeight); 442 $('.expanding-grid .teamInner img').css('width','100%'); 443 $('.expanding-grid .teamInner img').css('max-width','inherit'); 444 } else if (imageExRatio > 2/3) { 445 $('.expanding-grid .teamInner a').css('height',imageExNewHeight); 446 $('.expanding-grid .teamInner img').css('width','auto'); 447 $('.expanding-grid .teamInner img').css('max-width','inherit'); 448 } */ 449 450 /*$('#block-languageswitcher ul.links').each(function() { 451 var select = $(document.createElement('select')).insertBefore($(this).hide()); 452 $(this).find('li a').each(function() { 453 option = $(document.createElement('option')).appendTo(select).val(this.href).html($(this).html()); 454 }); 455 456 $('#block-languageswitcher select').on('change', function(){ 457 targ = $(this).val(); 458 window.location.href = targ; 459 }) 460 var targUrl = window.location 461 console.log('sdsdsa', targUrl) 462 $('#block-languageswitcher option').each(function(index, element) { 463 if ($(this).val() == targUrl) { 464 $(this).attr('selected', true); 465 } 466 }); 467 }); */ 468 469}); 470 471$(document).ready(function () { 472 //disable filter button 473 $('#edit-submit-route-details').prop('disabled', true); 474 $('#views-exposed-form-route-details-block-1 select').on('change', function () { 475 $('#edit-submit-route-details').prop('disabled', false); 476 }) 477 478 /*$('.accordion .acco_title').click(function () { 479 var dropDown = $(this).closest('li').find('.acco_content'), 480 thisSchedBox = $(this).find('.scheduleBox') 481 $(this).find('.scheduleBox').toggleClass('active'); 482 $(this).parent().siblings().find('.scheduleBox').removeClass('active'); 483 $(this).closest('.accordion').find('.acco_content').not(dropDown).slideUp(); 484 if ($(this).hasClass('active')) { 485 $(this).removeClass('active'); 486 } else { 487 $(this).closest('.accordion').find('.acco_title.active').removeClass('active'); 488 $(this).addClass('active'); 489 } 490 dropDown.stop(false, true).slideToggle(); 491 //j.preventDefault(); 492 });*/ 493 494 $(".mapNotificationBar").click(function () { 495 $("#lblNoticeContentAlert").toggle(); 496 }); 497 $('<div class="overlay"></div>').insertBefore(".wp-block-media-text__media > img"); 498 //Breadcrumb changes - start 499 // $('.breadcrumb_wrapper ol li:first-child').prepend('<i class="fa fa-home"></i>'); 500 $('.breadcrumb_wrapper ol li:first-child').prepend('<img src="/themes/actransit_theme/images/home.png" alt="Home icon for link to home page">'); 501 $('.breadcrumb_wrapper ol li:not(:last-child)').append('<i class="fa fa-angle-right"></i>'); 502 $('.pdf-listing tbody').prepend('<tr><th>Meetings</th><th>Agenda</th></tr>'); 503 $('.ordinaces-class tbody').prepend('<tr><th>Date</th><th>Ordinance Number & Description</th></tr>'); 504 $('.board-meeting tbody').prepend('<tr><th> Board Meeting Date</th><th>Document Description</th></tr>'); 505 //Breadcrumb changes - end 506 $('.gtranslate select option[value=""]').text("Translate"); 507 $('.gtranslate').css('display', 'block'); 508 /* $('.accordion .acco_title').on('click', function(j) { 509 var dropDown = $(this).closest('li').find('.acco_content'), 510 thisSchedBox = $(this).find('.scheduleBox'); 511 $(this).find('.scheduleBox').toggleClass('active'); 512 $(this).parent().siblings().find('.scheduleBox').removeClass('active'); 513 $(this).closest('.accordion').find('.acco_content').not(dropDown).slideUp(); 514 515 516 if ($(this).hasClass('active')) { 517 $(this).removeClass('active'); 518 } else { 519 $(this).closest('.accordion').find('.acco_title.active').removeClass('active'); 520 $(this).addClass('active'); 521 } 522 523 dropDown.stop(false, true).slideToggle(); 524 525 j.preventDefault(); 526 }); */ 527 528 // filter items on button click 529 $('#filters,#filters1,#filters2').on('click', 'option', function () { 530 var filterValue = $(this).attr('data-filter'); 531 $container.isotope({ 532 filter: filterValue 533 }); 534 }); 535 536 //line tabs 537 $('body').on('click', '.dateTab li', function () { 538 var target = $(this).data('tab'); 539 console.log(target) 540 $(target).fadeIn('fast'); 541 $(target).siblings('.mainTab').fadeOut('fast'); 542 $(this).addClass('active'); 543 $(this).siblings().removeClass('active') 544 }); 545 546 $('body').on('click', '.routeTab li', function () { 547 var target = $(this).data('line'); 548 console.log(target) 549 $(target).fadeIn('fast'); 550 $(target).siblings('.lineTab').fadeOut('fast'); 551 $(this).addClass('active'); 552 $(this).siblings().removeClass('active') 553 }); 554 555 //tooltip 556 if ($('.tooltip').length > 0) { 557 $('.tooltip').tooltipster({ 558 //options 559 /*trigger: 'click',*/ 560 }); 561 } 562 563 //time cell 564 /* $('body').on('click', '.timeCell', function() { 565 var $this = $(this); 566 $this.parent().parent().find('.timeRow').fadeOut('fast', function(){ 567 $this.parent().next('.stopsLine').fadeIn('fast'); 568 }) 569 })*/ 570 //backToTimings 571 $('body').on('click', '.backToTimings', function () { 572 $('.stopsLine:visible').fadeOut('fast', function () { 573 $('.timeRow').fadeIn('fast'); 574 }); 575 }); 576 // $('body').on('click','.acco_title',function(){ 577 // var href = $(this).find('a:last-child').attr('href'); 578 // window.location.href = href 579 // }) 580 /*$('body').on('click','.map-schedule-link',function(){ 581 var href = $(this).attr('href'); 582 window.location.href = href 583 })*/ 584 // team page popup handler 585 $('<div class="plus-minus_icon"></div>').insertAfter('.teamTitle'); 586 587 // var divs = $('.links.row-count-1 .teamInner'); 588 // for (var i = 0; i < divs.length; i += 4) { 589 // divs.slice(i, i + 4).wrapAll("<div class='newRow'></div>"); 590 // } 591 // var divs = $('.links.row-count-2 .teamInner'); 592 // for (var i = 0; i < divs.length; i += 4) { 593 // divs.slice(i, i + 4).wrapAll("<div class='newRow'></div>"); 594 // } 595 // var divs = $('.links.row-count-3 .teamInner'); 596 // for (var i = 0; i < divs.length; i += 4) { 597 // divs.slice(i, i + 4).wrapAll("<div class='newRow'></div>"); 598 // } 599 // var divs = $('.links.row-count-4 .teamInner'); 600 // for (var i = 0; i < divs.length; i += 4) { 601 // divs.slice(i, i + 4).wrapAll("<div class='newRow'></div>"); 602 // } 603 // var divs = $('.links.row-count-5 .teamInner'); 604 // for (var i = 0; i < divs.length; i += 4) { 605 // divs.slice(i, i + 4).wrapAll("<div class='newRow'></div>"); 606 // } 607 // var divs = $('.links.row-count-6 .teamInner'); 608 // for (var i = 0; i < divs.length; i += 4) { 609 // divs.slice(i, i + 4).wrapAll("<div class='newRow'></div>"); 610 // } 611 // var divs = $('.links.row-count-7 .teamInner'); 612 // for (var i = 0; i < divs.length; i += 4) { 613 // divs.slice(i, i + 4).wrapAll("<div class='newRow'></div>"); 614 // } 615 // var divs = $('.links.row-count-8 .teamInner'); 616 // for (var i = 0; i < divs.length; i += 4) { 617 // divs.slice(i, i + 4).wrapAll("<div class='newRow'></div>"); 618 // } 619 // var divs = $('.links.row-count-9 .teamInner'); 620 // for (var i = 0; i < divs.length; i += 4) { 621 // divs.slice(i, i + 4).wrapAll("<div class='newRow'></div>"); 622 // } 623 // var divs = $('.links.row-count-10 .teamInner'); 624 // for (var i = 0; i < divs.length; i += 4) { 625 // divs.slice(i, i + 4).wrapAll("<div class='newRow'></div>"); 626 // } 627 // var divs = $('.links.row-count-11 .teamInner'); 628 // for (var i = 0; i < divs.length; i += 4) { 629 // divs.slice(i, i + 4).wrapAll("<div class='newRow'></div>"); 630 // } 631 // var divs = $('.links.row-count-12 .teamInner'); 632 // for (var i = 0; i < divs.length; i += 4) { 633 // divs.slice(i, i + 4).wrapAll("<div class='newRow'></div>"); 634 // } 635 $('.links[class*="row-count-"]').each(function () { 636 var $this = $(this); 637 var divs = $this.find('.teamInner'); 638 639 for (var i = 0; i < divs.length; i += 4) { 640 divs.slice(i, i + 4).wrapAll("<div class='newRow'></div>"); 641 } 642 }); 643 644 $('.teamInner a').on('click', function (e) { 645 e.preventDefault(); 646 var targDiv = $(this).attr('href'); 647 648 $(this).parent().addClass('active'); 649 $(this).parent().siblings().removeClass('active'); 650 $(this).parent().parent().siblings('.newRow').find('.teamInner').removeClass('active'); 651 $(this).addClass('active'); 652 $(this).parent().siblings().find('a').removeClass('active'); 653 $(this).parent().parent().siblings('.newRow').find('.teamInner').find('a').removeClass('active'); 654 $('.board_wrap .expanding-container').hide(); 655 656 if ($(window).width() > 991) { 657 $(targDiv).insertAfter($(this).parent().parent()).fadeIn('fast', function () { 658 var offsetX = 0 659 if ($('header').hasClass('sticky-header')) { 660 var offset = $(targDiv).offset().top, 661 offsetX = Math.abs(offset - 122); 662 console.log('small head', offsetX) 663 } else { 664 var offset = $(targDiv).offset().top, 665 offsetX = Math.abs(offset - 240); 666 console.log('big head', offsetX) 667 } 668 669 $('body, html').animate({ 670 scrollTop: offsetX 671 }, 400); 672 }); 673 } else { 674 $(targDiv).insertAfter($(this).parent()).fadeIn('fast', function () { 675 var offsetX = 0 676 if ($('header').hasClass('sticky-header')) { 677 var offset = $(targDiv).offset().top, 678 offsetX = Math.abs(offset - 142); 679 console.log('small head', offsetX) 680 } else { 681 var offset = $(targDiv).offset().top, 682 offsetX = Math.abs(offset - 198); 683 console.log('big head', offsetX) 684 } 685 686 $('body, html').animate({ 687 scrollTop: offsetX 688 }, 400); 689 }); 690 } 691 692 }) 693 694 var hHeight = $('header').height(); 695 if (hHeight > 150) { 696 if ($('.banner')) { 697 $('.banner').addClass('alert-banner'); 698 } 699 $('.main_wrapper').addClass('alert-banner'); 700 if ($('.banner')) { 701 // document.getElementsByClassName("banner").style.paddingTop = hHeight; 702 } 703 } 704 705 //mobile menu 706 $('.navbar-nav li').each(function (index, element) { 707 var $this = $(this); 708 if ($this.find('a').next('.dropdown-menu').length > 0) { 709 $this.append('<span></span><div class="line"></div><div class="bottom line"></div>'); 710 } 711 }); 712 $('body').on('click', '.navbar-toggler', function () { 713 $('body').toggleClass('fixed'); 714 $(this).toggleClass('opened'); 715 $('.navbar-nav').slideToggle('fast'); 716 /*$('body').on('click','.navbar-nav li span:not(".active")', function() { 717 $(this).parent().addClass('active'); 718 $(this).parent().siblings().removeClass('active'); 719 // $(this).prev('ul').slideDown(300); 720 console.log('booooooooooooooo') 721 $(this).parent().siblings().find('ul').slideUp(300); 722 });*/ 723 $('body').on('click', '.navbar-nav li span', function () { 724 $(this).parent().toggleClass('active'); 725 //$(this).parent().siblings().removeClass('active'); 726 $(this).prev('ul').slideToggle(300); 727 //$(this).parent().siblings().find('ul').slideToggle(300); 728 }); 729 }); 730 /* var offSet = $("#edit-report-date").offset(); 731 $('#ui-datepicker-div').css('left', offSet.left+'px') */ 732 //line details accordion time wrapper 733 /* $('.acco_content >
733.timeRow:nth-child(1)').removeClass('timeRow'); 734 var divs = $('.acco_content .timeCell'); 735 for(var i = 0; i < divs.length; i+=3) { 736 divs.slice(i, i+3).wrapAll("<div class='timeRow'></div>"); 737 } */ 738 739 $('body').on('click', '.showAll', function () { 740 var $this = $(this); 741 $this.addClass('hide'); 742 $('.hide-0.set-1').addClass('show'); 743 $('.hide-0.set-2').addClass('show'); 744 $('.hide-0.set-3').addClass('show'); 745 $('.hide-0.set-4').addClass('show'); 746 $('.hide-0.set-5').addClass('show'); 747 $('.hide-0.set-6').addClass('show'); 748 $('.hide-0.set-7').addClass('show'); 749 $('.hide-0.set-8').addClass('show'); 750 $('.hide-0.set-9').addClass('show'); 751 $('.hide-0.set-10').addClass('show'); 752 $('.modal-details.drop-off-0.set-1').addClass('show'); 753 $('.modal-details.drop-off-0.set-2').addClass('show'); 754 $('.modal-details.drop-off-0.set-3').addClass('show'); 755 $('.modal-details.drop-off-0.set-4').addClass('show'); 756 $('.modal-details.drop-off-0.set-5').addClass('show'); 757 $('.modal-details.drop-off-0.set-6').addClass('show'); 758 $('.modal-details.drop-off-0.set-7').addClass('show'); 759 $('.modal-details.drop-off-0.set-8').addClass('show'); 760 $('.modal-details.drop-off-0.set-9').addClass('show'); 761 $('.modal-details.drop-off-0.set-10').addClass('show'); 762 763 $('.routeCount.set-1').addClass('hide'); 764 $('.routeCount.set-2').addClass('hide'); 765 $('.routeCount.set-3').addClass('hide'); 766 $('.routeCount.set-4').addClass('hide'); 767 $('.routeCount.set-5').addClass('hide'); 768 $('.routeCount.set-6').addClass('hide'); 769 $('.routeCount.set-7').addClass('hide'); 770 $('.routeCount.set-8').addClass('hide'); 771 $('.routeCount.set-9').addClass('hide'); 772 $('.routeCount.set-10').addClass('hide'); 773 $('.hiderouteCount.set-1').addClass('show'); 774 $('.hiderouteCount.set-2').addClass('show'); 775 $('.hiderouteCount.set-3').addClass('show'); 776 $('.hiderouteCount.set-4').addClass('show'); 777 $('.hiderouteCount.set-5').addClass('show'); 778 $('.hiderouteCount.set-6').addClass('show'); 779 $('.hiderouteCount.set-7').addClass('show'); 780 $('.hiderouteCount.set-8').addClass('show'); 781 $('.hiderouteCount.set-9').addClass('show'); 782 $('.hiderouteCount.set-10').addClass('show'); 783 $this.parent().find('.hideAll').addClass('show'); 784 }) 785 786 $('body').on('click', '.hideAll', function () { 787 var $this = $(this); 788 $this.removeClass('show'); 789 $('.hide-0.set-1').removeClass('show'); 790 $('.hide-0.set-2').removeClass('show'); 791 $('.hide-0.set-3').removeClass('show'); 792 $('.hide-0.set-4').removeClass('show'); 793 $('.hide-0.set-5').removeClass('show'); 794 $('.hide-0.set-6').removeClass('show'); 795 $('.hide-0.set-7').removeClass('show'); 796 $('.hide-0.set-8').removeClass('show'); 797 $('.hide-0.set-9').removeClass('show'); 798 $('.hide-0.set-10').removeClass('show'); 799 $('.routeCount.set-1').removeClass('hide'); 800 $('.routeCount.set-2').removeClass('hide'); 801 $('.routeCount.set-3').removeClass('hide'); 802 $('.routeCount.set-4').removeClass('hide'); 803 $('.routeCount.set-5').removeClass('hide'); 804 $('.routeCount.set-6').removeClass('hide'); 805 $('.routeCount.set-7').removeClass('hide'); 806 $('.routeCount.set-8').removeClass('hide'); 807 $('.routeCount.set-9').removeClass('hide'); 808 $('.routeCount.set-10').removeClass('hide'); 809 $('.hiderouteCount.set-1').removeClass('show'); 810 $('.hiderouteCount.set-2').removeClass('show'); 811 $('.hiderouteCount.set-3').removeClass('show'); 812 $('.hiderouteCount.set-4').removeClass('show'); 813 $('.hiderouteCount.set-5').removeClass('show'); 814 $('.hiderouteCount.set-6').removeClass('show'); 815 $('.hiderouteCount.set-7').removeClass('show'); 816 $('.hiderouteCount.set-8').removeClass('show'); 817 $('.hiderouteCount.set-9').removeClass('show'); 818 $('.hiderouteCount.set-10').removeClass('show'); 819 $this.parent().find('.showAll').removeClass('hide'); 820 }) 821 822 $('body').on('click', '.routeCount.set-1', function () { 823 var $this = $(this); 824 $this.addClass('hide'); 825 $this.parent().parent().find('.hide-0.set-1').addClass('show'); 826 $this.parent().find('.hiderouteCount.set-1').addClass('show'); 827 }) 828 829 $('body').on('click', '.hiderouteCount.set-1', function () { 830 var $this = $(this); 831 $this.removeClass('show'); 832 $this.parent().parent().find('.hide-0.set-1').removeClass('show'); 833 $this.parent().find('.routeCount.set-1').removeClass('hide'); 834 }) 835 836 $('body').on('click', '.routeCount.set-2', function () { 837 var $this = $(this); 838 $this.addClass('hide'); 839 $this.parent().parent().find('.hide-0.set-2').addClass('show'); 840 $this.parent().find('.hiderouteCount.set-2').addClass('show'); 841 }) 842 843 $('body').on('click', '.hiderouteCount.set-2', function () { 844 var $this = $(this); 845 $this.removeClass('show'); 846 $this.parent().parent().find('.hide-0.set-2').removeClass('show'); 847 $this.parent().find('.routeCount.set-2').removeClass('hide'); 848 }) 849 850 $('body').on('click', '.routeCount.set-3', function () { 851 var $this = $(this); 852 $this.addClass('hide'); 853 $this.parent().parent().find('.hide-0.set-3').addClass('show'); 854 $this.parent().find('.hiderouteCount.set-3').addClass('show'); 855 }) 856 857 $('body').on('click', '.hiderouteCount.set-3', function () { 858 var $this = $(this); 859 $this.removeClass('show'); 860 $this.parent().parent().find('.hide-0.set-3').removeClass('show'); 861 $this.parent().find('.routeCount.set-3').removeClass('hide'); 862 }) 863 864 $('body').on('click', '.routeCount.set-4', function () { 865 var $this = $(this); 866 $this.addClass('hide'); 867 $this.parent().parent().find('.hide-0.set-4').addClass('show'); 868 $this.parent().find('.hiderouteCount.set-4').addClass('show'); 869 }) 870 871 $('body').on('click', '.hiderouteCount.set-4', function () { 872 var $this = $(this); 873 $this.removeClass('show'); 874 $this.parent().parent().find('.hide-0.set-4').removeClass('show'); 875 $this.parent().find('.routeCount.set-4').removeClass('hide'); 876 }) 877 878 $('body').on('click', '.routeCount.set-5', function () { 879 var $this = $(this); 880 $this.addClass('hide'); 881 $this.parent().parent().find('.hide-0.set-5').addClass('show'); 882 $this.parent().find('.hiderouteCount.set-5').addClass('show'); 883 }) 884 885 $('body').on('click', '.hiderouteCount.set-5', function () { 886 var $this = $(this); 887 $this.removeClass('show'); 888 $this.parent().parent().find('.hide-0.set-5').removeClass('show'); 889 $this.parent().find('.routeCount.set-5').removeClass('hide'); 890 }) 891 892 $('body').on('click', '.routeCount.set-6', function () { 893 var $this = $(this); 894 $this.addClass('hide'); 895 $this.parent().parent().find('.hide-0.set-6').addClass('show'); 896 $this.parent().find('.hiderouteCount.set-6').addClass('show'); 897 }) 898 899 $('body').on('click', '.hiderouteCount.set-6', function () { 900 var $this = $(this); 901 $this.removeClass('show'); 902 $this.parent().parent().find('.hide-0.set-6').removeClass('show'); 903 $this.parent().find('.routeCount.set-6').removeClass('hide'); 904 }) 905 906 $('body').on('click', '.routeCount.set-7', function () { 907 var $this = $(this); 908 $this.addClass('hide'); 909 $this.parent().parent().find('.hide-0.set-7').addClass('show'); 910 $this.parent().find('.hiderouteCount.set-7').addClass('show'); 911 }) 912 913 $('body').on('click', '.hiderouteCount.set-7', function () { 914 var $this = $(this); 915 $this.removeClass('show'); 916 $this.parent().parent().find('.hide-0.set-7').removeClass('show'); 917 $this.parent().find('.routeCount.set-7').removeClass('hide'); 918 }) 919 920 $('body').on('click', '.routeCount.set-8', function () { 921 var $this = $(this); 922 $this.addClass('hide'); 923 $this.parent().parent().find('.hide-0.set-8').addClass('show'); 924 $this.parent().find('.hiderouteCount.set-8').addClass('show'); 925 }) 926 927 $('body').on('click', '.hiderouteCount.set-8', function () { 928 var $this = $(this); 929 $this.removeClass('show'); 930 $this.parent().parent().find('.hide-0.set-8').removeClass('show'); 931 $this.parent().find('.routeCount.set-8').removeClass('hide'); 932 }) 933 934 $('body').on('click', '.routeCount.set-9', function () { 935 var $this = $(this); 936 $this.addClass('hide'); 937 $this.parent().parent().find('.hide-0.set-9').addClass('show'); 938 $this.parent().find('.hiderouteCount.set-9').addClass('show'); 939 }) 940 941 $('body').on('click', '.hiderouteCount.set-9', function () { 942 var $this = $(this); 943 $this.removeClass('show'); 944 $this.parent().parent().find('.hide-0.set-9').removeClass('show'); 945 $this.parent().find('.routeCount.set-9').removeClass('hide'); 946 }) 947 948 $('body').on('click', '.routeCount.set-10', function () { 949 var $this = $(this); 950 $this.addClass('hide'); 951 $this.parent().parent().find('.hide-0.set-10').addClass('show'); 952 $this.parent().find('.hiderouteCount.set-10').addClass('show'); 953 }) 954 955 $('body').on('click', '.hiderouteCount.set-10', function () { 956 var $this = $(this); 957 $this.removeClass('show'); 958 $this.parent().parent().find('.hide-0.set-10').removeClass('show'); 959 $this.parent().find('.routeCount.set-10').removeClass('hide'); 960 }) 961 962 $('body').on('click', '.modal-body .routeCount.set-1', function () { 963 var $this = $(this); 964 $this.addClass('hide'); 965 $this.parent().parent().find('.drop-off-0.set-1').addClass('show');
966 $this.parent().find('.modal-body .hiderouteCount.set-1').addClass('show'); 967 }) 968 969 $('body').on('click', '.modal-body .hiderouteCount.set-1', function () { 970 var $this = $(this); 971 $this.removeClass('show'); 972 $this.parent().parent().find('.drop-off-0.set-1').removeClass('show'); 973 $this.parent().find('.modal-body .routeCount.set-1').removeClass('hide'); 974 }) 975 976 $('body').on('click', '.modal-body .routeCount.set-2', function () { 977 var $this = $(this); 978 $this.addClass('hide'); 979 $this.parent().parent().find('.drop-off-0.set-2').addClass('show'); 980 $this.parent().find('.modal-body .hiderouteCount.set-2').addClass('show'); 981 }) 982 983 $('body').on('click', '.modal-body .hiderouteCount.set-2', function () { 984 var $this = $(this); 985 $this.removeClass('show'); 986 $this.parent().parent().find('.drop-off-0.set-2').removeClass('show'); 987 $this.parent().find('.modal-body .routeCount.set-2').removeClass('hide'); 988 }) 989 990 $('body').on('click', '.modal-body .routeCount.set-3', function () { 991 var $this = $(this); 992 $this.addClass('hide'); 993 $this.parent().parent().find('.drop-off-0.set-3').addClass('show'); 994 $this.parent().find('.modal-body .hiderouteCount.set-3').addClass('show'); 995 }) 996 997 $('body').on('click', '.modal-body .hiderouteCount.set-3', function () { 998 var $this = $(this); 999 $this.removeClass('show'); 1000 $this.parent().parent().find('.drop-off-0.set-3').removeClass('show'); 1001 $this.parent().find('.modal-body .routeCount.set-3').removeClass('hide'); 1002 }) 1003 1004 $('body').on('click', '.modal-body .routeCount.set-4', function () { 1005 var $this = $(this); 1006 $this.addClass('hide'); 1007 $this.parent().parent().find('.drop-off-0.set-4').addClass('show'); 1008 $this.parent().find('.modal-body .hiderouteCount.set-4').addClass('show'); 1009 }) 1010 1011 $('body').on('click', '.modal-body .hiderouteCount.set-4', function () { 1012 var $this = $(this); 1013 $this.removeClass('show'); 1014 $this.parent().parent().find('.drop-off-0.set-4').removeClass('show'); 1015 $this.parent().find('.modal-body .routeCount.set-4').removeClass('hide'); 1016 }) 1017 1018 $('body').on('click', '.modal-body .routeCount.set-5', function () { 1019 var $this = $(this); 1020 $this.addClass('hide'); 1021 $this.parent().parent().find('.drop-off-0.set-5').addClass('show'); 1022 $this.parent().find('.modal-body .hiderouteCount.set-5').addClass('show'); 1023 }) 1024 1025 $('body').on('click', '.modal-body .hiderouteCount.set-5', function () { 1026 var $this = $(this); 1027 $this.removeClass('show'); 1028 $this.parent().parent().find('.drop-off-0.set-5').removeClass('show'); 1029 $this.parent().find('.modal-body .routeCount.set-5').removeClass('hide'); 1030 }) 1031 1032 $('body').on('click', '.modal-body .routeCount.set-6', function () { 1033 var $this = $(this); 1034 $this.addClass('hide'); 1035 $this.parent().parent().find('.drop-off-0.set-6').addClass('show'); 1036 $this.parent().find('.modal-body .hiderouteCount.set-6').addClass('show'); 1037 }) 1038 1039 $('body').on('click', '.modal-body .hiderouteCount.set-6', function () { 1040 var $this = $(this); 1041 $this.removeClass('show'); 1042 $this.parent().parent().find('.drop-off-0.set-6').removeClass('show'); 1043 $this.parent().find('.modal-body .routeCount.set-6').removeClass('hide'); 1044 }) 1045 1046 $('body').on('click', '.modal-body .routeCount.set-7', function () { 1047 var $this = $(this); 1048 $this.addClass('hide'); 1049 $this.parent().parent().find('.drop-off-0.set-7').addClass('show'); 1050 $this.parent().find('.modal-body .hiderouteCount.set-7').addClass('show'); 1051 }) 1052 1053 $('body').on('click', '.modal-body .hiderouteCount.set-7', function () { 1054 var $this = $(this); 1055 $this.removeClass('show'); 1056 $this.parent().parent().find('.drop-off-0.set-7').removeClass('show'); 1057 $this.parent().find('.modal-body .routeCount.set-7').removeClass('hide'); 1058 }) 1059 1060 $('body').on('click', '.modal-body .routeCount.set-8', function () { 1061 var $this = $(this); 1062 $this.addClass('hide'); 1063 $this.parent().parent().find('.drop-off-0.set-8').addClass('show');
1064 $this.parent().find('.modal-body .hiderouteCount.set-8').addClass('show'); 1065 }) 1066 1067 $('body').on('click', '.modal-body .hiderouteCount.set-8', function () { 1068 var $this = $(this); 1069 $this.removeClass('show'); 1070 $this.parent().parent().find('.drop-off-0.set-8').removeClass('show'); 1071 $this.parent().find('.modal-body .routeCount.set-8').removeClass('hide'); 1072 }) 1073 1074 $('body').on('click', '.modal-body .routeCount.set-9', function () { 1075 var $this = $(this); 1076 $this.addClass('hide'); 1077 $this.parent().parent().find('.drop-off-0.set-9').addClass('show'); 1078 $this.parent().find('.modal-body .hiderouteCount.set-9').addClass('show'); 1079 }) 1080 1081 $('body').on('click', '.modal-body .hiderouteCount.set-9', function () { 1082 var $this = $(this); 1083 $this.removeClass('show'); 1084 $this.parent().parent().find('.drop-off-0.set-9').removeClass('show'); 1085 $this.parent().find('.modal-body .routeCount.set-9').removeClass('hide'); 1086 }) 1087 1088 $('body').on('click', '.modal-body .routeCount.set-10', function () { 1089 var $this = $(this); 1090 $this.addClass('hide'); 1091 $this.parent().parent().find('.drop-off-0.set-10').addClass('show'); 1092 $this.parent().find('.modal-body .hiderouteCount.set-10').addClass('show'); 1093 }) 1094 1095 $('body').on('click', '.modal-body .hiderouteCount.set-10', function () { 1096 var $this = $(this); 1097 $this.removeClass('show'); 1098 $this.parent().parent().find('.drop-off-0.set-10').removeClass('show'); 1099 $this.parent().find('.modal-body .routeCount.set-10').removeClass('hide'); 1100 }) 1101 1102 //responsive banner 1103 if ($(window).width() <= 991) { 1104 var wWidth = $(window).width(); 1105 $('.views_slideshow_cycle_slide, .views_slideshow_cycle_teaser_section').width(wWidth); 1106 var th = $(".home-banner-caption-link").outerHeight(); 1107 1108 $('.views_slideshow_cycle_slide img').height(wWidth / 2) 1109 $('.views_slideshow_cycle_slide, .views_slideshow_cycle_teaser_section').height(wWidth / 2 + th) 1110 //wWidth/2.664 1111 } 1112 if ($(window).width() < 992) { 1113 var dollar = "<span class='currencysign'>$</span>" 1114 $(dollar).prependTo($('.currencysign').next('td')) 1115 $('.currencysign').next('td').css('flex-direction', 'row') 1116 $('td.currencysign').empty() 1117 // $(".timeCell.tooltip.hide-0.tooltipstered").parentsUntil(".accordion").hide(); 1118 /* $('td').each(function() { 1119 var $this = $(this); 1120 if ($this.children().length < 1) { 1121 $($this).hide() 1122 } 1123 }); */ 1124 $('#informationwindow').insertAfter('#mainpane'); 1125 } 1126 1127}); 1128 1129 1130//for news datepicker popup 1131$(document).ajaxComplete(function () { 1132 $("#edit-field-news-date-value").datepicker({ 1133 dateFormat: 'dd-mm-yy', 1134 changeMonth: true, 1135 changeYear: true 1136 }); 1137 $("#edit-field-news-date-value").attr("autocomplete", "off"); 1138 1139}); 1140var startLocation_useSearch = false; 1141var endLocation_useSearch = false; 1142$(document).ready(function () { 1143 1144 $('#startLocation').autocomplete({ 1145 source: function (request, response) { 1146 1147 if (!startLocation_useSearch) { 1148 $.getJSON("https://tp.actransit.org/pelias/v1/autocomplete?api_key=&focus.point.lat=45.5223452&focus.point.lon=-122.6821804&boundary.rect.min_lat=37.2445&boundary.rect.min_lon=-123.2&boundary.rect.max_lat=38.5026&boundary.rect.max_lon=-121", 1149 { 1150 text: $('#startLocation').val() 1151 } 1152 ).done(function(autocompleteData) { 1153 1154 var autocompleteArray = $.map(autocompleteData.features, function (item) { 1155 return item.properties.label; 1156 }); 1157 1158 autoLocationData = autocompleteData.features; 1159 1160 if (autocompleteData.geocoding.query.text.length >= 6) { 1161 autocompleteArray.push("See more.."); 1162 } 1163 1164 response(autocompleteArray); 1165 }); 1166 } else { 1167 startLocation_useSearch = false; 1168 1169 $.getJSON("https://tp.actransit.org/pelias/v1/search?api_key=&focus.point.lat=45.5223452&focus.point.lon=-122.6821804&boundary.rect.min_lat=37.2445&boun
1169dary.rect.min_lon=-123.2&boundary.rect.max_lat=38.5026&boundary.rect.max_lon=-121", 1170 { 1171 text: $('#startLocation').val() 1172 } 1173 ).done(function(autocompleteData) { 1174 1175 var autocompleteArray = $.map(autocompleteData.features, function (item) { 1176 return item.properties.label; 1177 }); 1178 1179 autoLocationData = autocompleteData.features; 1180 1181 if (autocompleteData.geocoding.query.text.length >= 6) { 1182 autocompleteArray.push("See more.."); 1183 } 1184 1185 response(autocompleteArray); 1186 }); 1187 } 1188 }, 1189 minLength: 1, 1190 select: function (e, ui) { 1191 1192 if (ui.item.value != "See more..") { 1193 selectedStartLocation = ui.item.value; 1194 1195 $.each(autoLocationData, function(i, v) { 1196 if (v.properties.label == selectedStartLocation) { 1197 selectedStartCoords = v.geometry.coordinates; 1198 return; 1199 } 1200 }); 1201 } else { 1202 setTimeout(function () { 1203 var e = jQuery.Event("keypress"); 1204 e.which = 13; 1205 e.keyCode = 13; 1206 $('#startLocation').trigger(e); 1207 }, 0); 1208 1209 return false; 1210 } 1211 }, 1212 focus: function(event, ui) { 1213 // prevent autocomplete from updating the textbox 1214 event.preventDefault(); 1215 return false; 1216 } 1217 }); 1218 $('#startLocation').on('keypress', function(e){ 1219 if (e.which == 13) { 1220 e.preventDefault(); 1221 $(this).trigger('click'); 1222 } 1223 }); 1224 $('#startLocation').keypress(function (e) { 1225 var key = e.which; 1226 if(key == 13) // the enter key code 1227 { 1228 startLocation_useSearch = true; 1229 $('#startLocation').autocomplete("search"); 1230 } 1231 }); 1232 $('#startLocation').blur(function() { 1233 if ($('#startLocation').val() != selectedStartLocation) { 1234 $('#startLocation').val(""); 1235 selectedStartLocation = null; 1236 } 1237 }); 1238}); 1239 1240$(document).ready(function () { 1241 $('#endLocation').autocomplete({ 1242 source: function (request, response) { 1243 if (!endLocation_useSearch) { 1244 $.getJSON("https://tp.actransit.org/pelias/v1/autocomplete?api_key=&focus.point.lat=45.5223452&focus.point.lon=-122.6821804&boundary.rect.min_lat=37.2445&boundary.rect.min_lon=-123.2&boundary.rect.max_lat=38.5026&boundary.rect.max_lon=-121", 1245 { 1246 text: $('#endLocation').val() 1247 } 1248 ).done(function(autocompleteData) { 1249 1250 var autocompleteArray = $.map(autocompleteData.features, function (item) { 1251 return item.properties.label; 1252 }); 1253 1254 autoLocationData = autocompleteData.features; 1255 1256 if (autocompleteData.geocoding.query.text.length >= 6) { 1257 autocompleteArray.push("See more.."); 1258 } 1259 1260 response(autocompleteArray); 1261 }); 1262 } else { 1263 endLocation_useSearch = false; 1264 1265 $.getJSON("https://tp.actransit.org/pelias/v1/search?api_key=&focus.point.lat=45.5223452&focus.point.lon=-122.6821804&boundary.rect.min_lat=37.2445&boundary.rect.min_lon=-123.2&boundary.rect.max_lat=38.5026&boundary.rect.max_lon=-121", 1266 { 1267 text: $('#endLocation').val() 1268 } 1269 ).done(function(autocompleteData) { 1270 1271 var autocompleteArray = $.map(autocompleteData.features, function (item) { 1272 return item.properties.label; 1273 }); 1274 1275 autoLocationData = autocompleteData.features; 1276 1277 if (autocompleteData.geocoding.query.text.length >= 6) { 1278 autocompleteArray.push("See more.."); 1279 } 1280 1281 response(autocompleteArray); 1282 }); 1283 } 1284 }, 1285 minLength: 1, 1286 select: function (e, ui) { 1287 1288 selectedEndLocation = ui.item.value; 1289 1290 if (ui.item.value != "See more..") { 1291 $.each(autoLocationData, function(i, v) { 1292 if (v.properties.label == selectedEndLocation) { 1293 selectedEndCoords = v.geometry.coordinates; 1294 return; 1295 } 1296 }); 1297 } else { 1298 setTimeout(function () { 1299 var e = jQuery.Event("keypress"); 1300 e.which = 13; 1301 e.keyCode = 13; 1302 $('#endLocation').trigger(e); 1303 }, 0); 1304 1305 return false; 1306 } 1307 }, 1308 focus: function(event, ui) { 1309 // prevent autocomplete from updating the textbox 1310 event.preventDefault(); 1311 return false; 1312 } 1313 }); 1314 $('#endLocation').keypress(function (e) { 1315 var key = e.which; 1316 if(key == 13) // the enter key code 1317 { 1318 $('#endLocation').autocomplete("close"); 1319 endLocation_useSearch = true; 1320 $('#endLocation').autocomplete("search"); 1321 } 1322 }); 1323 $('#endLocation').blur(function() { 1324 if ($('#endLocation').val() != selectedEndLocation) { 1325 $('#endLocation').val(""); 1326 selectedEndLocation = null; 1327 } 1328 }); 1329}); 1330 1331function formatDate(date) { 1332 var m = (date.getMonth() < 10 ? "0" + (Number(date.getMonth()) + 1) : (Number(date.getMonth()) + 1)); 1333 var d = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()); 1334 var y = date.getFullYear(); 1335 return y + "-" + m + "-" + d; 1336} 1337 1338$(document).ready(function () { 1339 //trip related changes 1340 var d = new Date(jQuery.now()); 1341 var itdDate = d.getMonth() + 1 + "/" + (d.getDate()) + "/" + d.getFullYear(); 1342 //var itdTimeHour = ((d.getHours() + 11) % 12 + 1); 1343 currentHours = ((d.getHours() + 11) % 12 + 1); 1344 itdTimeHour = ("0" + currentHours).slice(-2); 1345 var itdTimeMinute = (d.getMinutes() < 10 ? '0' : '') + d.getMinutes(); 1346 var itdLPxx_TimeAMPM = (d.getHours() >= 12) ? "pm" : "am"; 1347 jQuery("#itdDate").val(itdDate); 1348 jQuery("#itdTimeHour").val(itdTimeHour); 1349 jQuery("#itdTimeMinute").val(itdTimeMinute); 1350 jQuery("#itdLPxx_TimeAMPM").val(itdLPxx_TimeAMPM); 1351 1352 //trip planner changes 1353$("#trip-planner").click(function () { 1354 1355 //var fromPlace = $('#startLocation').val(); 1356 //var toPlace = $('#endLocation').val(); 1357 1358 //if (fromPlace == "e.g. 100 Market, Oakland") 1359 // fromPlace = ""; 1360 //if (toPlace == "e.g. Oakland Airport") 1361 // toPlace = ""; 1362 1363 var triptype = $('#triptype').val();
1364 var date = $('#itdDate').val(); 1365 var itdTimeHour = $('#itdTimeHour').val(); 1366 var itdTimeMinute = $('#itdTimeMinute').val(); 1367 var itdLPxx_TimeAMPM = $('#itdLPxx_TimeAMPM').val(); 1368 1369 //convert date format to yyyy-mm-dd-mm-yy 1370 date = formatDate(new Date(date)); 1371 1372 //convert time to 24-hour format 1373 if (itdLPxx_TimeAMPM == "pm") { 1374 if (Number(itdTimeHour) < 12) 1375 { 1376 itdTimeHour = Number(itdTimeHour) + 12; 1377 } 1378 } else { // == "am" 1379 if (Number(itdTimeHour) == 12) 1380 { 1381 itdTimeHour = "00"; 1382 } 1383 } 1384 var time = itdTimeHour + ':' + itdTimeMinute; 1385 //var time = itdTimeHour+':'+itdTimeMinute+' '+itdLPxx_TimeAMPM; 1386 1387 if (triptype == "TransitNow") { 1388 triptype = "false"; 1389 date = formatDate(new Date(jQuery.now())); 1390 time = d.getHours() + ":" + ((d.getMinutes() < 10 ? '0' : '') + d.getMinutes()); 1391 } else if (triptype == "TransitLaterDepart") { 1392 triptype = "false"; 1393 } else if (triptype == "TransitLaterArrive") { 1394 triptype = "true"; 1395 } 1396 1397 //alert("from=" + fromPlace + ", to=" + toPlace); 1398 if (selectedStartLocation == "" || selectedStartLocation == undefined) { 1399 alert('Please enter a Start address.'); 1400 return false; 1401 } else if (selectedEndLocation == "" || selectedEndLocation == undefined) { 1402 alert('Please enter an End address.'); 1403 return false; 1404 } else { 1405 var go_to_url = 'https://tp.actransit.org/#/?ui_activeSearch=bpphk2xsz&ui_activeItinerary=0&fromPlace=' + encodeURIComponent(selectedStartLocation) + '::' + selectedStartCoords[1] + ',' + selectedStartCoords[0] + '&toPlace=' + encodeURIComponent(selectedEndLocation) + '::' + selectedEndCoords[1] + ',' + selectedEndCoords[0] + '&date=' + date + '&time=' + time + '&arriveBy=' + triptype + '&mode=WALK,BUS,TRAM,RAIL,FERRY&showIntermediateStops=true&maxWalkDistance=1207&optimize=QUICK&walkSpeed=1.34&ignoreRealtimeUpdates=true&companies='; 1406 /* 1407 $('#hiddenStartLocation').val(selectedStartLocation); 1408 $('#hiddenStartCoords').val(selectedStartCoords); 1409 $('#hiddenEndLocation').val(selectedEndLocation); 1410 $('#hiddenEndCoords').val(selectedEndCoords); 1411 */ 1412 window.location.href = go_to_url; 1413 } 1414 }); 1415 /* 1416 $("#trip-planner").click(function () { 1417 var fromPlace = $('#startLocation').val(); 1418 var toPlace = $('#endLocation').val(); 1419 1420 if (fromPlace == "e.g. 100 Market, Oakland") 1421 fromPlace = ""; 1422 if (toPlace == "e.g. Oakland Airport") 1423 toPlace = ""; 1424 1425 var triptype = $('#triptype').val(); 1426 var date = $('#itdDate').val(); 1427 var itdTimeHour = $('#itdTimeHour').val(); 1428 var itdTimeMinute = $('#itdTimeMinute').val(); 1429 var itdLPxx_TimeAMPM = $('#itdLPxx_TimeAMPM').val(); 1430 1431 //convert date format to yyyy-mm-dd-mm-yy 1432 date = formatDate(new Date(date)); 1433 1434 //convert time to 24-hour format 1435 if (itdLPxx_TimeAMPM == "pm") { 1436 if (Number(itdTimeHour) < 12) 1437 { 1438 itdTimeHour = Number(itdTimeHour) + 12; 1439 } 1440 } else { // == "am" 1441 if (Number(itdTimeHour) == 12) 1442 { 1443 itdTimeHour = "00"; 1444 } 1445 } 1446 var time = itdTimeHour + ':' + itdTimeMinute; 1447 //var time = itdTimeHour+':'+itdTimeMinute+' '+itdLPxx_TimeAMPM; 1448 1449 if (triptype == "TransitNow") { 1450 triptype = "false"; 1451 date = formatDate(new Date(jQuery.now())); 1452 time = d.getHours() + ":" + ((d.getMinutes() < 10 ? '0' : '') + d.getMinutes()); 1453 } else if (triptype == "TransitLaterDepart") { 1454 triptype = "false"; 1455 } else if (triptype == "TransitLaterArrive") { 1456 triptype = "true"; 1457 } 1458 1459 //alert("from=" + fromPlace + ", to=" + toPlace); 1460 if (fromPlace == "") { 1461 alert('Please enter a Start address.'); 1462 return false; 1463 } else if (toPlace == "") { 1464 alert('Please enter an End address.'); 1465 return false; 1466 } else { 1467 1468 var fromLabel; 1469 var fromCoord; 1470 var fromLat; 1471 var fromLong; 1472 var toLabel; 1473 var toCoord; 1474 var toLat; 1475 var toLong; 1476 1477 $.when( 1478 $.getJSON('https://tp.actransit.org/pelias/v1/autocomplete', { 1479 api_key: "", 1480 text: fromPlace 1481 }), 1482 $.getJSON('https://tp.actransit.org/pelias/v1/autocomplete', { 1483 api_key: "", 1484 text: toPlace 1485 }) 1486 ).done(function(fromResult, toResult) { 1487 if (fromResult[0].features[0]) { 1488 fromLabel = fromResult[0].features[0].properties.label; 1489 fromCoord = fromResult[0].features[0].geometry.coordinates; 1490 fromLat = fromResult[0].features[0].geometry.coordinates[1]; 1491 fromLong = fromResult[0].features[0].geometry.coordinates[0]; 1492 } 1493 1494 if (toResult[0].features[0]) { 1495 toLabel = toResult[0].features[0].properties.label; 1496 toCoord = toResult[0].features[0].geometry.coordinates; 1497 toLat = toResult[0].features[0].geometry.coordinates[1]; 1498 toLong = toResult[0].features[0].geometry.coordinates[0]; 1499 } 1500 1501 if (fromLabel && toLabel) { 1502 var go_to_url = 'https://tp.actransit.org/#/?ui_activeSearch=bpphk2xsz&ui_activeItinerary=0&fromPlace=' + fromLabel + '::' + fromLat + ',' + fromLong + '&toPlace=' + toLabel + '::' + toLat + ',' + toLong + '&date=' + date + '&time=' + time + '&arriveBy=' + triptype + '&mode=WALK,BUS,TRAM,RAIL,FERRY&showIntermediateStops=true&maxWalkDistance=1207&optimize=QUICK&walkSpeed=1.34&ignoreRealtimeUpdates=true&companies='; 1503 window.location.href = go_to_url; 1504 } else { 1505 if (!fromLabel && !toLabel) { 1506 $.when( 1507 $.getJSON('https://tp.actransit.org/pelias/v1/search', { 1508 api_key: "", 1509 text: fromPlace 1510 }), 1511 $.getJSON('https://tp.actransit.org/pelias/v1/search', { 1512 api_key: "", 1513 text: toPlace 1514 }) 1515 ).done(function(fromResult, toResult) { 1516 if (fromResult[0].features[0]) { 1517 fromLabel = fromResult[0].features[0].properties.label; 1518 fromCoord = fromResult[0].features[0].geometry.coordinates; 1519 fromLat = fromResult[0].features[0].geometry.coordinates[1]; 1520 fromLong = fromResult[0].features[0].geometry.coordinates[0]; 1521 } 1522 1523 if (toResult[0].features[0]) { 1524 toLabel = toResult[0].features[0].properties.label; 1525 toCoord = toResult[0].features[0].geometry.coordinates; 1526 toLat = toResult[0].features[0].geometry.coordinates[1]; 1527 toLong = toResult[0].features[0].geometry.coordinates[0]; 1528 } 1529 1530 if (!fromLabel && !toLabel) { 1531 alert('Start and End addresses are not valid.'); 1532 return false;
1533 } 1534 else if (!fromLabel) { 1535 alert('Start address is not valid.'); 1536 return false; 1537 } 1538 else if (!toLabel) { 1539 alert('End address is not valid.'); 1540 return false; 1541 } else { 1542 var go_to_url = 'https://tp.actransit.org/#/?ui_activeSearch=bpphk2xsz&ui_activeItinerary=0&fromPlace=' + fromLabel + '::' + fromLat + ',' + fromLong + '&toPlace=' + toLabel + '::' + toLat + ',' + toLong + '&date=' + date + '&time=' + time + '&arriveBy=' + triptype + '&mode=WALK,BUS,TRAM,RAIL,FERRY&showIntermediateStops=true&maxWalkDistance=1207&optimize=QUICK&walkSpeed=1.34&ignoreRealtimeUpdates=true&companies='; 1543 window.location.href = go_to_url; 1544 } 1545 }); 1546 } 1547 else if (!fromLabel) { 1548 $.getJSON('https://tp.actransit.org/pelias/v1/search', { 1549 api_key: "", 1550 text: fromPlace 1551 }).done(function (fromResult) { 1552 if (fromResult.features[0]) { 1553 fromLabel = fromResult.features[0].properties.label; 1554 fromCoord = fromResult.features[0].geometry.coordinates; 1555 fromLat = fromResult.features[0].geometry.coordinates[1]; 1556 fromLong = fromResult.features[0].geometry.coordinates[0]; 1557 1558 var go_to_url = 'https://tp.actransit.org/#/?ui_activeSearch=bpphk2xsz&ui_activeItinerary=0&fromPlace=' + fromLabel + '::' + fromLat + ',' + fromLong + '&toPlace=' + toLabel + '::' + toLat + ',' + toLong + '&date=' + date + '&time=' + time + '&arriveBy=' + triptype + '&mode=WALK,BUS,TRAM,RAIL,FERRY&showIntermediateStops=true&maxWalkDistance=1207&optimize=QUICK&walkSpeed=1.34&ignoreRealtimeUpdates=true&companies='; 1559 window.location.href = go_to_url; 1560 1561 } else { 1562 alert('Start address is not valid.'); 1563 return false; 1564 } 1565 }); 1566 1567 } 1568 else { // !toLabel 1569 $.getJSON('https://tp.actransit.org/pelias/v1/search', { 1570 api_key: "", 1571 text: toPlace 1572 }).done(function (toResult) { 1573 if (toResult.features[0]) { 1574 toLabel = toResult.features[0].properties.label; 1575 toCoord = toResult.features[0].geometry.coordinates; 1576 toLat = toResult.features[0].geometry.coordinates[1]; 1577 toLong = toResult.features[0].geometry.coordinates[0]; 1578 1579 var go_to_url = 'https://tp.actransit.org/#/?ui_activeSearch=bpphk2xsz&ui_activeItinerary=0&fromPlace=' + fromLabel + '::' + fromLat + ',' + fromLong + '&toPlace=' + toLabel + '::' + toLat + ',' + toLong + '&date=' + date + '&time=' + time + '&arriveBy=' + triptype + '&mode=WALK,BUS,TRAM,RAIL,FERRY&showIntermediateStops=true&maxWalkDistance=1207&optimize=QUICK&walkSpeed=1.34&ignoreRealtimeUpdates=true&companies='; 1580 window.location.href = go_to_url; 1581 } else { 1582 alert('End address is not valid.'); 1583 return false; 1584 } 1585 }); 1586 } 1587 } 1588 }); 1589 1590 } 1591 });*/ 1592 1593 function GetCoordinates(place) { 1594 $.getJSON('https://tp.actransit.org/pelias/v1/autocomplete', { 1595 api_key: "", 1596 text: place 1597 }).done(function (data) { 1598 // console.log(data); 1599 //getResult(data.features.properties.label, data.features[0].geometry.coordinates); 1600 label = data.features[0].properties.label; 1601 coord = data.features[0].geometry.coordinates; 1602 fromLabel = label; 1603 1604 //return data; 1605 return { 1606 label: label, 1607 coord: coord 1608 }; 1609 }); 1610 } 1611 //media slideshow 1612 //$('<div class="navigation"><a id="prev2" href="#"><i class="fa fa-angle-left" aria-hidden="true"></i></a> <a id="next2" href="#"><i class="fa fa-angle-right" aria-hidden="true"></i></a></div>' ).insertAfter( ".image-media-slideshow" ); 1613 //$('.image-media-slideshow').cycle({fx:'scrollHorz',next:'#next2',prev:'#prev2',rev: 0}); 1614 1615 $('.wp-block-gallery.slideshow ul').wrap('<div class="image-media-slideshow" data-fx="scrollHorz" data-speed=500 />').contents().unwrap(); 1616 $('.wp-block-gallery.slideshow li').wrap('<div class="views-item"/>').contents().unwrap(); 1617 $('.wp-block-gallery.slideshow').prepend('<div class="controls navigation"><a id="prev" href="#"><i class="fa fa-angle-left" aria-hidden="true"></i></a><a id="next" href="#"><i class="fa fa-angle-right" aria-hidden="true"></i></a></div>'); 1618 1619 $('.image-media-slideshow').each(function () { 1620 var cycle = $(this), 1621 controls = cycle.parent().find('.controls'), 1622 fx = cycle.data('fx'),
1623 speed = cycle.data('speed') || 200; 1624 1625 cycle.cycle({ 1626 rev: 0, 1627 speed: speed, 1628 fx: fx, 1629 next: controls.find('#next'), 1630 prev: controls.find('#prev'), 1631 1632 slideResize: 0, 1633 caption: cycle.parent().find('div.caption'), 1634 before: function (curr, next, opts) { 1635 opts.caption.html($(next).attr('title')); 1636 } 1637 1638 }); 1639 }); 1640 1641 //media slideshow ends 1642 $('#show').click(function (e) { 1643 e.preventDefault(); 1644 $('.divs-to-show-hide').siblings('.mapDetials').slideUp(10, function () { 1645 $('.divs-to-show-hide').slideDown('slow', function () { 1646 $('body, html').animate({ 1647 scrollTop: $('.divs-to-show-hide').offset().top 1648 }, 300) 1649 }) 1650 }); 1651 }); 1652 1653 $('#show1').click(function (e) { 1654 e.preventDefault(); 1655 $('.divs-to-show-hide1').siblings('.mapDetials').slideUp(10, function () { 1656 $('.divs-to-show-hide1').slideDown('slow', function () { 1657 $('body, html').animate({ 1658 scrollTop: $('.divs-to-show-hide1').offset().top 1659 }, 300) 1660 }) 1661 }); 1662 }); 1663 1664 $('#show2').click(function (e) { 1665 e.preventDefault(); 1666 $('.divs-to-show-hide2').siblings('.mapDetials').slideUp(10, function () { 1667 $('.divs-to-show-hide2').slideDown('slow', function () { 1668 $('body, html').animate({ 1669 scrollTop: $('.divs-to-show-hide2').offset().top 1670 }, 300) 1671 }) 1672 }); 1673 }); 1674 1675 $('#show3').click(function (e) { 1676 e.preventDefault(); 1677 $('.divs-to-show-hide3').siblings('.mapDetials').slideUp(10, function () { 1678 $('.divs-to-show-hide3').slideDown('slow', function () { 1679 $('body, html').animate({ 1680 scrollTop: $('.divs-to-show-hide3').offset().top 1681 }, 300) 1682 }) 1683 }); 1684 }); 1685 1686 $('#show4').click(function (e) { 1687 e.preventDefault(); 1688 $('.divs-to-show-hide4').siblings('.mapDetials').slideUp(10, function () { 1689 $('.divs-to-show-hide4').slideDown('slow', function () { 1690 $('body, html').animate({ 1691 scrollTop: $('.divs-to-show-hide4').offset().top 1692 }, 300) 1693 }) 1694 }); 1695 }); 1696 $('img[usemap]').rwdImageMaps(); 1697 $('.map-wards').maphilight({ 1698 strokeColor: 'd2232a', 1699 strokeWidth: 5, 1700 fill: '000000', 1701 fillColor: '000000', 1702 alwaysOn: false 1703 }); 1704 //submit button double click 1705 $('#webform-submission-reasonable-accommodation-appeals-node-482-add-form,#webform-submission-reasonable-accommodation-modific-node-482-add-form').submit(function () { 1706 $("input[type='submit']", this) 1707 .val("Please Wait...") 1708 .attr('disabled', 'disabled'); 1709 return true; 1710 }); 1711 $('.page-node-206 .footer #block-footerrideact h4').each(function(){ 1712 $(this).replaceWith('<h3>' + $(this).html() + '</h3>'); 1713 }); 1714 //cancel events 1715 function cancelEventsRefresh() { 1716 $("#search-and-results-form #edit-submit").mousedown(); 1717 } 1718 // Call the function initially 1719 cancelEventsRefresh(); 1720 // Set interval to call the function every 5 minutes 1721 setInterval(cancelEventsRefresh, 5 * 60 * 1000); // 5 minutes = 5 * 60 seconds * 1000 milliseconds 1722 1723}); 1724 1725$(document).ready(function () { 1726 if ($(window).width() < 992) { 1727 1728 $('#block-tempomenu > ul > li> a').click(function(event) { 1729 event.preventDefault(); 1730 $(this).parent().find("ul").slideToggle(); 1731 $(this).parent().siblings('li').find('ul').slideUp("fast"); 1732 1733}); 1734 } 1735 if (jQuery(window).width() < 767 ) { 1736 if($('.advgb-tabs-panel').length>0){ 1737 var stickyNavTop = $('.advgb-tabs-panel').offset().top - 50 ; 1738 } 1739 var stickyNav = function(){ 1740 var scrollTop = $(window).scrollTop(); 1741 if (scrollTop > stickyNavTop) { 1742 $('.advgb-tabs-panel').addClass('subnav_sticky'); 1743 } else { 1744 $('.advgb-tabs-panel').removeClass('subnav_sticky'); 1745 } 1746 }; 1747 stickyNav(); 1748 $(window).scroll(function() { 1749 stickyNav(); 1750 }); 1751 setTimeout(function () { 1752 $(".advgb-tabs-panel li a").click(function(e) { 1753 $('html, body').animate({ 1754 scrollTop: $(".advgb-tab-body-wrapper").offset().top -190 1755 }, 300); 1756 }); 1757 }, 1000); 1758 1759 } 1760 1761 window.onload=function() { 1762 $('header .navbar-nav li a[href=""]').each(function () { 1763 $(this).attr('href', 'javascript:void(0);'); 1764 }); 1765 } 1766 1767}); 1768//stop 1769 1770$(document).ready(function () { 1771 if ($("body.path-stop").length) { 1772 var title = $('#stop-page-title').text(); 1773 $('.path-stop .top_page_title h1').text(title); 1774 } 1775}); 1776$(document).ready(function() { 1777 if ($("body.path-stop").length) { 1778 $('.news_det p').each(function() { 1779 // Find any URLs starting with 'https://' 1780 var urlRegex = /(https:\/\/[^\s]+)/g; 1781 var content = $(this).html(); 1782 1783 // Replace the URL with an anchor tag containing the same URL 1784 var updatedContent = content.replace(urlRegex, function(url) { 1785 return '<a href="' + url + '" target="_blank">' + url + '</a>'; 1786 }); 1787
1788 // Update the paragraph's content with the anchor-wrapped URL 1789 $(this).html(updatedContent); 1790 }); 1791 1792 var selectDiv = $( 1793 '<div class="js-form-item form-item js-form-type-select form-item-line-select js-form-item-line-select">' + 1794 '<label for="edit-line-select">Select Line</label>' + 1795 '<select id="cmbRoutes" class="form-control"></select>' + 1796 '</div><div class="trips-direction"><label class="control-label pull-right" for="cboDirections">Direction:</label><select id="cboDirections" class="form-control notranslate"><option value="">-Select-</option></select></div><div class="trip-direction-stop d-none"><label class="control-label pull-right" for="cboStops">Stops :</label><select id="cboStops" class="form-control notranslate"><option value="">-Select-</option></select></div><button id="btnShowStops" style="display:none;" class="btn btn-primary" title="Draw the stops for the selected trips path on the map">Show Stops</button>' 1797 ); 1798 $('.stop-stopmap-container #custom_actransit_mapbox').before(selectDiv); 1799 $('.stop-stopmap-container #cmbRoutes').prepend('<option value="" selected>-Select-</option>'); 1800 $('.all-routes').each(function() { 1801 var routeValue = $(this).text().trim(); 1802 $('.stop-stopmap-container #cmbRoutes').append('<option value="' + routeValue + '">' + routeValue + '</option>'); 1803 }); 1804} 1805 }); 1806 1807// (function() { 1808// let isProcessing = false; 1809 1810// function processPredictions() { 1811// if (isProcessing || !jQuery('.stop-pre').length) return; 1812// isProcessing = true; 1813 1814// try { 1815// jQuery('.stop-pre').not('.favorites-list .stop-pre').each(function() { 1816// const stopPre = jQuery(this); 1817 1818// // Array to preserve insertion order 1819// let linesData = []; 1820 1821// stopPre.find('h3').each(function() { 1822// const lineEl = jQuery(this); 1823// const lineText = lineEl.text().trim(); 1824// const destEl = lineEl.next('h4'); 1825// const destText = destEl.text().trim(); 1826// const predsContainer = destEl.next('.predictionsNearbyContainer'); 1827// const predsBlock = predsContainer.find('.predictionsNearby'); 1828 1829// const key = lineText + '|' + destText; 1830// let existing = linesData.find(item => item.key === key); 1831 1832// if (!existing) { 1833// existing = { 1834// key: key, 1835// line: lineText, 1836// destination: destText, 1837// predictions: [] 1838// }; 1839// linesData.push(existing); 1840// } 1841 1842// // Add all prediction HTML 1843// predsBlock.find('.predict_time').each(function() { 1844// const $a = jQuery(this).closest('a'); 1845// existing.predictions.push($a.prop('outerHTML')); 1846// }); 1847 1848// // Remove original elements 1849// lineEl.remove(); 1850// destEl.remove(); 1851// predsContainer.remove(); 1852// }); 1853 1854// // Rebuild stop-pre with sorted predictions 1855// stopPre.empty(); 1856 1857// linesData.forEach(function(data) { 1858// let $preds = jQuery(data.predictions.join('')); 1859 1860// // Sort predictions by first span (minutes) 1861// $preds.sort(function(a, b) { 1862// const timeA = parseInt(jQuery(a).find('span').first().text(), 10); 1863// const timeB = parseInt(jQuery(b).find('span').first().text(), 10); 1864// return timeA - timeB; 1865// }); 1866 1867// // Assign count_0, count_1, ... after sorting 1868// $preds.each(function(index) { 1869// jQuery(this).find('.predict_time').attr('class', 'predict_time count_' + index); 1870// }); 1871 1872// let sortedHTML = ''; 1873// $preds.each(function() { 1874// sortedHTML += jQuery(this).prop('outerHTML'); 1875// }); 1876 1877// stopPre.append( 1878// '<h3><b>Line: </b>' + data.line.replace(/^Line:\s*/i, '') + '</h3>' + 1879// '<h4>' + data.destination + '</h4>' + 1880// '<div class="predictionsNearbyContainer"><div class="predictionsNearby">' + 1881// sortedHTML + 1882// '</div></div>' 1883// ); 1884// }); 1885// }); 1886// } finally { 1887// isProcessing = false;
1888// } 1889// } 1890 1891// // Watch for any new predictions 1892// const observer = new MutationObserver(function() { 1893// setTimeout(processPredictions, 50); // slight delay ensures content is loaded 1894// }); 1895 1896// jQuery(document).ready(function() { 1897// const stopList = document.getElementById('divStopList'); 1898// if (stopList) { 1899// observer.observe(stopList, { childList: true, subtree: true }); 1900// } 1901 1902// // Initial sort 1903// setTimeout(processPredictions, 50); 1904// }); 1905 1906// jQuery(document).ajaxComplete(function() { 1907// setTimeout(processPredictions, 50); 1908// }); 1909// })(); 1910 1911 1912 1913 //stop 1914 1915 jQuery(document).ready(function ($) { 1916 if ($('h4.count-zero').length) { 1917 // Hide the map 1918 $('#custom_actransit_mapbox').hide(); 1919 1920 // Insert message above the map 1921 $('<div class="map-unavailable text-center"><h4 style="margin-top: 20px;">Preview map unavailable.</h4></div>') 1922 .insertBefore('#custom_actransit_mapbox'); 1923 } 1924}); 1925 1926// ADA 1927(function ($) { 1928 1929 function replaceElementTag(el, newTagName) { 1930 if (!el || !el.parentNode) { 1931 return null; 1932 } 1933 var tag = (el.tagName || '').toLowerCase(); 1934 if (tag === newTagName) { 1935 return el; 1936 } 1937 var newEl = el.ownerDocument.createElement(newTagName); 1938 Array.prototype.slice.call(el.attributes).forEach(function (attr) { 1939 try { 1940 newEl.setAttribute(attr.name, attr.value); 1941 } catch (e) {} 1942 }); 1943 while (el.firstChild) { 1944 newEl.appendChild(el.firstChild); 1945 } 1946 el.parentNode.replaceChild(newEl, el); 1947 return newEl; 1948 } 1949 1950 /** 1951 * Gutenberg expanding-grid saves as ul.links / li.teamInner; swap to divs at runtime 1952 * (matches theme CSS). Deferred on first paint so expanding-grid-fixes.js runs first. 1953 */ 1954 function convertExpandingGridListsToDivs(context) { 1955 var $grids = $(); 1956 if (context && context.nodeType === 1) { 1957 $grids = $(context).find('.expanding-grid').addBack('.expanding-grid'); 1958 } else { 1959 $grids = $('.expanding-grid'); 1960 } 1961 $grids.each(function () { 1962 // Direct child is ul.links (saved markup) or div.links (ul already converted). 1963 // li.teamInner are often inside .newRow (wrapAll runs in an earlier ready handler), 1964 // so we must use find(), not children(). 1965 $(this).children('ul.links, div.links').each(function () { 1966 var container = this; 1967 var tag = (container.tagName || '').toLowerCase(); 1968 $(container).find('li.teamInner').each(function () { 1969 replaceElementTag(this, 'div'); 1970 }); 1971 if (tag === 'ul') { 1972 replaceElementTag(container, 'div'); 1973 } 1974 }); 1975 }); 1976 } 1977 1978 /** 1979 * Inside Gutenberg media+text content, replace font-size utility paragraphs with divs 1980 * (same classes; avoids inappropriate <p> semantics in that layout). 1981 */ 1982 function convertMediaTextContentParagraphsToDivs(context) { 1983 var $content = $(); 1984 if (context && context.nodeType === 1) { 1985 var $ctx = $(context); 1986 $content = $ctx.find('.wp-block-media-text__content').addBack('.wp-block-media-text__content'); 1987 } else { 1988 $content = $('.wp-block-media-text__content'); 1989 } 1990 $content.each(function () { 1991 $(this) 1992 .find('p.has-large-font-size, p.has-normal-font-size') 1993 .each(function () { 1994 replaceElementTag(this, 'div'); 1995 }); 1996 }); 1997 } 1998 1999function fixLinks(context) { 2000 $('a', context).each(function () { 2001 var $link = $(this); 2002 var href = ($link.attr('href') || '').toLowerCase(); 2003 var isSocialLink = $link.closest('.social_media, .social').length > 0; 2004 2005 // Footer social icons: one canonical accessible name per platform + decorative <img> 2006 // (avoids aria-label vs img alt mismatch: "x" vs "X", "youtube" vs "YouTube"). WCAG 3.2.4. 2007 if (isSocialLink) { 2008 var platform = null; 2009 if (href.indexOf('instagram.com') !== -1) { 2010 platform = 'Instagram'; 2011 } else if (href.indexOf('twitter.com') !== -1 || href.indexOf('x.com') !== -1) { 2012 platform = 'X'; 2013 } else if (href.indexOf('youtube.com') !== -1 || href.indexOf('youtu.be') !== -1) { 2014 platform = 'YouTube'; 2015 } else if (href.indexOf('facebook.com') !== -1) { 2016 platform = 'Facebook'; 2017 } else if (href.indexOf('linkedin.com') !== -1) { 2018 platform = 'LinkedIn'; 2019 } else if (href.indexOf('threads.net') !== -1) { 2020 platform = 'Threads'; 2021 } else if (href.indexOf('bsky.app') !== -1) { 2022 platform = 'Bluesky'; 2023 } 2024 if (platform) { 2025 $link.attr('aria-label', platform); 2026 $link.attr('title', platform); 2027 $link.find('img').each(function () { 2028 this.setAttribute('alt', ''); 2029 }); 2030 return; 2031 } 2032 } 2033 2034 // Site logo / home: name comes from the link, not the logo image (WCAG 3.2.4). 2035 if ($link.is('.navbar-brand')) { 2036 var homeAria = $.trim($link.attr('aria-label') || ''); 2037 var homeTitle = $.trim($link.attr('title') || ''); 2038 if (/^home$/i.test(homeAria)) { 2039 homeAria = 'Home'; 2040 } 2041 if (/^home$/i.test(homeTitle)) { 2042 homeTitle = 'Home'; 2043 } 2044 if (homeAria) { 2045 $link.attr('aria-label', homeAria); 2046 } 2047 if (homeTitle) { 2048 $link.attr('title', homeTitle); 2049 } 2050 $link.find('img').each(function () { 2051 this.setAttribute('alt', ''); 2052 }); 2053 return; 2054 } 2055 2056 var visibleText = $.trim( 2057 $link 2058 .clone() // copy link 2059 .find('img') // remove images so alt is separate 2060 .remove() 2061 .end() 2062 .text() 2063 ); 2064 2065 var $img = $link.find('img'); 2066 var imgAlt = $.trim($img.attr('alt') || ''); 2067 var title = $.trim($link.attr('title') || ''); 2068 var aria = $.trim($link.attr('aria-label') || ''); 2069 var normalizedVisibleText = visibleText.toLowerCase(); 2070 var normalizedImgAlt = imgAlt.toLowerCase(); 2071 var normalizedTitle = title.toLowerCase(); 2072 2073 // If link has visible text, don't force aria-label. 2074 // Let the accessible name come from the visible text to avoid 2075 // "text in element not included in accessible name" errors. 2076 if (visibleText.length) { 2077 if (aria) { 2078 $link.removeAttr('aria-label'); 2079 } 2080 return; 2081 } 2082 2083 var newAria = ''; 2084 2085 if ( 2086 imgAlt.length && 2087 !newAria.toLowerCase().includes(normalizedImgAlt) 2088 ) { 2089 newAria += (newAria.length ? ', ' : '') + imgAlt; 2090 } else if ( 2091 title.length && 2092 !newAria.toLowerCase().includes(normalizedTitle) 2093 ) { 2094 newAria += (newAria.length ? ', ' : '') + title; 2095 } 2096 2097 if (newAria.length && aria !== newAria) { 2098 $link.attr('aria-label', newAria); 2099 } 2100 }); 2101} 2102 2103 function fixIframeTitle(context) { 2104 $('iframe, frame', context).each(function () { 2105 var $frame = $(this); 2106 var title = $.trim($frame.attr('title') || ''); 2107 if (!title) { 2108 var src = $frame.attr('src') || ''; 2109 if (src) { 2110 $frame.attr('title', 'Embedded content'); 2111 } else { 2112 $frame.attr('title', 'Embedded content'); 2113 } 2114 } 2115 }); 2116 } 2117 2118 $(document).ready(function () { 2119 // Run on initial page load 2120 fixLinks(document); 2121 fixIframeTitle(document); 2122 2123 function runExpandingGridFixes() { 2124 convertExpandingGridListsToDivs(document); 2125 convertMediaTextContentParagraphsToDivs(document); 2126 } 2127 2128 setTimeout(runExpandingGridFixes, 0); 2129 $(window).on('load', runExpandingGridFixes); 2130 setTimeout(runExpandingGridFixes, 600); 2131 2132 // Observe DOM changes dynamically 2133 var observer = new MutationObserver(function (mutations) { 2134 mutations.forEach(function (mutation) { 2135 $(mutation.addedNodes).each(function () { 2136 if (this.nodeType === 1) { 2137 fixLinks(this); 2138 fixIframeTitle(this); 2139 convertExpandingGridListsToDivs(this); 2140 convertMediaTextContentParagraphsToDivs(this); 2141 } 2142 }); 2143 }); 2144 }); 2145 2146 observer.observe(document.body, { 2147 childList: true, 2148 subtree: true 2149 }); 2150 }); 2151 2152})(jQuery); 2153 2154(function($){ 2155 function insertHiddenHeadings(context){ 2156 var lastLevel = 0; 2157 2158 $(context).find('h1, h2, h3, h4, h5, h6').each(function(){ 2159 var $h = $(this); 2160 var currentLevel = parseInt(this.tagName.replace('H',''), 10); 2161 2162 if(lastLevel && currentLevel > lastLevel + 1){ 2163 // Insert hidden heading to fill the gap 2164 for(var lvl = lastLevel + 1; lvl < currentLevel; lvl++){ 2165 $h.before('<h'+lvl+' class="visually-hidden">
2165Hidden heading for ADA</h'+lvl+'>'); 2166 } 2167 } 2168 2169 lastLevel = currentLevel; 2170 }); 2171 } 2172 2173 // WCAG 2.1.1: Make scrollable wp-block-table figures keyboard accessible 2174 function makeScrollableTablesKeyboardAccessible(context){ 2175 $('figure.wp-block-table', context).each(function(){ 2176 var $figure = $(this); 2177 var figure = this; 2178 if(figure.scrollWidth > figure.clientWidth || figure.scrollHeight > figure.clientHeight){ 2179 if(!$figure.attr('tabindex')){ 2180 $figure.attr('tabindex', '0'); 2181 } 2182 } 2183 }); 2184 } 2185 2186 $(document).ready(function(){ 2187 insertHiddenHeadings(document); 2188 makeScrollableTablesKeyboardAccessible(document); 2189 2190 // Unique observer variable 2191 var headingObserver = new MutationObserver(function(mutations){ 2192 mutations.forEach(function(mutation){ 2193 $(mutation.addedNodes).each(function(){ 2194 if(this.nodeType === 1){ 2195 insertHiddenHeadings(this); 2196 makeScrollableTablesKeyboardAccessible(this); 2197 } 2198 }); 2199 }); 2200 }); 2201 2202 headingObserver.observe(document.body, {childList: true, subtree:true}); 2203 }); 2204 2205})(jQuery); 2206// (function($){ 2207// function addClassToTables(context){ 2208// $('figure.wp-block-table table', context).each(function(){ 2209// var $table = $(this); 2210// // Add a class only if it's not already set 2211// if(!$table.hasClass('gutenberg-table')){ 2212// $table.addClass('gutenberg-table'); 2213// } 2214// }); 2215// } 2216 2217// $(document).ready(function(){ 2218// // Run on initial page load 2219// addClassToTables(document); 2220 2221// // Observe DOM changes (for dynamically loaded tables) 2222// var tableObserver = new MutationObserver(function(mutations){ 2223// mutations.forEach(function(mutation){ 2224// $(mutation.addedNodes).each(function(){ 2225// if(this.nodeType === 1){ 2226// addClassToTables(this); 2227// } 2228// }); 2229// }); 2230// }); 2231 2232// tableObserver.observe(document.body, { childList: true, subtree: true }); 2233// }); 2234 2235// })(jQuery); 2236 2237(function ($) { 2238 $(document).ready(function () { 2239 2240 function applyAccessibleNames(scope) { 2241 $(scope).find('a').each(function () { 2242 2243 var $anchorTag = $(this); 2244 2245 // Skip if already has accessible name 2246 if ( 2247 $anchorTag.text().trim().length > 0 || 2248 $anchorTag.attr('aria-label') || 2249 $anchorTag.attr('title') 2250 ) { 2251 return; 2252 } 2253 2254 // Check for image alt 2255 var $imgTag = $anchorTag.find('img'); 2256 if ($imgTag.length && $imgTag.attr('alt')) { 2257 $anchorTag.attr('aria-label', $imgTag.attr('alt')); 2258 return; 2259 } 2260 2261 // Fallback using href 2262 var linkPath = $anchorTag.attr('href'); 2263 if (linkPath) { 2264 var cleanText = linkPath.replace(/\/|-/g, ' ').trim(); 2265 $anchorTag.attr('aria-label', cleanText); 2266 } else { 2267 $anchorTag.attr('aria-label', 'Read more'); 2268 } 2269 2270 }); 2271 } 2272 2273 // Initial run 2274 applyAccessibleNames(document); 2275 2276 // Mutation Observer 2277 var domWatcher = new MutationObserver(function (mutationRecords) { 2278 mutationRecords.forEach(function (mutationItem) { 2279 2280 mutationItem.addedNodes.forEach(function (newNode) { 2281 2282 if (newNode.nodeType === 1) { // Element node 2283 applyAccessibleNames(newNode); 2284 } 2285 2286 }); 2287 2288 }); 2289 }); 2290 2291 domWatcher.observe(document.body, { 2292 childList: true, 2293 subtree: true 2294 }); 2295 2296 }); 2297})(jQuery);
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.