-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwrapper.html
More file actions
559 lines (497 loc) · 23.8 KB
/
wrapper.html
File metadata and controls
559 lines (497 loc) · 23.8 KB
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
{% load actionkit_tags %}
<!DOCTYPE html>
<html lang="{{page.lang.iso_code|default:'en'}}"{% if page.lang.is_rtl %} dir="rtl"{% endif %}>
<head>
<meta charset="utf-8">
<title>{% block title %}{{ page.title }} | {% filter ak_text:"org_name" %}{% client_name %}{% endfilter %}{% endblock %}</title>
<script>startTime=new Date()</script>
<meta http-equiv="X-UA-Compatible" content="IE=edge;chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
{% if page.custom_fields.share_page %}
<meta property="og:url" content="{{ page.custom_fields.share_page }}" />
{% else %}{{ page.followup.share_title_tag }}
{% if form.id and page.followup.share_description_value %}<meta name="description" property="og:description" content="{% block description %}{{ page.followup.share_description_value }}{% endblock %}">{% else %}<meta name="description" property="og:description" content="Act now to support peace and justice.">{% endif %}
{{ page.followup.share_image_tag }}
{% ifequal page.type 'EventSignup' %}
{% if page.custom_fields.share_event_search %}{{ page.followup.share_url_tag }}{% else %}
<meta property="og:url" content="https://act.fcnl.org/event/{{ page.name }}/{{ event.id }}/signup" />{% endif %}
{% else %}
{{ page.followup.share_url_tag }}
{% endifequal %}{% endif %}
<meta property="og:site_name" content="{% filter ak_text:'org_name' %}{% client_name %}{% endfilter %}">
<meta property="og:type" content="article">
<meta name="twitter:card" value="summary">
{% block meta_additions %}{% endblock %}
{% load_css %}
//fonts.googleapis.com/css?family=Open+Sans:100,300,400,600,700
/media/modern/actionkit-2.3.0.css
https://fcnl.herokuapp.com/assets/actionkit.css
https://www.fcnl.org/assets/actionkit.css
https://s3.amazonaws.com/fcnlactionkit/images/actionkit.css
{% end %}
{% block css_additions %}{% endblock %}
{% load_ak_context context %}
{% load_js %}
//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js
/resources/actionkit.js
{% end %}
{% block script_additions %}{% endblock %}
</head>
<body class="{{ filename|split:'.'|nth:0 }}-page lang-{{page.lang.iso_code|default:'unknown'}}{% if page.lang.is_rtl %} ak-rtl{% endif %} ak-no-js">
<script type="text/javascript">actionkit.forms.initPage()</script>
{% if not request.GET.hidewrapper %}
<div class="Rails">
<div class="Header">
<div class="Header-inner">
<p class="Header-logo">
<a class="Header-logo-link" href="http://www.fcnl.org" title="Friends Committee on National Legislation">
<img alt="FCNL" src="https://s3.amazonaws.com/fcnlactionkit/images/logo.svg">
</a>
</p>
</div>
</div>
</div>
<div class="ak-page-container">
{% endif %}
{% block content %}{% endblock %}
</div>{% if not request.GET.hidewrapper %}
<div class="Action u-section u-overflow">
<div class="l-padding">
<div class="l-wrap">
<ul class="Action-items">
<li class="Action-item">
<p class="Action-header">Attend an Event</p>
<p class="Action-description">FCNL events happen all over the country.</p>
<a href="https://www.fcnl.org/events" class="Button Button--small Button--outline">Find Events</a>
</li>
<li class="Action-item">
<p class="Action-header">Make a Donation</p>
<p class="Action-description">Our work for peace and justice depends on you.</p>
<a href="https://act.fcnl.org/donate/donate/" class="Button Button--small Button--outline">Donate Now</a>
</li>
<li class="Action-hr" aria-hidden="true"></li>
<li class="Action-item">
<p class="Action-header">Stay Connected</p>
<p class="Action-description">Get weekly action alerts from FCNL.</p>
<form class="EmailForm" action="https://act.fcnl.org/act/" method="POST">
<input type="hidden" name="page" value="web-signup">
<label class="u-screenreader" for="footer_email_address">Enter your email address</label>
<input id="footer_email_address" type="email" name="email" class="EmailForm-email" placeholder="Enter email address">
<button class="EmailForm-submit" style="background:transparent!important;margin:0;padding:0;">
<span class="u-screenreader">Subscribe</span>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" focusable="false" class="EmailForm-submit-icon" height="24" width="24" preserveAspectRatio="xMidYMid meet" role="img" aria-hidden="true">
<path d="M1792 1632v-768q-32 36-69 66-268 206-426 338-51 43-83 67t-86.5 48.5-102.5 24.5h-2q-48 0-102.5-24.5t-86.5-48.5-83-67q-158-132-426-338-37-30-69-66v768q0 13 9.5 22.5t22.5 9.5h1472q13 0 22.5-9.5t9.5-22.5zm0-1051v-24.5l-.5-13-3-12.5-5.5-9-9-7.5-14-2.5h-1472q-13 0-22.5 9.5t-9.5 22.5q0 168 147 284 193 152 401 317 6 5 35 29.5t46 37.5 44.5 31.5 50.5 27.5 43 9h2q20 0 43-9t50.5-27.5 44.5-31.5 46-37.5 35-29.5q208-165 401-317 54-43 100.5-115.5t46.5-131.5zm128-37v1088q0 66-47 113t-113 47h-1472q-66 0-113-47t-47-113v-1088q0-66 47-113t113-47h1472q66 0 113 47t47 113z"/>
</svg>
</button>
</form>
</li>
<li class="Action-item">
<p class="Action-header">Follow Us</p>
<p class="Action-description">Stay connected with our work on social media.</p>
<div class="SocialLinks">
<ul class="SocialLinks-items">
<li class="SocialLinks-item">
<a class="SocialLinks-link" href="http://facebook.com/quakerlobby">
<span class="u-screenreader">Follow us on Facebook</span>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" focusable="false" class="SocialLinks-icon" height="18" width="18" preserveAspectRatio="xMidYMid meet" role="img" aria-hidden="true">
<path d="M1471 140v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759h-306v-759h-255v-296h255v-218q0-186 104-288.5t277-102.5q147 0 228 12z"/>
</svg>
</a> </li>
<li class="SocialLinks-item">
<a class="SocialLinks-link" href="http://twitter.com/fcnl">
<span class="u-screenreader">Follow us on Twitter</span>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" focusable="false" class="SocialLinks-icon" height="18" width="18" preserveAspectRatio="xMidYMid meet" role="img" aria-hidden="true">
<path d="M1812 536q-67 98-162 167 1 14 1 42 0 130-38 259.5t-115.5 248.5-184.5 210.5-258 146-323 54.5q-271 0-496-145 35 4 78 4 225 0 401-138-105-2-188-64.5t-114-159.5q33 5 61 5 43 0 85-11-112-23-185.5-111.5t-73.5-205.5v-4q68 38 146 41-66-44-105-115t-39-154q0-88 44-163 121 149 294.5 238.5t371.5 99.5q-8-38-8-74 0-134 94.5-228.5t228.5-94.5q140 0 236 102 109-21 205-78-37 115-142 178 93-10 186-50z"/>
</svg>
</a> </li>
<li class="SocialLinks-item">
<a class="SocialLinks-link" href="http://youtube.com/quakerlobby">
<span class="u-screenreader">Subscribe on YouTube</span>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" focusable="false" class="SocialLinks-icon" height="18" width="18" preserveAspectRatio="xMidYMid meet" role="img" aria-hidden="true">
<path d="M1408 1024q0-37-30-54l-512-320q-31-20-65-2-33 18-33 56v640q0 38 33 56 16 8 31 8 20 0 34-10l512-320q30-17 30-54zm512 0q0 96-1 150t-8.5 136.5-22.5 147.5q-16 73-69 123t-124 58q-222 25-671 25t-671-25q-71-8-124.5-58t-69.5-123q-14-65-21.5-147.5t-8.5-136.5-1-150 1-150 8.5-136.5 22.5-147.5q16-73 69-123t124-58q222-25 671-25t671 25q71 8 124.5 58t69.5 123q14 65 21.5 147.5t8.5 136.5 1 150z"/>
</svg>
</a> </li>
<li class="SocialLinks-item">
<a class="SocialLinks-link" href="http://instagram.com/quaker_lobby">
<span class="u-screenreader">Follow us on Instagram</span>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2048 2048" focusable="false" class="SocialLinks-icon" height="18" width="18" preserveAspectRatio="xMidYMid meet" role="img" aria-hidden="true">
<path d="M1618 1554v-648h-135q20 63 20 131 0 126-64 232.5t-174 168.5-240 62q-197 0-337-135.5t-140-327.5q0-68 20-131h-141v648q0 26 17.5 43.5t43.5 17.5h1069q25 0 43-17.5t18-43.5zm-284-533q0-124-90.5-211.5t-218.5-87.5q-127 0-217.5 87.5t-90.5 211.5 90.5 211.5 217.5 87.5q128 0 218.5-87.5t90.5-211.5zm284-360v-165q0-28-20-48.5t-49-20.5h-174q-29 0-49 20.5t-20 48.5v165q0 29 20 49t49 20h174q29 0 49-20t20-49zm174-208v1142q0 81-58 139t-139 58h-1142q-81 0-139-58t-58-139v-1142q0-81 58-139t139-58h1142q81 0 139 58t58 139z"/>
</svg>
</a> </li>
</ul>
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="Rails">
<div class="Footer">
<div class="l-padding u-mt3 u-mb3">
<div class="l-wrap">
<div class="l-secondary-primary">
<div class="l-primary u-mb2">
<div class="Footer-content">
<div class="Fact u-mb2">
<p class="Fact-label">Did You Know?</p>
<p class="Fact-content">
You can become an advocate for the future and work towards financial peace of mind with a life income gift. More info: Mary Comfort Ferrell, 202-903-2539
</p>
</div>
<ol class="PipedList">
<li class="PipedList-item">245 Second St, NE, Washington, DC 20002</li>
<li class="PipedList-item">202-547-6000</li>
<li class="PipedList-item">800-630-1330 <em>(Toll Free)</em></li>
<li class="PipedList-item"><a href="https://fcnl.org/updates/charitable-disclosure-statements-367">Legal Information</a></li>
<li class="PipedList-item"><a href="https://fcnl.org/updates/donor-privacy-policy-207">Donor Privacy Policy</a></li>
</ol>
<p class="Footer-copyright">© 2016</p>
</div>
</div>
<div class="l-secondary">
<div class="AboutCard">
<div class="AboutCard-logo">
<a class="AboutCard-logo-link" href="http://www.fcnl.org" title="Friends Committee on National Legislation">
<img alt="FCNL" src="https://s3.amazonaws.com/fcnlactionkit/images/logo.svg">
</a>
</div>
<p class="AboutCard-summary">
FCNL's multi-issue advocacy connects Quaker testimonies with legislation in Washington.
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% block below_form %}
<script type="text/javascript">
actionkit.forms.contextRoot = '/context/';
actionkit.forms.initForm('act');
</script>
<script type="text/javascript">/* ACTIONKIT NOTES
* Uses #id_email for the email address (required by AK -- mailcheck.js default is #email)
* Uses # hint for the suggestion
*/
/* globals define, module, jQuery */
/*
* Mailcheck https://github.com/mailcheck/mailcheck
* Author
* Derrick Ko (@derrickko)
*
* Released under the MIT License.
*
* v 1.1.2
*/
var Mailcheck = {
domainThreshold: 2,
secondLevelThreshold: 2,
topLevelThreshold: 2,
defaultDomains: ['msn.com', 'bellsouth.net',
'telus.net', 'comcast.net', 'optusnet.com.au',
'earthlink.net', 'qq.com', 'sky.com', 'icloud.com',
'mac.com', 'sympatico.ca', 'googlemail.com',
'att.net', 'xtra.co.nz', 'web.de',
'cox.net', 'gmail.com', 'ymail.com',
'aim.com', 'rogers.com', 'verizon.net',
'rocketmail.com', 'google.com', 'optonline.net',
'sbcglobal.net', 'aol.com', 'me.com', 'btinternet.com',
'charter.net', 'shaw.ca'],
defaultSecondLevelDomains: ["yahoo", "hotmail", "mail", "live", "outlook", "gmx"],
defaultTopLevelDomains: ["com", "com.au", "com.tw", "ca", "co.nz", "co.uk", "de",
"fr", "it", "ru", "net", "org", "edu", "gov", "jp", "nl", "kr", "se", "eu",
"ie", "co.il", "us", "at", "be", "dk", "hk", "es", "gr", "ch", "no", "cz",
"in", "net", "net.au", "info", "biz", "mil", "co.jp", "sg", "hu", "uk"],
run: function(opts) {
opts.domains = opts.domains || Mailcheck.defaultDomains;
opts.secondLevelDomains = opts.secondLevelDomains || Mailcheck.defaultSecondLevelDomains;
opts.topLevelDomains = opts.topLevelDomains || Mailcheck.defaultTopLevelDomains;
opts.distanceFunction = opts.distanceFunction || Mailcheck.sift4Distance;
var defaultCallback = function(result){ return result; };
var suggestedCallback = opts.suggested || defaultCallback;
var emptyCallback = opts.empty || defaultCallback;
var result = Mailcheck.suggest(Mailcheck.encodeEmail(opts.email), opts.domains, opts.secondLevelDomains, opts.topLevelDomains, opts.distanceFunction);
return result ? suggestedCallback(result) : emptyCallback();
},
suggest: function(email, domains, secondLevelDomains, topLevelDomains, distanceFunction) {
email = email.toLowerCase();
var emailParts = this.splitEmail(email);
if (secondLevelDomains && topLevelDomains) {
// If the email is a valid 2nd-level + top-level, do not suggest anything.
if (secondLevelDomains.indexOf(emailParts.secondLevelDomain) !== -1 && topLevelDomains.indexOf(emailParts.topLevelDomain) !== -1) {
return false;
}
}
var closestDomain = this.findClosestDomain(emailParts.domain, domains, distanceFunction, this.domainThreshold);
if (closestDomain) {
if (closestDomain == emailParts.domain) {
// The email address exactly matches one of the supplied domains; do not return a suggestion.
return false;
} else {
// The email address closely matches one of the supplied domains; return a suggestion
return { address: emailParts.address, domain: closestDomain, full: emailParts.address + "@" + closestDomain };
}
}
// The email address does not closely match one of the supplied domains
var closestSecondLevelDomain = this.findClosestDomain(emailParts.secondLevelDomain, secondLevelDomains, distanceFunction, this.secondLevelThreshold);
var closestTopLevelDomain = this.findClosestDomain(emailParts.topLevelDomain, topLevelDomains, distanceFunction, this.topLevelThreshold);
if (emailParts.domain) {
closestDomain = emailParts.domain;
var rtrn = false;
if(closestSecondLevelDomain && closestSecondLevelDomain != emailParts.secondLevelDomain) {
// The email address may have a mispelled second-level domain; return a suggestion
closestDomain = closestDomain.replace(emailParts.secondLevelDomain, closestSecondLevelDomain);
rtrn = true;
}
if(closestTopLevelDomain && closestTopLevelDomain != emailParts.topLevelDomain && emailParts.secondLevelDomain !== '') {
// The email address may have a mispelled top-level domain; return a suggestion
closestDomain = closestDomain.replace(new RegExp(emailParts.topLevelDomain + "$"), closestTopLevelDomain);
rtrn = true;
}
if (rtrn) {
return { address: emailParts.address, domain: closestDomain, full: emailParts.address + "@" + closestDomain };
}
}
/* The email address exactly matches one of the supplied domains, does not closely
* match any domain and does not appear to simply have a mispelled top-level domain,
* or is an invalid email address; do not return a suggestion.
*/
return false;
},
findClosestDomain: function(domain, domains, distanceFunction, threshold) {
threshold = threshold || this.topLevelThreshold;
var dist;
var minDist = Infinity;
var closestDomain = null;
if (!domain || !domains) {
return false;
}
if(!distanceFunction) {
distanceFunction = this.sift4Distance;
}
for (var i = 0; i < domains.length; i++) {
if (domain === domains[i]) {
return domain;
}
dist = distanceFunction(domain, domains[i]);
if (dist < minDist) {
minDist = dist;
closestDomain = domains[i];
}
}
if (minDist <= threshold && closestDomain !== null) {
return closestDomain;
} else {
return false;
}
},
sift4Distance: function(s1, s2, maxOffset) {
// sift4: https://siderite.blogspot.com/2014/11/super-fast-and-accurate-string-distance.html
if (maxOffset === undefined) {
maxOffset = 5; //default
}
if (!s1||!s1.length) {
if (!s2) {
return 0;
}
return s2.length;
}
if (!s2||!s2.length) {
return s1.length;
}
var l1=s1.length;
var l2=s2.length;
var c1 = 0; //cursor for string 1
var c2 = 0; //cursor for string 2
var lcss = 0; //largest common subsequence
var local_cs = 0; //local common substring
var trans = 0; //number of transpositions ('ab' vs 'ba')
var offset_arr=[]; //offset pair array, for computing the transpositions
while ((c1 < l1) && (c2 < l2)) {
if (s1.charAt(c1) == s2.charAt(c2)) {
local_cs++;
var isTrans=false;
//see if current match is a transposition
var i=0;
while (i<offset_arr.length) {
var ofs=offset_arr[i];
if (c1<=ofs.c1 || c2 <= ofs.c2) {
// when two matches cross, the one considered a transposition is the one with the largest difference in offsets
isTrans=Math.abs(c2-c1)>=Math.abs(ofs.c2-ofs.c1);
if (isTrans)
{
trans++;
} else
{
if (!ofs.trans) {
ofs.trans=true;
trans++;
}
}
break;
} else {
if (c1>ofs.c2 && c2>ofs.c1) {
offset_arr.splice(i,1);
} else {
i++;
}
}
}
offset_arr.push({
c1:c1,
c2:c2,
trans:isTrans
});
} else {
lcss+=local_cs;
local_cs=0;
if (c1!=c2) {
c1=c2=Math.min(c1,c2); //using min allows the computation of transpositions
}
//if matching characters are found, remove 1 from both cursors (they get incremented at the end of the loop)
//so that we can have only one code block handling matches
for (var j = 0; j < maxOffset && (c1+j<l1 || c2+j<l2); j++) {
if ((c1 + j < l1) && (s1.charAt(c1 + j) == s2.charAt(c2))) {
c1+= j-1;
c2--;
break;
}
if ((c2 + j < l2) && (s1.charAt(c1) == s2.charAt(c2 + j))) {
c1--;
c2+= j-1;
break;
}
}
}
c1++;
c2++;
// this covers the case where the last match is on the last token in list, so that it can compute transpositions correctly
if ((c1 >= l1) || (c2 >= l2)) {
lcss+=local_cs;
local_cs=0;
c1=c2=Math.min(c1,c2);
}
}
lcss+=local_cs;
return Math.round(Math.max(l1,l2)- lcss +trans); //add the cost of transpositions to the final result
},
splitEmail: function(email) {
email = email !== null ? (email.replace(/^\s*/, '').replace(/\s*$/, '')) : null; // trim() not exist in old IE!
var parts = email.split('@');
if (parts.length < 2) {
return false;
}
for (var i = 0; i < parts.length; i++) {
if (parts[i] === '') {
return false;
}
}
var domain = parts.pop();
var domainParts = domain.split('.');
var sld = '';
var tld = '';
if (domainParts.length === 0) {
// The address does not have a top-level domain
return false;
} else if (domainParts.length == 1) {
// The address has only a top-level domain (valid under RFC)
tld = domainParts[0];
} else {
// The address has a domain and a top-level domain
sld = domainParts[0];
for (var j = 1; j < domainParts.length; j++) {
tld += domainParts[j] + '.';
}
tld = tld.substring(0, tld.length - 1);
}
return {
topLevelDomain: tld,
secondLevelDomain: sld,
domain: domain,
address: parts.join('@')
};
},
// Encode the email address to prevent XSS but leave in valid
// characters, following this official spec:
// http://en.wikipedia.org/wiki/Email_address#Syntax
encodeEmail: function(email) {
var result = encodeURI(email);
result = result.replace('%20', ' ').replace('%25', '%').replace('%5E', '^')
.replace('%60', '`').replace('%7B', '{').replace('%7C', '|')
.replace('%7D', '}');
return result;
}
};
// Export the mailcheck object if we're in a CommonJS env (e.g. Node).
// Modeled off of Underscore.js.
if (typeof module !== 'undefined' && module.exports) {
module.exports = Mailcheck;
}
// Support AMD style definitions
// Based on jQuery (see http://stackoverflow.com/a/17954882/1322410)
if (typeof define === "function" && define.amd) {
define("mailcheck", [], function() {
return Mailcheck;
});
}
if (typeof window !== 'undefined' && window.jQuery) {
(function($){
$.fn.mailcheck = function(opts) {
var self = this;
if (opts.suggested) {
var oldSuggested = opts.suggested;
opts.suggested = function(result) {
oldSuggested(self, result);
};
}
if (opts.empty) {
var oldEmpty = opts.empty;
opts.empty = function() {
oldEmpty.call(null, self);
};
}
opts.email = this.val();
Mailcheck.run(opts);
};
})(jQuery);
}
// Getting it to actually show up
var $email = $('#id_email');
var $hint = $('#hint');
$email.on('blur',function() {
$hint.css('display', 'none').empty();
$(this).mailcheck({
suggested: function(element, suggestion) {
if(!$hint.html()) {
// First error - fill in/show entire hint element
var suggestion = "Did you mean <a href='#' class='suggestion'>" + suggestion.full + "</a>?";
$hint.html(suggestion).fadeIn(150);
} else {
// Subsequent errors
$(".suggestion").html(suggestion.full);
}
}
});
});
$hint.on('click', '.suggestion', function() {
// On click, fill in the field with the suggestion and remove the hint
$email.val($(".suggestion").text());
$hint.fadeOut(200, function() {
$(this).empty();
});
return false;
}); </script>
{% endblock %}
{% if analytics_key %}
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '{{ analytics_key }}', 'auto');
ga('send', 'pageview');
</script> {% endif %}
</body>
</html>