]>
git.ipfire.org Git - people/shoehn/ipfire.org.git/blob - static/js/site-min.js
1 function getCookie(o
){var e
=document
.cookie
.match("\\b"+o
+"=([^;]*)\\b");return e
?e
[1]:void 0}$(document
).ready(function(){$("#scrollto").click(function(o
){o
.preventDefault(),$("body").animate({scrollTop
:$("#features").offset().top
-72},1e3
)}),$(window
).scroll(function(){$(document
).scrollTop()>100?($(".fixed-top").addClass("scrolled"),$(".menu-text").addClass("hidden")):($(".fixed-top").removeClass("scrolled"),$(".menu-text").removeClass("hidden"))}),$(".navbar-toggler-left").click(function(){$("#navbarSupportedContent, #mask").addClass("open"),$(".scrolled").addClass("fadeout")}),$("#mask").click(function(){$("#navbarSupportedContent, #mask").removeClass("open"),$(".scrolled").removeClass("fadeout")})}),$.query=function(o
){return new RegExp("[\\?&]"+o
+"=([^&#]*)").exec(window
.location
.href
)[1]||0},$("a.download-splash").click(function(o
){o
.preventDefault(),linkLocation
=this.href
,window
.location
="http://downloads.ipfire.org/download-splash?file="+linkLocation
}),/.*download-splash.*/i.test(window
.location
.href
)&&$("p.download-path").ready(function(){var o
=!1,e
=["http://downloads.ipfire.org/"],n
=$.query("file");for(i
in e
)prefix
=e
[i
],n
.substring(0,prefix
.length
)==prefix
&&(o
=!0);o
&&($("p.download-path").prepend($("<a>",{href
:encodeURI(n
),text
:n
})),setTimeout(function(){window
.location
=n
},"2000"))}),jQuery
.postJSON=function(url
,args
,callback
){args
._xsrf
=getCookie("_xsrf"),$.ajax({url
:url
,data
:$.param(args
),dataType
:"text",type
:"POST",success:function(response
){callback(eval("("+response
+")"))}})};