1// site.js 2 3(function ($) { 4 5 $(document).ready(function () { 6 var wWidth = $(window).innerWidth(); 7 8 var talkative = ("SpeechSynthesisUtterance" in window); 9 10 function speak(message) { 11 if (!message || !talkative) { 12 return; 13 } 14 15 var utterance = new SpeechSynthesisUtterance(message); 16 speechSynthesis.speak(utterance); 17 } 18 19 $.speak = speak; 20 21 $.speak.talkative = talkative; 22 23 $.fn.speak = function () { 24 var message = this.val() || this.text(); 25 26 speak(message); 27 }; 28 29 var egg = new Egg("up,up,down,down,left,right,left,right,b,a", function () { 30 31 $.speak('I solemnly swear I am up to no good.'); 32 33 }).listen(); 34 35 var divMouseDown; 36 $('.services-img').mousedown(function () { 37 divMouseDown = setTimeout(function () { 38 $.speak('I solemnly swear I am up to no good.'); 39 }, 20000); 40 }); 41 $('body').mouseup(function () { 42 if (divMouseDown) { 43 clearTimeout(divMouseDown); 44 } 45 }); 46 47 $('.menu-item-559').hover(function(){ 48 console.log(wWidth); 49 if(wWidth >= 992) { 50 $('.menu-item-559 .dropdown-menu').css('display','block'); 51 $('.menu-item-559 > a').removeAttr('data-toggle'); 52 } 53 54 }, function() { 55 56 if(wWidth >= 992) { 57 $('.menu-item-559 .dropdown-menu').css('display','none'); 58 } 59 }); 60 61 $('.menu-item-711').hover(function(){ 62 console.log(wWidth); 63 if(wWidth >= 992) { 64 $('.menu-item-711 .dropdown-menu').css('display','block'); 65 $('.menu-item-711 > a').removeAttr('data-toggle'); 66 } 67 68 }, function() { 69 70 if(wWidth >= 992) { 71 $('.menu-item-711 .dropdown-menu').css('display','none'); 72 } 73 }); 74 75 76 asShowPopup(); 77 asClosePopup(); 78 }); 79 80 function asShowPopup(){ 81 var overlay = $('.as-overlay-wrapper'); 82 var overlayContent = $('.as-overlay-content'); 83 var galleryImage = $('.project-image-container'); 84 85 galleryImage.on('touchstart', function() { 86 detectTap = true; //detects all touch events 87 }); 88 galleryImage.on('touchmove', function() { 89 detectTap = false; //Excludes the scroll events from touch events 90 }); 91 galleryImage.on('click touchend', function(event) { 92 if (event.type == "click") detectTap = true; //detects click events 93 if (detectTap){ 94 var imgSrc = $('img',this).attr('data-src'); 95 96 var showImage = '<img src = "' + imgSrc + '" alt="Gallery Image" />'; 97 overlayContent.append(showImage); 98 overlay.fadeIn('0.15s'); 99 overlay.addClass('as-show'); 100 } 101 }); 102 } 103 104 function asClosePopup(){ 105 var overlay = $('.as-overlay-wrapper'); 106 107 overlay.on('touchstart', function() { 108 detectTap = true; //detects all touch events 109 }); 110 overlay.on('touchmove', function() { 111 detectTap = false; //Excludes the scroll events from touch events 112 }); 113 overlay.on('click touchend', function(event) { 114 if (event.type == "click") detectTap = true; //detects click events 115 if (detectTap){ 116 overlay.fadeOut('0.15s'); 117 overlay.removeClass('as-show'); 118 clearPopup(); 119 } 120 }); 121 } 122 123 function clearPopup(){ 124 var image = $('.as-overlay-content img'); 125 image.remove(); 126 } 127 128})(jQuery); 129 130
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.