1(function ($) { 2 3 var n = Delfin.layer = { 4 5 settings: { 6 speed: 300, 7 opacity: 0.8 8 }, 9 10 shader: null, 11 12 openLayer: function(id) { 13 // Shader 14 shader = document.createElement("div"); 15 $(shader).attr("id", "layer-shader"); 16 $(shader).insertBefore($("#" + id)); 17 $(shader).animate({opacity: n.settings.opacity}, n.settings.speed); 18 19 $(shader).on("mouseup", function(e) { 20 n.closeLayer(id); 21 }); 22 23 $("#" + id).find(".layer-close").on("click", function() { 24 n.closeLayer(id); 25 }); 26 27 this.hash = $("#" + id).attr("data-hash"); 28 29 if(this.hash) { 30 window.location.hash = this.hash; 31 } 32 33 var windowHeight = $(window).height(); 34 var layerHeight = $("#" + id).outerHeight(); 35 var yPos = windowHeight / 2 - layerHeight / 2 + $(window).scrollTop(); 36 37 if(layerHeight > windowHeight) { 38 yPos = $(window).scrollTop() + 20; 39 } 40 41 $("#" + id).show(); 42 $("#" + id).css("top", yPos); 43 }, 44 45 closeLayer: function(id) { 46 $("#" + id).hide(); 47 $(shader).animate({opacity: 0}, n.settings.speed, "linear", this.onCloseLayer); 48 49 $("#" + id).find(".layer-close").off("click"); 50 51 if(this.hash) { 52 window.location.hash = "!"; 53 } 54 }, 55 56 onCloseLayer: function() { 57 $(shader).remove(); 58 59 if(shader) { 60 shader.onmouseup = null; 61 } 62 63 if($("#youtube-layer")) 64 $("#youtube-layer").remove(); 65 } 66 67 } 68 69 $(function() { 70 $("[data-layer-id]").each(function() { 71 $(this).on("click", function() { 72 n.openLayer($(this).attr("data-layer-id")); 73 }); 74 }); 75 }); 76 77 78})(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.