1//*-*-*-*-*-*-*-*-*-*-*-* 2// START OF DOM READY 3//*-*-*-*-*-*-*-*-*-*-*-* 4$(document).ready(function () { 5 $("p").unorphanize(); 6 7 checkCookies(); 8 9 //cookie button 10 $(document).on("click", ".cookieButton a", function (e) { 11 e.preventDefault(); 12 $(".cookieBar").removeClass("show"); 13 createCookie("cookiecookie", "on", 30); 14 }); 15 16 if ($(".votePopup").length) { 17 checkPopup("votePopup"); 18 } else { 19 checkPopup("signupOverlay"); 20 } 21 22 var $grid = $(".galleryContainer").imagesLoaded(function () { 23 // init Isotope after all images have loaded 24 $grid.isotope({ 25 itemSelector: ".galleryImage", 26 percentPosition: true, 27 }); 28 }); 29 30 $(".homeSlider").slick({ 31 dots: false, 32 arrows: false, 33 autoplay: true, 34 autoplaySpeed: 3000, 35 pauseOnHover: false, 36 infinite: true, 37 speed: 1000, 38 fade: true, 39 cssEase: "linear", 40 }); 41 42 $(".backgroundSlider").slick({ 43 dots: true, 44 arrows: true, 45 prevArrow: 46 '<button type="button" class="slick-prev"><img src="../images/icons/arrow-left.png" /></button>', 47 nextArrow: 48 '<button type="button" class="slick-next"><img src="../images/icons/arrow-right.png" /></button>', 49 autoplay: true, 50 autoplaySpeed: 3000, 51 pauseOnHover: false, 52 infinite: true, 53 speed: 1000, 54 fade: true, 55 cssEase: "linear", 56 }); 57 58 $(".eventSlider").slick({ 59 infinite: false, 60 slidesToShow: 4, 61 slidesToScroll: 1, 62 dots: false, 63 arrows: true, 64 prevArrow: 65 '<button type="button" class="slick-prev"><img src="../images/icons/arrow-left.png" /></button>', 66 nextArrow: 67 '<button type="button" class="slick-next"><img src="../images/icons/arrow-right.png" /></button>', 68 responsive: [ 69 { 70 breakpoint: 1140, 71 settings: { 72 slidesToShow: 2, 73 slidesToScroll: 1, 74 }, 75 }, 76 { 77 breakpoint: 840, 78 settings: { 79 slidesToShow: 1, 80 slidesToScroll: 1, 81 }, 82 }, 83 ], 84 }); 85 86 $(document).on("click", ".loadMore", function (e) { 87 e.preventDefault(); 88 var limit = parseInt($(this).attr("data-id")); 89 //console.log(limit); 90 var newLimit = limit + 12; 91 //console.log(newLimit); 92 $.ajax({
93 url: "/php/ajax/loadMoreBlogArticles.php?limit=" + limit, 94 type: "GET", 95 success: function (data) { 96 if (data != "") { 97 var $items = $(data); 98 $(".loadMore").html("loading..."); 99 $items.imagesLoaded(function () { 100 //$grid.append($items).isotope('appended', $items); 101 $(".blogGrid").append($items); 102 $(".loadMore") 103 .delay(1000) 104 .html("Load More Stories") 105 .attr("data-id", newLimit); 106 }); 107 } else { 108 $(".loadMore").html("The End").delay(500).fadeOut(1000); 109 } 110 }, 111 }); 112 }); 113 114 $(document).on("click", ".loadMoreEvents", function (e) { 115 e.preventDefault(); 116 var limit = parseInt($(this).attr("data-id")); 117 //console.log(limit); 118 var newLimit = limit + 12; 119 //console.log(newLimit); 120 $.ajax({ 121 url: "/php/ajax/loadMoreEvents.php?limit=" + limit, 122 type: "GET", 123 success: function (data) { 124 if (data != "") { 125 var $items = $(data); 126 $(".loadMoreEvents").html("loading..."); 127 $items.imagesLoaded(function () { 128 //$grid.append($items).isotope('appended', $items); 129 $(".blogGrid.futureEvents").append($items); 130 $(".loadMoreEvents") 131 .delay(1000) 132 .html("Load More Events") 133 .attr("data-id", newLimit); 134 }); 135 } else { 136 $(".loadMoreEvents").html("The End").delay(500).fadeOut(1000); 137 } 138 }, 139 }); 140 }); 141 142 $(document).on("click", ".loadMoreHistoricEvents", function (e) { 143 e.preventDefault(); 144 var limit = parseInt($(this).attr("data-id")); 145 //console.log(limit); 146 var newLimit = limit + 12; 147 //console.log(newLimit); 148 $.ajax({
149 url: "/php/ajax/loadMoreHistoricEvents.php?limit=" + limit, 150 type: "GET", 151 success: function (data) { 152 if (data != "") { 153 var $items = $(data); 154 $(".loadMoreHistoricEvents").html("loading..."); 155 $items.imagesLoaded(function () { 156 //$grid.append($items).isotope('appended', $items); 157 $(".blogGrid.historicEvents").append($items); 158 $(".loadMoreHistoricEvents") 159 .delay(1000) 160 .html("Load More Events") 161 .attr("data-id", newLimit); 162 }); 163 } else { 164 $(".loadMoreHistoricEvents").html("The End").delay(500).fadeOut(1000); 165 } 166 }, 167 }); 168 }); 169 170 //Signup 171 $(document).on("submit", "#popupSignupForm", function (e) { 172 e.preventDefault(); 173 doValidate("#popupSignupForm"); 174 175 if ($(this).valid()) { 176 $("#popupSignupForm button").html("Signing up..."); 177 $("#popupSignupForm button").prop("disabled", true); 178 $.ajax({ 179 url: "/php/ajax/sendSignupForm.php", 180 type: "POST", 181 data: $(this).serialize(true), 182 success: function (data) { 183 gtag("event", "Click Submit Button", { 184 event_category: "Popup Signup Form Submission", 185 event_label: "Popup Signup Form Submission", 186 }); 187 $(".subscribeResponse").html(data); 188 $(".subscribeResponse").fadeIn(500, function () { 189 //$(this).delay(4000).fadeOut(1500, function(){ 190 //$('#popupSignupForm').trigger("reset"); 191 $("#popupSignupForm input").blur(); 192 $("#popupSignupForm .inputField").removeClass("error"); 193 //}); 194 }); 195 //console.log(data); 196 $("#popupSignupForm button").css("display", "none"); 197 $(".subscribeResponse").addClass("success"); 198 $(".subscribeResponse").html( 199 "Thanks for signing up. Please check your inbox and confirm your subscription.", 200 ); 201 //$('#popupSignupForm button').html('Thanks'); 202 createCookie("signupOverlayCookie", "on", 9999); 203 }, 204 }); 205 } else { 206 $(".subscribeResponse").html( 207 "Please enter a valid email and accept our terms.", 208 ); 209 $(".subscribeResponse").fadeIn(500); 210 } 211 }); 212 213 // OVERLAY NAV 214 $(document).on("click", ".openMenu, .closeMenu, .bodyOverlay", function (e) { 215 e.preventDefault(); 216 toggleNav(); 217 }); 218 219 $(document).on("click", ".openSignupOnly", function (e) { 220 e.preventDefault(); 221 openPopup("signupOverlay"); 222 }); 223 224 $(document).on("click", ".openSignupFromMenu", function (e) { 225 e.preventDefault(); 226 toggleNav(); 227 openPopup("signupOverlay"); 228 }); 229 230 $(document).on("click", ".openVoteFromMenu", function (e) { 231 e.preventDefault(); 232 toggleNav(); 233 openPopup("votePopup"); 234 }); 235 236 /*$(document).on('click','.closeSignup',function(e){ 237 e.preventDefault(); 238 $('.signupOverlay').removeClass('open'); 239 //$('.menuToggle').removeClass('light'); 240 createCookie('signupOverlayCookie','on',2); 241 }); 242 243 $(document).on('click','.signupOverlay',function(e){ 244 if($(e.target).hasClass('signupOverlay')){ 245 //close popup and then set cookie 246 $('.signupOverlay').removeClass('open'); 247 createCookie('signupOverlayCookie','on',2); 248 } 249 });*/ 250 251 $(document).on("click", ".closePopup", function (e) { 252 e.preventDefault(); 253 closePopup(); 254 }); 255 256 $(document).on("click", ".popupOverlay", function (e) { 257 if ($(e.target).hasClass("popupOverlay")) { 258 closePopup(); 259 } 260 }); 261 262 //Contact 263 $(document).on("submit", "#enquiry_form_holder form", function (e) { 264 e.preventDefault(); 265 266 doValidate(".homeContact form"); 267
268 if ($(this).valid()) { 269 $(".homeContact form button").html("Submitting enquiry..."); 270 $(".homeContact form button").prop("disabled", true); 271 $.ajax({ 272 url: "/php/ajax/sendContactForm.php", 273 type: "POST", 274 data: $(this).serialize(true), 275 success: function (data) { 276 gtag("event", "Click Submit Button", { 277 event_category: "Enquiry Form Submission", 278 event_label: "Enquiry Form Submission", 279 }); 280 $("#contact_response").html(data); 281 $("#contact_response") 282 .fadeIn(500, function () { 283 $(".homeContact form button").html("Enquiry sent"); 284 }) 285 .addClass("active"); 286 }, 287 }); 288 } else { 289 $("#contact_response").html( 290 "Please enter all of the required information and accept our Privacy Policy.", 291 ); 292 $("#contact_response").fadeIn(500); 293 } 294 }); 295 296 //Event form 297 $(document).on("submit", "#event_form_holder form", function (e) { 298 e.preventDefault(); 299 300 doValidate(".eventForm form"); 301
302 if ($(this).valid()) { 303 $(".eventForm form button").html("Submitting enquiry..."); 304 $(".eventForm form button").prop("disabled", true); 305 $.ajax({ 306 url: "/php/ajax/sendEventForm.php", 307 type: "POST", 308 data: $(this).serialize(true), 309 success: function (data) { 310 gtag("event", "Click Submit Button", { 311 event_category: "Event Form Submission", 312 event_label: "Event Form Submission", 313 }); 314 $("#event_response").html(data); 315 $("#event_response").fadeIn(500, function () { 316 $(".eventForm form button").html("Enquiry sent"); 317 }); 318 }, 319 }); 320 } else { 321 $("#event_response").html( 322 "Please enter all of the required information and accept our Privacy Policy.", 323 ); 324 $("#event_response").fadeIn(500); 325 } 326 }); 327 328 //Terms 329 $(document).on("submit", ".termsForm", function (e) { 330 e.preventDefault(); 331 doValidate(".termsForm"); 332 if ($(this).valid()) { 333 $.ajax({
334 url: "/php/ajax/sendTermsForm.php", 335 type: "POST", 336 data: $(this).serialize(true), 337 success: function (data) { 338 gtag("event", "Click Submit Button", { 339 event_category: "Terms Form Submission", 340 event_label: "Terms Form Submission", 341 }); 342 $("#terms_response").html(data); 343 $("#terms_response").fadeIn(500); 344 $(".termsForm").trigger("reset"); 345 $("#signature").html(" "); 346 $(".termsForm .inputField").removeClass("error"); 347 }, 348 }); 349 } else { 350 $("#terms_response").html( 351 "Please enter all of the required information.", 352 ); 353 $("#terms_response").fadeIn(500); 354 } 355 }); 356 357 //COVID Form 358 $(document).on("submit", ".covidForm", function (e) { 359 e.preventDefault(); 360 doValidate(".covidForm"); 361 if ($(this).valid()) { 362 $.ajax({ 363 url: "/php/ajax/sendCovidForm.php", 364 type: "POST", 365 data: $(this).serialize(true), 366 success: function (data) { 367 gtag("event", "Click Submit Button", { 368 event_category: "Terms Form Submission", 369 event_label: "Terms Form Submission", 370 }); 371 $("#terms_response").html(data); 372 $("#terms_response").fadeIn(500); 373 $(".covidForm").trigger("reset"); 374 $("#signature").html(" "); 375 $(".covidForm .inputField").removeClass("error"); 376 }, 377 }); 378 } else { 379 $("#terms_response").html( 380 "Please enter all of the required information.", 381 ); 382 $("#terms_response").fadeIn(500); 383 } 384 }); 385 386 $(".oneHouse.left").hover( 387 function () { 388 $(".houseText.left").removeClass("active"); 389 $(".houseText.right").addClass("active"); 390 }, 391 function () { 392 $(".houseText").removeClass("active"); 393 }, 394 ); 395 396 $(".oneHouse.right").hover( 397 function () { 398 $(".houseText.right").removeClass("active"); 399 $(".houseText.left").addClass("active"); 400 }, 401 function () { 402 $(".houseText").removeClass("active"); 403 }, 404 ); 405 406 $(document).on("click", ".oneHouse a.continue", function (e) { 407 e.preventDefault(); 408 $(".chooseHouseScreen").addClass("hide"); 409 setTimeout(function () { 410 $(".chooseHouseScreen").addClass("remove"); 411 $("body").removeClass("noscroll"); 412 //set cookie 413 }, 800); 414 }); 415 416 /*if ($("#instafeed").length) { 417 var instantTokenApiUrl = 418 "https://ig.instant-tokens.com/users/26bfe6a3-e646-4de0-8f1c-ad3567209055/instagram/27754843977517516/token?userSecret=rm8mw3i8mhc3rakk7adta"; 419 420 $.ajax({
421 url: instantTokenApiUrl, 422 dataType: "json", 423 }).done(function (response) { 424 if (!response.Token) { 425 console.log("Error fetching token :: ", response); 426 } else if (typeof Instafeed === "undefined") { 427 console.error("Instafeed library is missing or failed to load."); 428 } else { 429 var feed = new Instafeed({ 430 accessToken: response.Token, 431 target: "instafeed", 432 limit: 6, 433 template: 434 '<div class="instagramHolder">' + 435 '<a href="{{link}}" target="_blank" rel="noreferrer" class="font0">' + 436 '<div class="instagramPic" style="background-image: url({{image}});"></div>' + 437 "Instagram image" + 438 "</a>" + 439 "</div>", 440 transform: function (item) { 441 item.image = item.media_url; 442 item.link = item.permalink; 443 return item; 444 }, 445 }); 446 feed.run(); 447 } 448 }); 449 }*/ 450 451 if ($("#instafeed").length) { 452 // The Url from your Authorisations list 453 var instantTokenApiUrl = 454 "https://ig.instant-tokens.com/users/26bfe6a3-e646-4de0-8f1c-ad3567209055/instagram/27754843977517516/token?userSecret=euc5amov09l92ovd55g2dk"; 455 456 $.ajax({
457 url: instantTokenApiUrl, 458 dataType: "json", 459 }) 460 .done(function (response) { 461 var token = response.Token || response.token; 462 463 if (!token) { 464 console.log("Error :: ", response); 465 } else { 466 var feed = new Instafeed({ 467 target: "instafeed", 468 accessToken: token, // Used in Instafeed v1.x 469 token: token, // Used in Instafeed v2.x 470 limit: 6, 471 template: 472 '<div class="instagramHolder" id="pic_{{id}}">' + 473 '<a href="{{link}}" target="_blank" rel="noreferrer" class="font0">' + 474 '<img class="instagramPic" src="{{image}}" alt="{{caption}}" />' + 475 "{{caption}}" + 476 "</a>" + 477 "</div>", 478 }); 479 feed.run(); 480 } 481 }) 482 .fail(function (error) { 483 console.log("AJAX Error :: ", error); 484 }); 485 } 486 487 /*if ($(".instagramHolder").length) { 488 var feed = new Instafeed({ 489 get: "user", 490 userId: "6639709478", 491 clientId: "e6b106b8f26a49aabeb6b1bd89102890", 492 accessToken: "6639709478.1677ed0.1c783bb840f04e2aae7a287564ee6cb8", 493 sortBy: "most-recent",
494 limit: "6", 495 mock: true, 496 success: function (data) { 497 var images = data.data; 498 // images is an array of pictures 499 var i = 0; 500 $(".instagramPic").each(function () { 501 $(this).parent().attr("href", images[i].link); 502 $(this) 503 .parent() 504 .css( 505 "background-image", 506 "url(" + images[i].images.standard_resolution.url + ")", 507 ); 508 i++; 509 }); 510 }, 511 }); 512 feed.run(); 513 514 new InstagramFeed({ 515 username: "themowbray", 516 container: document.getElementById("instafeed"), 517 display_profile: false, 518 display_biography: false, 519 display_gallery: true, 520 display_igtv: false, 521 callback: null, 522 styling: false, 523 items: 6, 524 host: 525 "https://images" + 526 ~~(Math.random() * 3333) + 527 "-focus-opensocial.googleusercontent.com/gadgets/proxy?container=none&url=https://www.instagram.com/", 528 cache_time: 660, 529 max_tries: 1, 530 }); 531 }*/ 532 533 //accordion id's for cache 534 var count = 1; 535 $("button.accordion").each(function (e) { 536 $(this).attr("id", "accordion_" + count); 537 count++; 538 }); 539 540 $(document).on("click", ".accordion", function (e) { 541 var acc = $(this); 542 var panel = acc.next(".panel"); 543 var h = panel.children(".inner").outerHeight(); 544 var wW = $(window).width(); 545 546 //console.log(h); 547 548 /*if(!acc.hasClass('active') && $('.accordion.active').length){ 549 $('.accordion.active').removeClass('active'); 550 $('.panel').css('max-height',0); 551 }*/ 552 553 acc.toggleClass("active"); 554 555 //if on article page, recalc sticky cols 556 if ($(".articlePage").length) { 557 setTimeout(function () { 558 $(".articleText").trigger("sticky_kit:recalc"); 559 $(".articleImages").trigger("sticky_kit:recalc"); 560 }, 1); 561 } 562 563 if (acc.hasClass("active")) { 564 panel.css("max-height", h); 565 if (wW > 1000) { 566 setTimeout(function () { 567 $("html, body").animate( 568 { 569 scrollTop: acc.offset().top - 80, 570 }, 571 300, 572 ); 573 }, 210); 574 } 575 } else { 576 panel.css("max-height", 0); 577 } 578 }); 579 580 $(".homeContact #event").on("input change", function () { 581 // Safely get and format the value 582 var value = ($(this).val() || "").trim(); 583 // Matches any of these keywords (the 'i' flag makes it case-insensitive) 584 var isMatch = 585 /wedding|engagement|marriage|wed(?:ding)?|matrimony|nuptial/i.test(value); 586 var details = $(".weddingDetails"); 587 588 if (isMatch) { 589 // set max-height to the real content height so it animates in step with the opacity fade 590 details.addClass("active"); 591 } else { 592 details.removeClass("active").css("max-height", 0); 593 // reset inputs 594 //details.find("input, textarea").val(""); 595 } 596 }); 597}); 598//*-*-*-*-*-*-*-*-*-*-*-* 599// END OF DOM READY 600//*-*-*-*-*-*-*-*-*-*-*-* 601 602$(window).on("load", function () { 603 var wW = $(window).width(); 604 605 if (document.location.href.indexOf("/signup") > -1) { 606 openPopup("signupOverlay"); 607 } 608 609 $(".loadLater").each(function (e) { 610 var img = $(this); 611 if (wW > 760) { 612 var src = img.data("src"); 613 } else { 614 var src = img.data("mobile-src"); 615 } 616 img.attr("src", src); 617 }); 618 619 /*if(document.location.href.indexOf('/enquiries') > -1){ 620 var pos = $('div#enquiries').offset().top; 621 pos = pos - 20; 622 $('html, body').animate({ 623 scrollTop: pos 624 }, 650); 625 }*/ 626 627 if (wW > 1000) { 628 $(".articleImages").stick_in_parent({ 629 offset_top: 80, 630 }); 631 $(".articleText").stick_in_parent({ 632 offset_top: 80, 633 }); 634 } 635 636 if ($(".mapSection").length) { 637 loadScript(); 638 } 639}); 640 641$(window).on("load", function () { 642 var hash = location.hash.replace("#", ""); 643 if (hash == "book-your-place") { 644 var pos = $("#event_form_holder").offset().top - 60; 645 $("html, body").animate( 646 { 647 scrollTop: pos, 648 }, 649 650, 650 ); 651 } 652}); 653 654$(window).on("resize, orientationchange", function () {}); 655 656$(window).on("load resize orientationchange touchmove scroll", function () { 657 scrollHero(); 658}); 659 660$(window).on("load scroll", function () { 661 var windowBottom = $(this).scrollTop() + $(this).innerHeight(); 662 $(".appear").each(function () { 663 var current = $(this); 664 var divTop = current.offset().top + 200; 665 if (divTop < windowBottom) { 666 current.addClass("animate"); 667 } 668 }); 669 670 if ($(".pageContainer").length) { 671 var windowTop = $(this).scrollTop(); 672 var navTop = $(".pageContainer").offset().top; 673 674 if (navTop < windowTop) { 675 $("nav").removeClass("nav-gradient"); 676 $("nav").addClass("sticky"); 677 } else { 678 $("nav").removeClass("sticky"); 679 } 680 } 681}); 682 683function scrollHero() { 684 var id = 1; 685 $(".movingPic").each(function () { 686 $(this).attr("id", "hero_" + id); 687 688 var el = $("#hero_" + id), 689 elTop = el.offset().top, 690 scrollTop = $(window).scrollTop(), 691 wH = $(window).height(), 692 pos = scrollTop + wH, 693 speed, 694 elOff = elTop + wH + el.height(), 695 elDiff; 696 wW = $(window).width(); 697 698 if (pos >= elTop && pos <= elOff) { 699 elDiff = (scrollTop - elTop + wH) / ((wW / wH) * 20) + 20; 700 if (elDiff >= 100) { 701 elDiff = 100; 702 } else if (elDiff <= 20) { 703 elDiff = 20; 704 } 705 el.css("background-position", "center " + elDiff + "%"); 706 } 707 708 id++; 709 }); 710} 711 712function toggleNav() { 713 var nav = $(".overlayNav"); 714 var body = $("body"); 715 nav.toggleClass("open"); 716 if ($(window).width() < 760) { 717 body.toggleClass("noscroll"); 718 } 719 if (nav.hasClass("open")) { 720 setTimeout(function () { 721 nav.addClass("scrolly"); 722 }, 800); 723 } else { 724 setTimeout(function () { 725 nav.removeClass("scrolly"); 726 }, 800); 727 } 728 //body.toggleClass('noscroll'); 729} 730 731function openPopup(type) { 732 if ($(".popupOverlay." + type).length) { 733 $(".popupOverlay." + type).addClass("open"); 734 $(".menuToggle").addClass("light"); 735 } 736} 737 738function checkPopup(type) { 739 setTimeout(function () { 740 var cookieState = readCookie(type + "Cookie"); 741 if (cookieState != "on") { 742 openPopup(type); 743 } 744 }, 15000); 745} 746 747/*function openSignup(){ 748 if($('.signupOverlay.signupPopup').length){ 749 $('.signupOverlay.signupPopup').addClass('open'); 750 $('.menuToggle').addClass('light'); 751 } 752} 753 754function checkPopupSignup(){ 755 setTimeout(function(){ 756 var cookieState = readCookie('signupOverlayCookie'); 757 if (cookieState != 'on') { 758 openSignup(); 759 } 760 }, 5000); 761}*/ 762 763function closePopup() { 764 if ($(".popupOverlay.open").hasClass("signupOverlay")) { 765 createCookie("signupOverlayCookie", "on", 2); 766 } else if ($(".popupOverlay.open").hasClass("votePopup")) { 767 createCookie("votePopupCookie", "on", 2); 768 } 769 $(".popupOverlay").removeClass("open"); 770} 771
772function writeSig() { 773 $("#signature").html(" " + $("#full_name").val()); 774 if ($("#full_name").val() == "") { 775 $("#signature").html(" "); 776 } 777} 778 779function doValidate(theForm) { 780 $(theForm).validate({ 781 rules: { 782 name: { 783 required: true, 784 }, 785 email: { 786 email: true, 787 required: true, 788 }, 789 event: { 790 required: true, 791 }, 792 guests: { 793 required: true, 794 }, 795 message: { 796 required: true, 797 }, 798 event_date: { 799 required: true, 800 }, 801 date: { 802 required: true, 803 }, 804 full_name: { 805 required: true, 806 }, 807 terms_box: { 808 required: true, 809 }, 810 signup_terms_box: { 811 required: true, 812 }, 813 health_check: { 814 required: true, 815 }, 816 disclaimer_check: { 817 required: true, 818 }, 819 }, 820 821 //If error 822 highlight: function (label) { 823 $(label).addClass("error"); 824 $(label).removeClass("valid"); 825 return false; 826 }, 827 828 //If success 829 success: function (label) { 830 $(label).removeClass("error"); 831 $(label).addClass("valid"); 832 }, 833 errorPlacement: function (error, element) { 834 // error.insertAfter(element); 835 }, 836 }); // End validation 837} 838 839function loadScript() { 840 var script = document.createElement("script"); 841 script.type = "text/javascript"; 842 script.src = 843 "https://maps.googleapis.com/maps/api/js?key=AIzaSyAyti1zM6FvXSovacGBa6kKm-pegFAs6y8&callback=initialize"; 844 document.body.appendChild(script); 845} 846 847function initialize() { 848 var map; 849 850 var location1 = new google.maps.LatLng(53.390529, -1.474); //The Mowbray 851 var image1 = new google.maps.MarkerImage( 852 "/images/icons/TM_Marker.png", 853 null, 854 null, 855 null, 856 new google.maps.Size(60, 73), 857 ); 858 859 var location2 = new google.maps.LatLng(53.38924, -1.47198); //chimney house 860 var image2 = new google.maps.MarkerImage( 861 "/images/icons/CH_Marker.png", 862 null, 863 null, 864 null, 865 new google.maps.Size(60, 73), 866 ); 867 868 var location3 = new google.maps.LatLng(53.391999, -1.473); //victoria 869 var image3 = new google.maps.MarkerImage( 870 "/images/icons/V_Marker-5.webp", 871 null, 872 null, 873 null, 874 new google.maps.Size(60, 73), 875 ); 876 877 var locations = [ 878 ["Total Car Parks", 53.39024171, -1.46804023, 1], 879 ["Bridge Street Car Park", 53.3865622, -1.4678015, 2], 880 ["Millsands Car Park - Q Park", 53.3869453, -1.46681, 3], 881 ["Workhouse Lane Car Park", 53.38578963, -1.46970704, 4], 882 ["Acorn Street Car Park", 53.3880057, -1.4751874, 5], 883 ["Trinity Street Car Park", 53.3870771, -1.4740233, 6], 884 ]; 885 886 var isDraggable = $(document).width() > 760 ? true : false; 887 888 var stylez = [ 889 { 890 featureType: "landscape.man_made", 891 elementType: "geometry", 892 stylers: [ 893 { 894 color: "#f8f8f4", 895 }, 896 ], 897 }, 898 { 899 featureType: "landscape.natural", 900 stylers: [ 901 { 902 color: "#f8f8f4", 903 }, 904 ], 905 }, 906 { 907 featureType: "landscape.natural.landcover", 908 stylers: [ 909 { 910 color: "#f8f8f4", 911 }, 912 ], 913 }, 914 { 915 featureType: "landscape.natural.terrain", 916 elementType: "geometry", 917 stylers: [ 918 { 919 color: "#f8f8f4", 920 }, 921 ], 922 }, 923 { 924 featureType: "poi.park", 925 stylers: [ 926 { 927 color: "#ccf1c8", 928 }, 929 ], 930 }, 931 { 932 featureType: "water", 933 stylers: [ 934 { 935 color: "#dbecf4", 936 }, 937 ], 938 }, 939 ]; 940 941 var mapOptions = { 942 zoom: 15, 943 center: location1, 944 scrollwheel: false, 945 draggable: isDraggable, 946 styles: stylez, 947 }; 948 949 map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); 950 951 var marker, i, image; 952 953 for (i = 0; i < locations.length; i++) { 954 if (i == 0) { 955 image = new google.maps.MarkerImage( 956 "/images/icons/p.png", 957 null, 958 null, 959 null, 960 new google.maps.Size(25, 25), 961 ); 962 url = 963 "https://www.google.com/maps/place/Total+Car+Parks+Ltd/@53.3902421,-1.4702357,17z/data=!3m1!4b1!4m5!3m4!1s0x4879787b0eeca587:0xc4b2daefaa39af61!8m2!3d53.3902389!4d-1.4680417"; 964 } else if (i == 1) { 965 image = new google.maps.MarkerImage( 966 "/images/icons/p.png", 967 null, 968 null, 969 null, 970 new google.maps.Size(25, 25), 971 ); 972 url = 973 "https://www.google.com/maps/place/Rcp+Parking/@53.386563,-1.46835,19z/data=!3m1!4b1!4m5!3m4!1s0x4879787bc6477021:0xbdc0b5670fb5ee83!8m2!3d53.3865622!4d-1.4678015"; 974 } else if (i == 2) { 975 image = new google.maps.MarkerImage( 976 "/images/icons/p.png", 977 null, 978 null, 979 null, 980 new google.maps.Size(25, 25), 981 ); 982 url = 983 "https://www.google.com/maps/place/Q-Park+Riverside/@53.3869485,-1.469004,17z/data=!3m1!4b1!4m5!3m4!1s0x4879787980612599:0x84dfa1a58f6eb7a0!8m2!3d53.3869453!4d-1.46681"; 984 } else if (i == 3) { 985 image = new google.maps.MarkerImage( 986 "/images/icons/p.png", 987 null, 988 null, 989 null, 990 new google.maps.Size(25, 25), 991 ); 992 url = 993 "https://www.google.com/maps/place/Workhouse+Lane/@53.3857896,-1.4719007,17z/data=!3m1!4b1!4m5!3m4!1s0x487978794bfdeca9:0x786fe11fff7f2fc!8m2!3d53.3857864!4d-1.4697067"; 994 } else if (i == 4) { 995 image = new google.maps.MarkerImage( 996 "/images/icons/p.png", 997 null, 998 null, 999 null, 1000 new google.maps.Size(25, 25), 1001 ); 1002 url = 1003 "https://www.google.com/maps/place/Ebenezer+St.+Car+Park/@53.3880065,-1.4757346,19z/data=!3m1!4b1!4m5!3m4!1s0x4879787dea136819:0x68d39861c60f7635!8m2!3d53.3880056!4d-1.4751875"; 1004 } else if (i == 5) { 1005 image = new google.maps.MarkerImage( 1006 "/images/icons/p.png", 1007 null, 1008 null, 1009 null, 1010 new google.maps.Size(25, 25), 1011 ); 1012 url = 1013 "https://www.google.com/maps/place/Trinity+Street+Car+Par/@53.3870803,-1.4762173,17z/data=!3m1!4b1!4m5!3m4!1s0x4879787dd656cc67:0x56f0e84f71021978!8m2!3d53.3870771!4d-1.4740233"; 1014 } 1015 1016 marker = new google.maps.Marker({ 1017 position: new google.maps.LatLng(locations[i][1], locations[i][2]), 1018 map: map, 1019 icon: image, 1020 url: url, 1021 });
1022 1023 google.maps.event.addListener(marker, "click", function () { 1024 window.location.href = this.url; 1025 }); 1026 } 1027 1028 marker = new google.maps.Marker({ 1029 position: location1, 1030 map: map, 1031 icon: image1, 1032 }); 1033 1034 marker = new google.maps.Marker({ 1035 position: location2, 1036 map: map, 1037 icon: image2, 1038 }); 1039 1040 marker = new google.maps.Marker({ 1041 position: location3, 1042 map: map, 1043 icon: image3, 1044 }); 1045 1046 setTimeout(function () { 1047 //console.log($('.mapHolder img').length); 1048 $(".mapHolder img").attr("alt", "Google Map Control"); 1049 }, 1000); 1050} 1051 1052//cookies 1053function checkCookies() { 1054 var cookieState = readCookie("cookiecookie"); 1055 if (cookieState != "on") { 1056 $(".cookieBar").addClass("show"); 1057 } else { 1058 $(".cookieBar").removeClass("show"); 1059 } 1060} 1061 1062function createCookie(name, value, days) { 1063 if (days) { 1064 var date = new Date(); 1065 date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); 1066 var expires = "; expires=" + date.toGMTString(); 1067 } else var expires = ""; 1068 document.cookie = name + "=" + value + expires + "; path=/"; 1069} 1070 1071function readCookie(name) { 1072 var nameEQ = name + "="; 1073 var ca = document.cookie.split(";"); 1074 for (var i = 0; i < ca.length; i++) { 1075 var c = ca[i]; 1076 while (c.charAt(0) == " ") c = c.substring(1, c.length); 1077 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); 1078 } 1079 return null; 1080} 1081 1082function eraseCookie(name) { 1083 createCookie(name, "", -1); 1084}
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.