Skip to content

Commit e3d3250

Browse files
committed
added email sign up form
1 parent 622d3a4 commit e3d3250

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+7094
-2314
lines changed

about-author.html

Lines changed: 217 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -13,73 +13,6 @@
1313
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
1414
<![endif]-->
1515
<style>
16-
html,
17-
body {
18-
font-size: 18px;
19-
color: #222;
20-
background: #fefefe;
21-
}
22-
body {
23-
padding-top: 10px;
24-
}
25-
.footer {
26-
padding: 20px 0 30px 0;
27-
}
28-
a, a:hover {border-bottom: 1px dotted; color: #444;}
29-
a:hover {text-decoration: none; color: #000;}
30-
.logo-title a, .logo-title a:hover {font-size: 72px; font-weight: normal;
31-
letter-spacing: .03em;
32-
vertical-align: middle;
33-
margin-left: 5px;
34-
color: #000; text-decoration: none;
35-
border-bottom: none;
36-
font-family: "Helvetica Neue",
37-
sans-serif;
38-
line-height: .9em;}
39-
.logo-title a:hover {color: gray;}
40-
.logo-image {vertical-align: middle; border: none;}
41-
.logo-header-section {margin: 15px 0 15px 0;}
42-
a.list-group-item.active {background: #444; border: 1px solid #222;}
43-
a.list-group-item.active:hover {background: #444; border: 1px solid #222;}
44-
#sidebar {margin-top: 30px;}
45-
46-
.select-next {
47-
min-height: 300px;
48-
}
49-
.choose-btn {
50-
font-size: 1.1em;
51-
margin: 10px 0 0 0;
52-
}
53-
.choose-next {
54-
border: 1px solid black;
55-
background-color: #444;
56-
margin-left: 25px;
57-
color: #ddd;
58-
}
59-
.choose-next a {
60-
color: #eee;
61-
}
62-
.btn-full {width: 100%; box-shadow: 1px 2px 1px #222;}
63-
p.under-btn {text-align: left; margin-top: 20px;}
64-
h3.panel-head {margin: 5px 0 0 0; font-size: 26px; color: #fff;}
65-
.smaller-item {font-size: .8em; padding: 5px 0 5px 10px;}
66-
@media (max-width: 1200px) {
67-
h3.panel-head {font-size: 22px;}
68-
}
69-
@media (max-width: 992px) {
70-
.choose-next {
71-
margin-left: 0px;
72-
}
73-
.select-next {
74-
min-height: 100px;
75-
}
76-
.smaller-item {font-size: 1em; padding: 15px 0 15px 10px;}
77-
}
78-
@media (max-width: 600px) {
79-
.logo-header-section {
80-
margin: 20px 32px 0 0;
81-
}
82-
}
8316
</style>
8417
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
8518

@@ -152,7 +85,223 @@ <h3>Where to now?</h3>
15285
</p>
15386
</div>
15487
</div>
155-
</div> </div>
88+
</div> <style type="text/css">
89+
#mc_embed_signup{background:#fff; clear:left; font:12px "Helvetica Neue",Arial,sans-serif; }
90+
/* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
91+
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
92+
</style>
93+
<hr/>
94+
<div id="mc_embed_signup">
95+
<form action="http://mattmakai.us2.list-manage.com/subscribe/post?u=b7e774f0c4f05dcebbfee183d&amp;id=b22335388d" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
96+
<h4>Interested in a complete Full Stack Python book with detailed tutorials and example code? Sign up here and you'll get an alert email if a book is created. No other emails will be sent other than sign up confirmation.</h4>
97+
<div class="row">
98+
<div class="col-md-9">
99+
<label for="mce-EMAIL">Email Address</label>
100+
<input type="email" value="" name="EMAIL" class="required email form-control" id="mce-EMAIL">
101+
</div>
102+
<div class="col-md-3">
103+
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="btn btn-success" style="margin-top: 20px;">
104+
</div>
105+
<div id="mce-responses" class="clear">
106+
<div class="response" id="mce-error-response" style="display:none"></div>
107+
<div class="response" id="mce-success-response" style="display:none"></div>
108+
</div> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
109+
<div style="position: absolute; left: -5000px;"><input type="text" name="b_b7e774f0c4f05dcebbfee183d_b22335388d" value=""></div>
110+
</div>
111+
</form>
112+
</div>
113+
<script type="text/javascript">
114+
var fnames = new Array();var ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';
115+
try {
116+
var jqueryLoaded=jQuery;
117+
jqueryLoaded=true;
118+
} catch(err) {
119+
var jqueryLoaded=false;
120+
}
121+
var head= document.getElementsByTagName('head')[0];
122+
if (!jqueryLoaded) {
123+
var script = document.createElement('script');
124+
script.type = 'text/javascript';
125+
script.src = '//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js';
126+
head.appendChild(script);
127+
if (script.readyState && script.onload!==null){
128+
script.onreadystatechange= function () {
129+
if (this.readyState == 'complete') mce_preload_check();
130+
}
131+
}
132+
}
133+
134+
var err_style = '';
135+
try{
136+
err_style = mc_custom_error_style;
137+
} catch(e){
138+
err_style = '#mc_embed_signup input.mce_inline_error{border-color:#6B0505;} #mc_embed_signup div.mce_inline_error{margin: 0 0 1em 0; padding: 5px 10px; background-color:#6B0505; font-weight: bold; z-index: 1; color:#fff;}';
139+
}
140+
var head= document.getElementsByTagName('head')[0];
141+
var style= document.createElement('style');
142+
style.type= 'text/css';
143+
if (style.styleSheet) {
144+
style.styleSheet.cssText = err_style;
145+
} else {
146+
style.appendChild(document.createTextNode(err_style));
147+
}
148+
head.appendChild(style);
149+
setTimeout('mce_preload_check();', 250);
150+
151+
var mce_preload_checks = 0;
152+
function mce_preload_check(){
153+
if (mce_preload_checks>40) return;
154+
mce_preload_checks++;
155+
try {
156+
var jqueryLoaded=jQuery;
157+
} catch(err) {
158+
setTimeout('mce_preload_check();', 250);
159+
return;
160+
}
161+
var script = document.createElement('script');
162+
script.type = 'text/javascript';
163+
script.src = 'http://downloads.mailchimp.com/js/jquery.form-n-validate.js';
164+
head.appendChild(script);
165+
try {
166+
var validatorLoaded=jQuery("#fake-form").validate({});
167+
} catch(err) {
168+
setTimeout('mce_preload_check();', 250);
169+
return;
170+
}
171+
mce_init_form();
172+
}
173+
function mce_init_form(){
174+
jQuery(document).ready( function($) {
175+
var options = { errorClass: 'mce_inline_error', errorElement: 'div', onkeyup: function(){}, onfocusout:function(){}, onblur:function(){} };
176+
var mce_validator = $("#mc-embedded-subscribe-form").validate(options);
177+
$("#mc-embedded-subscribe-form").unbind('submit');//remove the validator so we can get into beforeSubmit on the ajaxform, which then calls the validator
178+
options = { url: 'http://mattmakai.us2.list-manage.com/subscribe/post-json?u=b7e774f0c4f05dcebbfee183d&id=b22335388d&c=?', type: 'GET', dataType: 'json', contentType: "application/json; charset=utf-8",
179+
beforeSubmit: function(){
180+
$('#mce_tmp_error_msg').remove();
181+
$('.datefield','#mc_embed_signup').each(
182+
function(){
183+
var txt = 'filled';
184+
var fields = new Array();
185+
var i = 0;
186+
$(':text', this).each(
187+
function(){
188+
fields[i] = this;
189+
i++;
190+
});
191+
$(':hidden', this).each(
192+
function(){
193+
var bday = false;
194+
if (fields.length == 2){
195+
bday = true;
196+
fields[2] = {'value':1970};//trick birthdays into having years
197+
}
198+
if ( fields[0].value=='MM' && fields[1].value=='DD' && (fields[2].value=='YYYY' || (bday && fields[2].value==1970) ) ){
199+
this.value = '';
200+
} else if ( fields[0].value=='' && fields[1].value=='' && (fields[2].value=='' || (bday && fields[2].value==1970) ) ){
201+
this.value = '';
202+
} else {
203+
if (/\[day\]/.test(fields[0].name)){
204+
this.value = fields[1].value+'/'+fields[0].value+'/'+fields[2].value;
205+
} else {
206+
this.value = fields[0].value+'/'+fields[1].value+'/'+fields[2].value;
207+
}
208+
}
209+
});
210+
});
211+
$('.phonefield-us','#mc_embed_signup').each(
212+
function(){
213+
var fields = new Array();
214+
var i = 0;
215+
$(':text', this).each(
216+
function(){
217+
fields[i] = this;
218+
i++;
219+
});
220+
$(':hidden', this).each(
221+
function(){
222+
if ( fields[0].value.length != 3 || fields[1].value.length!=3 || fields[2].value.length!=4 ){
223+
this.value = '';
224+
} else {
225+
this.value = 'filled';
226+
}
227+
});
228+
});
229+
return mce_validator.form();
230+
},
231+
success: mce_success_cb
232+
};
233+
$('#mc-embedded-subscribe-form').ajaxForm(options);
234+
235+
236+
});
237+
}
238+
function mce_success_cb(resp){
239+
$('#mce-success-response').hide();
240+
$('#mce-error-response').hide();
241+
if (resp.result=="success"){
242+
$('#mce-'+resp.result+'-response').show();
243+
$('#mce-'+resp.result+'-response').html(resp.msg);
244+
$('#mc-embedded-subscribe-form').each(function(){
245+
this.reset();
246+
});
247+
} else {
248+
var index = -1;
249+
var msg;
250+
try {
251+
var parts = resp.msg.split(' - ',2);
252+
if (parts[1]==undefined){
253+
msg = resp.msg;
254+
} else {
255+
i = parseInt(parts[0]);
256+
if (i.toString() == parts[0]){
257+
index = parts[0];
258+
msg = parts[1];
259+
} else {
260+
index = -1;
261+
msg = resp.msg;
262+
}
263+
}
264+
} catch(e){
265+
index = -1;
266+
msg = resp.msg;
267+
}
268+
try{
269+
if (index== -1){
270+
$('#mce-'+resp.result+'-response').show();
271+
$('#mce-'+resp.result+'-response').html(msg);
272+
} else {
273+
err_id = 'mce_tmp_error_msg';
274+
html = '<div id="'+err_id+'" style="'+err_style+'"> '+msg+'</div>';
275+
276+
var input_id = '#mc_embed_signup';
277+
var f = $(input_id);
278+
if (ftypes[index]=='address'){
279+
input_id = '#mce-'+fnames[index]+'-addr1';
280+
f = $(input_id).parent().parent().get(0);
281+
} else if (ftypes[index]=='date'){
282+
input_id = '#mce-'+fnames[index]+'-month';
283+
f = $(input_id).parent().parent().get(0);
284+
} else {
285+
input_id = '#mce-'+fnames[index];
286+
f = $().parent(input_id).get(0);
287+
}
288+
if (f){
289+
$(f).append(html);
290+
$(input_id).focus();
291+
} else {
292+
$('#mce-'+resp.result+'-response').show();
293+
$('#mce-'+resp.result+'-response').html(msg);
294+
}
295+
}
296+
} catch(e){
297+
$('#mce-'+resp.result+'-response').show();
298+
$('#mce-'+resp.result+'-response').html(msg);
299+
}
300+
}
301+
}
302+
303+
</script>
304+
<!--End mc_embed_signup--> </div>
156305
<div class="col-md-offset-1 col-md-3" id="sidebar">
157306
<div class="panel panel-success">
158307
<div class="panel-heading"><h3 class="panel-head">About the Author</h3></div>

0 commit comments

Comments
 (0)