1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,60 @@ |
1 |
+$(function () { |
|
2 |
+ $("#newsletter").validate(); |
|
3 |
+ |
|
4 |
+ var ads = [ |
|
5 |
+ { |
|
6 |
+ quote: "Get 2,000+ icons with Font Awesome Pro and <strong>ALL</strong> KS rewards for just $60!", |
|
7 |
+ class: "fa5", |
|
8 |
+ url: "https://fontawesome.com/?utm_source=font_awesome_homepage&utm_medium=display&utm_campaign=fa5_released&utm_content=banner", |
|
9 |
+ btn_text: "Check out FA Pro <i class='fas fas-external-link'></i>", |
|
10 |
+ }, |
|
11 |
+ ]; |
|
12 |
+ |
|
13 |
+ // selectAd(); |
|
14 |
+ |
|
15 |
+ // start the icon carousel |
|
16 |
+ $('#icon-carousel').carousel({ |
|
17 |
+ interval: 5000 |
|
18 |
+ }); |
|
19 |
+ |
|
20 |
+ $('[data-toggle="tooltip"]').tooltip(); |
|
21 |
+ $('[data-toggle="popover"]').popover(); |
|
22 |
+ |
|
23 |
+ if (storageAvailable('localStorage') && !localStorage.seenFA5ReleasedModal) { |
|
24 |
+ $('#modal-fa5') |
|
25 |
+ .modal('toggle') |
|
26 |
+ .on('hidden.bs.modal', function (e) { |
|
27 |
+ $('#fa5-iframe').remove(); |
|
28 |
+ }); |
|
29 |
+ ; |
|
30 |
+ } |
|
31 |
+ |
|
32 |
+ if (storageAvailable('localStorage')) { |
|
33 |
+ localStorage.seenFA5ReleasedModal = true; |
|
34 |
+ // Yippee! We can use localStorage awesomeness |
|
35 |
+ } |
|
36 |
+ |
|
37 |
+ function storageAvailable(type) { |
|
38 |
+ try { |
|
39 |
+ var storage = window[type], |
|
40 |
+ x = '__storage_test__'; |
|
41 |
+ storage.setItem(x, x); |
|
42 |
+ storage.removeItem(x); |
|
43 |
+ return true; |
|
44 |
+ } |
|
45 |
+ catch(e) { |
|
46 |
+ return false; |
|
47 |
+ } |
|
48 |
+ } |
|
49 |
+ |
|
50 |
+ function selectAd() { |
|
51 |
+ random_number = Math.floor(Math.random() * ads.length); |
|
52 |
+ random_ad = ads[random_number]; |
|
53 |
+ |
|
54 |
+ $('#banner').addClass(random_ad.class); |
|
55 |
+ $('#rotating-message').html(random_ad.quote); |
|
56 |
+ $('#rotating-url').attr("href", random_ad.url); |
|
57 |
+ $('#rotating-url').html(random_ad.btn_text); |
|
58 |
+ $('#banner').collapse('show'); |
|
59 |
+ } |
|
60 |
+}); |