-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
183 lines (118 loc) · 6.38 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
$(document).ready(function(){
eml = "";
emlerr = "";
function ajaxEmail(){
console.log('ajaxEmail');
console.log(eml);
$.when($.ajax({
type: 'POST',
url: '/email.php',
data: "eml=" + eml,
timeout: 10000,
success: function (msg){
console.log(msg);
emlerr = msg;
},
})).done(function () {
errorCheck();
});
}
function errorCheck(){
console.log("errorCheck");
console.log(emlerr);
if (emlerr === "bad"|| emlerr === "invalid") {
$('#subscribe').attr("disabled", false);
$.alert({
title: 'Oops',
content: 'The email address you entered is bad or invalid. Please try again!',
});
}
else if (emlerr === "problem") {
$('#subscribe').attr("disabled", false);
$.alert({
title: 'Oops',
content: 'Your email address was not added to our system. Please try again!',
});
}
else if (emlerr === "exists") {
$('#subscribe').attr("disabled", false);
$('#email').val('');
$.alert({
title: 'Oops',
content: 'Your email address is already in our system.',
});
}
else if (emlerr ==="success") {
$('#subscribe').attr("disabled", false);
$('#email').val('');
$("#subscribeform").toggle();
$.alert({
title: 'Success',
content: 'Your email address was added to our system. When we make changes or add more articles or features, we will keep you posted!',
});
}
}
// Add smooth scrolling to all links
$("a").on('click', function(event) {
// Make sure this.hash has a value before overriding default behavior
if (this.hash !== "") {
// Prevent default anchor click behavior
event.preventDefault();
// Store hash
var hash = this.hash;
// Using jQuery's animate() method to add smooth page scroll
// The optional number (800) specifies the number of milliseconds it takes to scroll to the specified area
$('html, body').animate({
scrollTop: $(hash).offset().top
}, 800, function(){
// Add hash (#) to URL when done scrolling (default click behavior)
window.location.hash = hash;
});
} // End if
});
$(".disclaimer").click(function (e) {
e.preventDefault();
$.confirm({
title: 'Legal Disclaimer',
content: 'This website is not engaged in dispensing legal or medical advice. The author is not a lawyer, medical doctor, scholar, business consultant or a yoga teacher. The website is not guaranteed to be accurate or truthful. It may all be lies. The content of this site is for adults only that can think for themselves and who can handle cognitive dissonance without freaking out. Persons under 21 years of age are prohibited from accessing this site. The content, products, images, articles and opinions offered here are for informational and entertainment purposes only. To make a medical decision, you should seek the advice of a medical doctor. To make a legal or business related decision, you should seek the advise of a competent attorney. The author and owner of this site is neither of those two things. Your access and use of this site is done at your own risk. No lifeguard is on duty. You must agree to hold the website and its author and owner entirely and completely harmless. Your ip address, other identifying information, and email (if provided) is stored in our secure database. Your clicks, scrolls and gestures are monitored and attached to your profile. Your acceptance of this legal disclaimer is material to our agreement and the only condition under which we provide courtesy access to this site and its information. Site access is prohibited without agreement to our legal disclaimer. If you decline you will be kindly redirected to a lovely and instructive cat video already in progress with our warmest and sincerest Adieu.',
buttons: {
Agree: function () {
$.alert('Great! You Understand And Are In Full Agreement With Our Legal Disclaimer!');
},
Decline: function () {
location.replace ('https://youtu.be/hY7m5jjJ9mM?t=22');
}
},
});
})
$(".downloads").click(function (e) {
e.preventDefault();
$.confirm({
title: 'Downloads Notice',
content: 'Your acceptance of our legal disclaimer is material to our agreement and the only condition under which we provide access to this site and its information including these downloads. Site access is prohibited without agreement to our legal disclaimer. Our Legal Disclaimer is at the bottom of the website page. The image downloads are provided for free and are for entertainment purposes only. The badge and sign images are not issued or reviewed by any government entity. Use at your own risk. If you decline you will be kindly redirected to a lovely and instructive cat video already in progress with our warmest and sincerest Adieu.',
buttons: {
Agree: function () {
$.alert('Great! You Understand And Are In Full Agreement With Our Legal Disclaimer!');
},
Decline: function () {
location.replace ('https://youtu.be/hY7m5jjJ9mM?t=22');
}
},
});
})
$('#subscribe').click(function (e) {
e.preventDefault();
$(this).attr("disabled", true);
eml = $("#email").val();
console.log(eml);
ajaxEmail();
})
// $("#copyfifthgrader").click(function (e) {
//
// e.preventDefault();
// $("#fifthgraderlink").focus();
// $("#fifthgraderlink").select();
// document.execCommand('copy');
//
// })
});