2015-09-02 02:52:06 +08:00
|
|
|
$(function () {
|
2015-06-24 23:03:53 +08:00
|
|
|
$("#newsletter").validate();
|
|
|
|
|
2015-01-23 02:55:45 +08:00
|
|
|
var ads = [
|
2016-10-25 00:01:53 +08:00
|
|
|
{
|
2017-09-07 04:16:45 +08:00
|
|
|
quote: "September is your last chance to get FA Pro and <strong>ALL</strong> KS rewards for just $40!",
|
2016-12-23 04:54:15 +08:00
|
|
|
class: "fa5",
|
2017-09-07 04:16:45 +08:00
|
|
|
url: "https://fontawesome.com/?utm_source=font_awesome_homepage&utm_medium=display&utm_campaign=september_last_chance&utm_content=banner",
|
|
|
|
btn_text: "Pre-order FA Pro! <i class='fas fas-external-link'></i>",
|
2016-10-25 00:01:53 +08:00
|
|
|
},
|
2015-01-23 02:55:45 +08:00
|
|
|
];
|
|
|
|
|
2016-03-11 02:49:53 +08:00
|
|
|
selectAd();
|
2015-01-23 02:55:45 +08:00
|
|
|
|
2013-05-11 00:00:01 +08:00
|
|
|
// start the icon carousel
|
2013-10-23 23:12:39 +08:00
|
|
|
$('#icon-carousel').carousel({
|
2013-05-11 00:00:01 +08:00
|
|
|
interval: 5000
|
|
|
|
});
|
2015-01-23 02:55:45 +08:00
|
|
|
|
2016-01-09 07:03:37 +08:00
|
|
|
$('[data-toggle="tooltip"]').tooltip();
|
2015-06-24 13:39:03 +08:00
|
|
|
$('[data-toggle="popover"]').popover();
|
2016-10-26 00:34:36 +08:00
|
|
|
|
2017-09-07 04:16:45 +08:00
|
|
|
if (storageAvailable('localStorage') && !localStorage.seenFA5Modal3) {
|
2016-12-03 01:03:45 +08:00
|
|
|
$('#modal-fa5')
|
2016-10-26 00:34:36 +08:00
|
|
|
.modal('toggle')
|
|
|
|
.on('hidden.bs.modal', function (e) {
|
2016-12-03 01:03:45 +08:00
|
|
|
$('#fa5-iframe').remove();
|
2016-10-26 00:34:36 +08:00
|
|
|
});
|
|
|
|
;
|
2016-10-25 00:01:53 +08:00
|
|
|
}
|
2015-06-24 13:39:03 +08:00
|
|
|
|
2016-10-25 00:01:53 +08:00
|
|
|
if (storageAvailable('localStorage')) {
|
2017-09-07 04:16:45 +08:00
|
|
|
localStorage.seenFA5Modal3 = true;
|
2016-10-25 00:01:53 +08:00
|
|
|
// Yippee! We can use localStorage awesomeness
|
|
|
|
}
|
|
|
|
|
|
|
|
function storageAvailable(type) {
|
|
|
|
try {
|
|
|
|
var storage = window[type],
|
|
|
|
x = '__storage_test__';
|
|
|
|
storage.setItem(x, x);
|
|
|
|
storage.removeItem(x);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
catch(e) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2016-11-30 06:11:33 +08:00
|
|
|
|
2016-03-11 02:49:53 +08:00
|
|
|
function selectAd() {
|
2015-09-02 02:52:06 +08:00
|
|
|
random_number = Math.floor(Math.random() * ads.length);
|
2015-01-23 02:55:45 +08:00
|
|
|
random_ad = ads[random_number];
|
|
|
|
|
2015-03-24 22:36:15 +08:00
|
|
|
$('#banner').addClass(random_ad.class);
|
2015-01-23 02:55:45 +08:00
|
|
|
$('#rotating-message').html(random_ad.quote);
|
2015-03-24 22:36:15 +08:00
|
|
|
$('#rotating-url').attr("href", random_ad.url);
|
|
|
|
$('#rotating-url').html(random_ad.btn_text);
|
|
|
|
$('#banner').collapse('show');
|
2015-01-23 02:55:45 +08:00
|
|
|
}
|
2013-05-11 00:00:01 +08:00
|
|
|
});
|