1 2jQuery(document).ready(function($) { 3 4 $('.ytp-share-icon').click(function () { 5 $(this).prev().find('.at-resp-share-element').css('z-index', '1'); 6 $(this).prev().find('.dwnld-img').css('opacity', '1'); 7 $(this).css('z-index', '-1'); 8 }); 9 $('.dwnld-img').click(function () { 10 var link = $(this).prev().attr('src'); 11 $(this).attr('href', link); 12 console.log(link); 13 }); 14 15 //$('.fundraiseup-donate').attr("href","#FUNMBQLYJZG&type=button&align=center&color=EF4044&size=45"); 16 $('.fundraiseup-donate').attr("href","#XPXJKKWF"); 17 $('form#mc-embedded-subscribe-form input#mce-zip').keydown(function (e) { 18 if (e.keyCode == 13) { 19 e.preventDefault(); 20 return false; 21 } 22 }); 23 24 $('#zipreset').on('click', function (e) { 25 e.preventDefault(); 26 $('#mce-zip').val(''); 27 $('.selectric').selectric('reset'); 28 $(this).removeClass("active"); 29 30 load_affiliates(1); 31 }); 32 33 $('#zipsrch').on('click', function (e) { 34 //e.preventDefault(); 35 checkZip(); 36 if (!$('#mce-zip').val() || isNaN($('#mce-zip').val())) { 37 $('.zip-search-box').addClass('unvalid'); 38 return; 39 } 40 41 load_affiliates(2); 42 }); 43 44 function load_affiliates(mode) { 45 46 $('.zip-search-box').removeClass('unvalid'); 47 48 var data = {}; 49 if (mode == 2) { 50 data = { zip: $('#mce-zip').val() }; 51 } 52 53 $.ajax({ 54 url: '/find-your-local-affiliate', 55 type: 'POST', 56 dataType: 'html', 57 data: data, 58 success: function (affiliatesHTML) { 59 var pos1 = affiliatesHTML.indexOf('<div id="output_states">') + 24; 60 var pos2 = affiliatesHTML.indexOf('</div><span id="end_of_node">'); 61 $('#output_states').html(affiliatesHTML.substr(pos1, pos2 - pos1)); 62 var pos3 = affiliatesHTML.indexOf('<option>JUMP TO STATE</option>'); 63 var pos4 = affiliatesHTML.indexOf('</select>', pos3); 64 $('.selectric').find('option').remove().end().append(affiliatesHTML.substr(pos3, pos4 - pos3)); 65 $('.selectric').selectric('destroy'); 66 createSelectric(); 67 linkPopupToAffiliates(); 68 } 69 }); 70 71 } 72 73 var urlNow = document.location.href; 74 75$('.field-content.hidden').each(function(){ 76 var bg = $(this).html(); 77 var hrefBtn = $(this).closest('.views-row').find('.button_read_more a').attr('href'); 78 $(this).closest('.views-row').find('.views-field-field-image > .field-content').css('position', 'relative'); 79 $(this).closest('.views-row').find('.views-field-field-image .field-content').prepend('<a href="'+hrefBtn+'" style="background:'+bg+'; height: 100%; width: 100%; position: absolute; opacity: 0.5;" ></a>'); 80 }); 81 $('.button_read_more').click(function () { 82 var titleClick = $(this).attr('data-title'); 83 console.log(titleClick); 84 if($('.fa-envelope-o').length) { 85 console.log(true); 86 } else { 87 $('#share42').append('<span><a><i class="fa fa-envelope-o"></i></a></span>'); 88 console.log(false); 89 } 90 $('#share42 span:nth-child(2) a').attr('onclick', "window.open('//twitter.com/intent/tweet?text=I%20voted%20for%20"+titleClick+"%20in%20the%20%40RebldgTogthr%20%40Cricketnation%20Connecting%20Communities%20contest%20&url="+urlNow+"', '_blank', 'scrollbars=0, resizable=1, menubar=0, left=100, top=100, width=550, height=440, toolbar=0, status=0');return false"); 91 $('#share42 span:nth-child(3) a').attr('onclick', "window.open('//www.linkedin.com/shareArticle?mini=true&url="+urlNow+"=I%20voted%20for%20"+titleClick+"%20in%20the%20%40RebldgTogthr%20%40Cricketnation%20Connecting%20Communities%20contest%20', '_blank', 'scrollbars=0, resizable=1, menubar=0, left=100, top=100, width=600, height=400, toolbar=0, status=0');return false"); 92 $('#share42 span:nth-child(4) a').attr('href', "mailto:?subject='I voted for "+titleClick+"in the Connecting Communities contest'"); 93 94 95 $('.g-recaptcha-bubble-arrow').parent().addClass('top'); 96 $('.g-recaptcha-bubble-arrow').parent().css("top", "49% !important"); 97 98 }); 99 100 linkPopupToAffiliates(); 101 102 function linkPopupToAffiliates() { 103 104 $('.open-popup-link').magnificPopup({ 105 type:'inline', 106 callbacks: { 107 beforeOpen: function() { 108 }, 109 open: function() { 110 var $popupContent = this; 111 var geocoder; 112 var map; 113 114 function initialize() { 115 116 geocoder = new google.maps.Geocoder(); 117 118 var latlng = new google.maps.LatLng(-34.397, 150.644); 119 var mapOptions = { 120 zoom: 15, 121 center: latlng 122 }; 123 124 map = new google.maps.Map(($popupContent.content.find('.city-map')[0]), mapOptions); 125 google.maps.event.addListenerOnce(map, 'idle', codeAddress); 126 } 127 128 function codeAddress() { 129 var address = $popupContent.content.find('.city-address').text(); 130 131 geocoder.geocode({ 132 'address': address 133 }, function (results, status) { 134 135 if (status == google.maps.GeocoderStatus.OK) { 136 137 map.setCenter(results[0].geometry.location); 138 139 var marker = new google.maps.Marker({ 140 map: map, 141 position: results[0].geometry.location 142 }); 143 144 } else { 145 146 alert("Geocode was not successful for the following reason: " + status); 147 } 148 }); 149 } 150 151 initialize(); 152 153 } 154 }, 155 midClick: true // Allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source in href. 156 }); 157 158 } 159 160 $('.view-projects-list .button_read_more').click(function(){ 161 $('#projecttitle').html($(this).data('title')); 162 $('input[name="projectid"]').val($(this).data('id')); 163 $('input[name="browserid"]').val(fingerprint); 164 $('input[name="name"]').val(''); 165 $('input[name="email"]').val(''); 166 $('#pop-up .inner').show(); 167 $('#pop-up .inner_thank').hide(); 168 $('#pop-up').addClass('show'); 169 }); 170 171 $('#pop-up .close').click(function(e){ 172 e.preventDefault(); 173 $('#pop-up').removeClass('show'); 174 }); 175 176 createSelectric(); 177 178 function createSelectric() { 179 180 var $selectric = $('.selectric'); 181 if($selectric.length) { 182 $selectric.selectric({ 183 onInit: function(element) { 184 }, 185 onChange: function(element) { 186 console.log(element); 187 var self = this; 188 $('html,body').animate({ 189 scrollTop: $('#'+this.options[this.selectedIndex].value).offset().top 190 },700,function(){ 191 location.hash = self.options[self.selectedIndex].value; 192 }); 193 194 }, 195 disableOnMobile: false 196 }); 197 } 198 199 } 200 201 202 function firstWordMenu() { 203 $('.dropdown-toggle').each(function() { 204 var word = $(this).html(); 205 var index = word.indexOf(' '); 206 if(index == -1) { 207 index = word.length; 208 } 209 $(this).html('<span class="first-word">' + word.substring(0, index) + '</span>' + word.substring(index, word.length)); 210 }); 211 } 212 firstWordMenu(); 213
214 function slideDropdawnToggle() { 215 216 if ($(window).width() > 921) { 217 $('ul.menu li').hover(function() { 218 var that = $(this); 219 that.find('.dropdown-menu').stop().slideDown(); 220 that.find('.caret').stop().slideDown(); 221 }, function() { 222 var that = $(this); 223 that.find('.dropdown-menu').stop().slideUp(); 224 that.find('.caret').stop().slideUp(); 225 }); 226 227 } 228 } 229 230 function showHideSearch () { 231 var wWidth = $(window).width(), 232 inpElem = $('.serch_form .form-control.form-text'); 233 234 return { 235 show : function() { 236 if (wWidth > 921) { //desktop 237 inpElem.addClass('visible').animate({ 238 width : 107 + 'px', 239 padding : '6px 12px' 240 }); 241 } else { 242 inpElem.addClass('visible').animate({ 243 width : wWidth - $('.search_btn button').outerWidth() + 'px', 244 padding : '6px 12px' 245 }); 246 } 247 }, 248 hide : function() { 249 inpElem.animate({ 250 width : 0 + 'px', 251 padding : 0 + 'px' 252 }, function() { 253 $(this).removeClass('visible'); 254 }); 255 } 256 } 257 } 258 259 var searchForm = showHideSearch(); 260 if ($(window).width() < 921) { 261 searchForm.show(); 262 } 263 function searchSubmit () { 264 var canSearch = false; 265 $('body').on('click', '.search_btn button', function(e) { 266 if ($(window).width() < 921) { 267 var inpVal = $('.serch_form input').eq(1).val(); 268 if (inpVal == '') { 269 e.preventDefault(); 270 } else { 271 return true 272 } 273 } else { 274 var inpVal = $('.serch_form input').val(); 275 if (!canSearch) { 276 e.preventDefault(); 277 278 searchForm.show(); 279 canSearch = true 280 } else if (inpVal == '') { 281 e.preventDefault(); 282 searchForm.hide(); 283 284 canSearch = false; 285 } else { 286 return true 287 } 288 } 289 290 }); 291 } 292 293 function checkActiveStory () { 294 var checkItem = $('.content'), 295 toActiveItem; 296 297 if (checkItem.hasClass('homeowner') || $('.page-archive-1').length) { 298 toActiveItem = $('.main_nav-right .navbar-nav > li.first'); 299 300 if (!toActiveItem.hasClass('active')) { 301 toActiveItem.addClass('active'); 302 } 303 } else if (checkItem.hasClass('affiliate') || $('.page-archive-2').length) { 304 toActiveItem = $('.main_nav-right .navbar-nav > li.last'); 305 if (!toActiveItem.hasClass('active')) { 306 toActiveItem.addClass('active'); 307 } 308 } else if (checkItem.hasClass('partner') || $('.page-archive-3').length) { 309 toActiveItem = $('.main_nav-right .navbar-nav > li.last'); 310 if (!toActiveItem.hasClass('active')) { 311 toActiveItem.addClass('active'); 312 } 313 } else if (checkItem.hasClass('volunteer')) { 314 toActiveItem = $('.top_nav-left ul li:eq(1)'); 315 if (!toActiveItem.hasClass('active')) { 316 toActiveItem.addClass('active') 317 .find('a').addClass('active'); 318 } 319 } 320 321 if ($('.page-archive-4').length) { 322 $('.top_nav-left .navbar-nav li:eq(1)').addClass('active') 323 .find('a').addClass('active'); 324 } 325 326 } 327 328 function stickyNav () { 329 var scrollPos = window.pageYOffset; 330 var navbar = $('#navbar'); 331 var navHeight = navbar.height(); 332 333 if ($(window).width() > 920) { 334 if (scrollPos >= navHeight) { 335 navbar.addClass('sticky'); 336 } else { 337 navbar.removeClass('sticky'); 338 } 339 } 340 } 341 342 function mobileFixForActiveMenuItem () { 343 if ($(window).width() <= 920) { 344 $('.dropdown-menu li').each(function() { 345 var that = $(this); 346 var mainColor = that.css('background-color'); 347 348 that.find('a.active').css({ 349 'background-color' : mainColor, 350 'color' : '#fff' 351 }); 352 }); 353 } 354 } 355 function back(){ 356 $('.back .back-button').on('click', function(e) { 357 e.preventDefault(e); 358 history.back(1); 359 }) 360 } 361 362 363 function movableLabel () { 364 365 var input = $('.content.container > form input, #block-system-main form input'), 366 btn = $('.content.container > form button, #block-system-main button '); 367 input.each(function () { 368 var that = $(this); 369 setTimeout(function() { 370 if (that.val() != '') { 371 that.parent('div').addClass('labelUp'); 372 } 373 }, 100); 374 }); 375 376 input.focus(function() { 377 $(this).parent('div').addClass('labelUp'); 378 }); 379 input.focusout(function() { 380 if($(this).val() == '') { 381 $(this).parent('div').removeClass('labelUp'); 382 } 383 }); 384 if(!btn.hasClass('js-do-not-do-smth-very-strange-with-movableLabel')) { 385 btn.attr('class', 'button button--wapasha back-button') 386 } 387 388 389 } 390 391 function bxSlider() { 392
393 //$('.field-items').addClass('bxslider'); 394 //$('.bx-wrapper .field-items').addClass('bxslider'); 395 396 397 398 $('.bxslider').bxSlider({ 399 slideWidth: 656, 400 responsive: true, 401 minSlides: 2, 402 maxSlides: 3, 403 pager: false, 404 infiniteLoop: true 405 }); 406 407 } 408 bxSlider(); 409 410 function bxSliderHome() { 411 $('.slider-home').bxSlider({ 412 //slideWidth: 1280, 413 preloadImages: 'all', 414 auto: true, 415 pause: 6000, 416 speed: 2000, 417 infiniteLoop: true, 418 options: 'visible', 419 minSlides: 2, 420 maxSlides: 3, 421 pager: true, 422 mode: 'fade', 423 controls: true, 424 onSliderLoad: function(){ 425 $(".home-slide-img").css("visibility", "visible"); 426 } 427 }); 428 } 429 430 function stickyArchive () { 431 if ($('.archive').length && !$('.call-to-action').length) { 432 $('.main-container').addClass('sticky_archive'); 433 } 434 if ($('.call-to-action').length && !$('.archive').length) { 435 $('.main-container').addClass('sticky_call'); 436 } 437 if ($('.call-to-action').length && $('.archive').length ) { 438 $('.main-container').addClass('sticky_booth_blocks'); 439 } 440 } 441 442 function sliderFix () { 443 var viewPort = $('.bx-viewport, .slider-home > li a'), 444 vWidth = $(window).width(); 445 446 if (vWidth < 1024) { 447 viewPort.css({ 448 'min-height' : 1/2 * vWidth, 449 'height' : 1/2 * vWidth 450 }); 451 } else { 452 viewPort.css('min-height', ''); 453 } 454 455 } 456 457 function bxSliderVideo() { 458 $('.video-slider').bxSlider({ 459 video: true, 460 responsive: true, 461 // auto: true, 462 pause: 6000, 463 speed: 2000, 464 infiniteLoop: true, 465 responsive: true, 466 options: 'visible', 467 slideWidth: 393, 468 shrinkItems: true, 469 moveSlides: 1, 470 minSlides: 1, 471 maxSlides: 3, 472 pager: true, 473 controls: false 474 }); 475 } 476 477 back(); 478 bxSliderHome(); 479 bxSliderVideo(); 480 /*ready call list*/ 481 searchSubmit(); 482 checkActiveStory(); 483 mobileFixForActiveMenuItem(); 484 movableLabel(); 485 stickyArchive(); 486 setTimeout(function() { 487 sliderFix(); 488 }, 1500); 489 490 if ($(window).width() > 920) { 491 slideDropdawnToggle(); 492 } 493 494 $(window).scroll(function() { 495 stickyNav(); 496 }); 497 498 $(window).resize(function() { 499 slideDropdawnToggle(); 500 mobileFixForActiveMenuItem(); 501 sliderFix(); 502 }); 503 504 505 /*custom checkbox (begin)*/ 506 // $('.custom-checkbox').on('change', changeCustomCheckboxBg); 507 508 509 // $('.custom-checkbox').each(changeCustomCheckboxBg); 510 511 // function changeCustomCheckboxBg() { 512 // var bgSpan = $(this).parent().find('.custom-checkbox-background'); 513 // if(this.checked) { 514 // bgSpan.addClass('active'); 515 // }else { 516 // bgSpan.removeClass('active'); 517 // } 518 // } 519 // /*custom checkbox (end)*/ 520 521 522 // // save the real open 523 // var oldOpen = XMLHttpRequest.prototype.open; 524 525 // function onStateChange(event) { 526 // var resp = JSON.parse(event.currentTarget.response); 527 // if (resp.success){ 528 // //$('#mce-success-response').html('Almost finished... We need to confirm your email address. To complete the subscription process, please click the link in the email we just sent you.').show(); 529 // $('#mce-success-response').html('You are subscribed.').show(); 530 // $('#mce-error-response').hide(); 531 // setTimeout(function() { 532 // location.href = location.origin + '/NRM'; 533 // },5000) 534 // } else { 535 // $('#mce-error-response').html('Request contained errors: "' + resp.offenders[0].err + '"').show(); 536 // $('#mce-success-response').hide(); 537 // } 538 // } 539 540 // XMLHttpRequest.prototype.open = function() { 541 // // when an XHR object is opened, add a listener for its readystatechange events 542 // this.addEventListener("loadend", onStateChange) 543 544 // // run the real `open` 545 // oldOpen.apply(this, arguments); 546 // }; 547 $('#mc-embedded-subscribe-form.local_affiliate_form').on('submit', function (e) { 548 var zipCode = $(this).find('#mce-zip').val(), 549 errorBox = $(this).find('.error_message'), 550 regexp = /^[0-9\-]{5,}$/; 551 552 if (!regexp.test(zipCode)) { 553 $(this).addClass('unvalid'); 554 e.preventDefault(); 555 $(this).find('#mce-zip').focus(); 556 return false;
557 } else { 558 $(this).removeClass('unvalid'); 559 } 560 561 }).on('keydown', function () { 562 $(this).removeClass('unvalid'); 563 }); 564 565 $('#mc-embedded-subscribe-form.local_affiliate_form [type="reset"]').on('click', function () { 566 location.href = location.href; 567 }); 568 569 $('#mc-embedded-subscribe-form').submit(function () { 570 if ( $(this).hasClass('local_affiliate_form') ) return; 571 572 var inputs = $("#mc_embed_signup_scroll input"); 573 var error = 0; 574 setTimeout(function () { 575 for(var i =0; i< inputs.length; i++){ 576 if($(inputs[i]).hasClass('mce_inline_error')){ 577 error++; 578 } 579 } 580 581 }, 2000); 582 setTimeout(function () { 583 if(error != 0){ 584 $('#mce-error-response').html('Request contained errors').show(); 585 $('#mce-success-response').hide(); 586 } 587 else if($('#mce-error-response').html() == "This email cannot be added to this list. Please enter a different email address.") { 588 $('#mce-error-response').html('Request contained errors').show(); 589 $('#mce-success-response').hide(); 590 } 591 else{
592 $('#mce-success-response').html('Thank you for subscribing!').show(); 593 $('#mce-error-response').hide(); 594 setTimeout(function() { 595 if($("#mc-embedded-subscribe-form").hasClass("volunteer-zip")) { 596 //alert("success"); 597 location.href = location.origin + '/volunteer-search-results&zip=' + $("#mce-MMERGE3").val(); 598 } else { 599 location.href = location.origin + '/'; 600 } 601 602 },500); 603 } 604 }, 2000); 605 }); 606 607 // Show/hide clear button 608 var zipInput = $('#mc_embed_signup_scroll input[type="number"]'); 609 var clearButton = $('#zipreset'); 610//var clearButton = $('#mc_embed_signup_scroll button[type="reset"]'); 611 612 $.fn.forceNumbericOnly = function() { 613 return this.each(function() 614 { 615 $(this).keydown(function(e) 616 { 617 var key = e.charCode || e.keyCode || 0; 618 return ( key == 8 || key == 9 || key == 46 ||(key >= 37 && key <= 40) ||(key >= 48 && key <= 57) ||(key >= 96 && key <= 105) || key == 107 || key == 109 || key == 173|| key == 61 ); }); 619 }); 620 }; 621 622 $(zipInput).forceNumbericOnly(); 623 624 function checkZip () { 625 if( $(zipInput).val().length === 0 ) { 626 clearButton.removeClass("active"); 627 } else if ($(zipInput).val.length !== 0) { 628 clearButton.addClass("active"); 629 } 630 } 631 632 $(zipInput).on('input', checkZip); 633 634 // $(window).on('load', function () { 635 // setTimeout(checkZip, 800); 636 // }); 637 638 $(clearButton).click(function() { 639 $(zipInput).attr("value", ""); 640 $('.zip-search-box').removeClass('unvalid'); 641 $(this).removeClass("active"); 642 }) 643}); 644 645var fingerprint = (function(window, screen, navigator) { 646 647 // https://github.com/darkskyapp/string-hash 648 function checksum(str) { 649 var hash = 5381, 650 i = str.length; 651 652 while (i--) hash = (hash * 33) ^ str.charCodeAt(i); 653 654 return hash >>> 0; 655 } 656 657 // http://stackoverflow.com/a/4167870/1250044 658 function map(arr, fn){ 659 var i = 0, len = arr.length, ret = []; 660 while(i < len){ 661 ret[i] = fn(arr[i++]); 662 } 663 return ret; 664 } 665 666 return checksum([ 667 navigator.userAgent, 668 [screen.height, screen.width, screen.colorDepth].join('x'), 669 new Date().getTimezoneOffset(), 670 !!window.sessionStorage, 671 !!window.localStorage, 672 map(navigator.plugins, function (plugin) { 673 return [ 674 plugin.name, 675 plugin.description, 676 map(plugin, function (mime) { 677 return [mime.type, mime.suffixes].join('~'); 678 }).join(',') 679 ].join("::"); 680 }).join(';') 681 ].join('###')); 682 683}(this, screen, navigator));
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.