popcorn-site/js/site.js
jduncanator 17067e6036 Updated release file path
Moved the files onto a larger CDN node to allow for more stable downloads and nightly builds
2014-03-18 18:10:21 +11:00

40 lines
1.0 KiB
JavaScript

var userAgent = navigator.platform,
fileHost = "http://popcorn.cdnjd.com/releases/";
var mac = /Mac/,
win = /Win/,
lin = /Lin/,
lin64 = /x86_64/;
Array.prototype.forEach.call(document.querySelectorAll('[data-file]'), function(el) {
el.href = fileHost + el.getAttribute('data-file');
});
if(mac.test(userAgent)) {
document.getElementsByTagName('body')[0].className+=' mac';
} else if (win.test(userAgent)) {
document.getElementsByTagName('body')[0].className+=' win';
} else if (lin.test(userAgent)) {
if(lin64.test(userAgent)) {
document.getElementsByTagName('body')[0].className+=' lin-64';
} else {
document.getElementsByTagName('body')[0].className+=' lin-32';
}
} else {
document.getElementsByTagName('body')[0].className+=' nope';
}
var heroHeight = document.getElementById('header').offsetHeight;
// Disable WOW on small screens.
try {
if(window.innerWidth > 768) {
wow = new WOW(
{
animateClass: 'animated',
offset: 100
}
);
wow.init();
};
} catch(err) { }