1jQuery(function(){ 2 $ = jQuery 3 4 // Video Lightboxes 5 var tag = document.createElement('script'); 6 7 var images = []; 8 var current = 0; 9 $(".thrive-video-trigger").click(function() { 10 $("#easter-egg-gallery").css("display", "none"); 11 $("#youtubePlayer").css("display", "none"); 12 $("#easter-egg-brightcove-aspect,#easter-egg-brightcove,#thriveVimeo-aspect").css("display","none"); 13 if ($(this).hasClass("gallery")) { 14 $("#easter-egg-gallery").css("display", "block"); 15 images = $(this).attr("images").split(","); 16 $("#easter-egg-gallery img").attr("src",images[0]); 17 } else if($(this).hasClass("youtube")) { 18 $("#youtubePlayer").css("display", "block"); 19 console.log("loading youtube id=" + $(this).attr("key")); 20 try { 21 youtubePlayer.loadVideoById({'videoId': $(this).attr("data-id")}); // @todo convert to data('key') 22 } catch(e) { 23 24 } 25 26 27 $("#youtubePlayer").append('<iframe id="youtube" width="640" height="360" src="//www.youtube.com/embed/'+ $(this).attr("data-id") + '?rel=0&autoplay=true" frameborder="0" allowfullscreen></iframe>'); 28 29 } else if ($(this).hasClass("vimeo")) { 30 $("#thriveVimeo-aspect").css("display","block"); 31 $("#thriveVimeo").attr("src","//player.vimeo.com/video/"+$(this).attr("data-id")+"?autoplay=true"); 32 console.log("vimeo ID: "+$(this).attr("data-id")); 33 } 34 35 modalOpen("#easter-egg"); 36 $("#easter-egg").on('modal.close', function(){ 37 $("#thriveVimeo").attr("src",""); 38 $("#youtube").remove(); 39 $(this).off('modal.close'); // stop listening for event 40 41 42 }); 43 }); 44 45 46/* MODAL TEMPLATES 47/* on all pages, the below logic handles 48/* modal popups with style... 49/********************************************************************/ 50 if (document.location.hash) { 51 var hash = document.location.hash; // includes the "#"" 52 try { 53 if ($(hash).is('.thrive-modal-entire')) { 54 // hash is a modal -> open it 55 modalOpen(hash); 56 } 57 } catch (e) { 58 console.warn('issue opening modal'); 59 } 60 } else if($(".thrive-modal-entire.autopopup").length) { 61 modalOpen("#"+$(".thrive-modal-entire.autopopup").first().attr("id")); 62 } 63 64 $(".thrive-modal-trigger").click(function(e) { 65 console.log("attempting to open a modal"); 66 var target = $(this).data("target"); 67 if (target == "") { 68 return; 69 } 70 71 var $modalObject = $( target ); 72 if ($modalObject.length) { 73 e.preventDefault(); 74 } 75 76 modalOpen(target,$(this)); 77 }); 78 79 80function modalClose() { 81 if($(".modal-visible").attr("id") == "easter-egg") { 82 //jwplayer("jwEaster").stop(); 83 } 84 85 console.log('modalClose'); 86 $(".thrive-modal-exit").unbind(".exitModal"); 87 $(document).unbind(".escapeModal"); 88 $("body").removeClass("modal-enabled"); 89 $("body").css("top","inherit"); 90 91 $(".modal-visible").removeClass("modal-visible").trigger("modal.close"); 92} 93 94function modalOpen(target,trigger) { 95 96 var oldScrollTop = $(window).scrollTop(); 97 98 console.log('modalOpen', target); 99 $(".thrive-modal-entire.modal-visible").removeClass("modal-visible"); 100 $("body").addClass("modal-enabled"); 101 $("body").css("top","-"+oldScrollTop+"px"); 102 103 $(target).addClass("modal-visible"); 104 setTimeout(function() { 105 $(target).find('input[type=text],input[type=email]').first().focus(); 106 },400); 107 $(document).bind( "keyup.escapeModal", function(e) { 108 if (e.keyCode == 27) { 109 modalClose(); 110 } 111 }); 112 $(".thrive-modal-exit").bind( "click.exitModal", function(e) { 113 modalClose(); 114 }); 115 $('.thrive-modal-entire.modal-visible').on('click', function(e) { 116 if (!$(e.target).closest('.thrive-modal').length) { 117 modalClose(); 118 } 119 }); 120 $(".modal-visible").trigger("modal.open",trigger); 121 122 $(".modal-visible").on("modal.close",function() { 123 $(".modal-visible").off("modal.close"); 124 $(window).scrollTop(oldScrollTop); 125 }); 126 127} 128 129// @deprecated 130function manuallyOpenLightbox(modalId) { 131 console.warn('manuallyOpenLightbox is deprecated'); 132 modalOpen('#'+modalId); 133} 134 135function thriveVideo(target,url,autoplay) { 136 if(!autoplay) { 137 autoplay = false; 138 } 139 140} 141 142 143 // ADD CUSTOM JS HERE 144 145 146});
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.