ama_layout 2.2.11 → 2.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/assets/javascripts/ama_layout/autocorrect_email.js.coffee +75 -0
- data/app/assets/javascripts/ama_layout/desktop/index.js +1 -0
- data/app/assets/javascripts/ama_layout/mobile/index.js +1 -0
- data/lib/ama_layout/version.rb +1 -1
- metadata +5 -5
- data/app/assets/javascripts/ama_layout/autocorrect_email.js +0 -40
@@ -0,0 +1,75 @@
|
|
1
|
+
window.onload = ->
|
2
|
+
domains = [
|
3
|
+
'msn.com'
|
4
|
+
'bellsouth.net'
|
5
|
+
'telus.net'
|
6
|
+
'comcast.net'
|
7
|
+
'optusnet.com.au'
|
8
|
+
'earthlink.net'
|
9
|
+
'qq.com'
|
10
|
+
'sky.com'
|
11
|
+
'icloud.com'
|
12
|
+
'mac.com'
|
13
|
+
'sympatico.ca'
|
14
|
+
'googlemail.com'
|
15
|
+
'att.net'
|
16
|
+
'xtra.co.nz'
|
17
|
+
'web.de'
|
18
|
+
'cox.net'
|
19
|
+
'gmail.com'
|
20
|
+
'ymail.com'
|
21
|
+
'aim.com'
|
22
|
+
'rogers.com'
|
23
|
+
'verizon.net'
|
24
|
+
'rocketmail.com'
|
25
|
+
'google.com'
|
26
|
+
'optonline.net'
|
27
|
+
'sbcglobal.net'
|
28
|
+
'aol.com'
|
29
|
+
'me.com'
|
30
|
+
'btinternet.com'
|
31
|
+
'charter.net'
|
32
|
+
'shaw.ca'
|
33
|
+
'xplore.com'
|
34
|
+
'abnorth.com'
|
35
|
+
'pentnet.net'
|
36
|
+
'canadasurf.net'
|
37
|
+
'ama.ab.ca'
|
38
|
+
]
|
39
|
+
|
40
|
+
secondLevelDomains = [
|
41
|
+
'yahoo'
|
42
|
+
'hotmail'
|
43
|
+
'mail'
|
44
|
+
'live'
|
45
|
+
'outlook'
|
46
|
+
]
|
47
|
+
|
48
|
+
$email = $('[type="email"]')
|
49
|
+
$email.on 'blur', ->
|
50
|
+
$(this).mailcheck
|
51
|
+
domains: domains
|
52
|
+
secondLevelDomains: secondLevelDomains
|
53
|
+
suggested: (element, suggestion) ->
|
54
|
+
text = 'Did you mean ' +
|
55
|
+
'<span class="suggestion">' +
|
56
|
+
'<span class="address">' + suggestion.address + '</span>' +
|
57
|
+
'@<a href="#" class="email_domain">' + suggestion.domain + '</a>' +
|
58
|
+
'</span>?'
|
59
|
+
if !$('.email_hint').length
|
60
|
+
$('<div class="email_hint">' + text + '</div>').insertAfter(element).fadeIn 150
|
61
|
+
else
|
62
|
+
$('.email_hint').html text
|
63
|
+
return
|
64
|
+
empty: (element) ->
|
65
|
+
$('.email_hint').html ''
|
66
|
+
return
|
67
|
+
return
|
68
|
+
|
69
|
+
$(document).on 'click', '.email_hint .suggestion a.email_domain', ->
|
70
|
+
email_hint = $(this).parents('.email_hint')
|
71
|
+
email = $(email_hint).prevAll('input[type=email]:last')
|
72
|
+
$(email).val $('.suggestion').first().text()
|
73
|
+
$('.email_hint').remove()
|
74
|
+
false
|
75
|
+
return
|
data/lib/ama_layout/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ama_layout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -18,7 +18,7 @@ authors:
|
|
18
18
|
autorequire:
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
|
-
date: 2016-01-
|
21
|
+
date: 2016-01-25 00:00:00.000000000 Z
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
24
|
name: foundation-rails
|
@@ -257,7 +257,7 @@ files:
|
|
257
257
|
- app/assets/images/alberta-blur.jpg
|
258
258
|
- app/assets/images/footer-racetrack-big.png
|
259
259
|
- app/assets/javascripts/ama_layout/ama_layout_namespace.js.coffee
|
260
|
-
- app/assets/javascripts/ama_layout/autocorrect_email.js
|
260
|
+
- app/assets/javascripts/ama_layout/autocorrect_email.js.coffee
|
261
261
|
- app/assets/javascripts/ama_layout/desktop/drop_down.js.coffee
|
262
262
|
- app/assets/javascripts/ama_layout/desktop/foundation-namespace.coffee
|
263
263
|
- app/assets/javascripts/ama_layout/desktop/foundation-ready.js.coffee
|
@@ -360,7 +360,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
360
360
|
version: '0'
|
361
361
|
segments:
|
362
362
|
- 0
|
363
|
-
hash:
|
363
|
+
hash: 3628484526284834156
|
364
364
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
365
365
|
none: false
|
366
366
|
requirements:
|
@@ -369,7 +369,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
369
369
|
version: '0'
|
370
370
|
segments:
|
371
371
|
- 0
|
372
|
-
hash:
|
372
|
+
hash: 3628484526284834156
|
373
373
|
requirements: []
|
374
374
|
rubyforge_project:
|
375
375
|
rubygems_version: 1.8.23
|
@@ -1,40 +0,0 @@
|
|
1
|
-
var domains = ['msn.com', 'bellsouth.net', 'telus.net', 'comcast.net', 'optusnet.com.au', 'earthlink.net', 'qq.com',
|
2
|
-
'sky.com', 'icloud.com', 'mac.com', 'sympatico.ca', 'googlemail.com', 'att.net', 'xtra.co.nz', 'web.de',
|
3
|
-
'cox.net', 'gmail.com', 'ymail.com', 'aim.com', 'rogers.com', 'verizon.net', 'rocketmail.com',
|
4
|
-
'google.com', 'optonline.net', 'sbcglobal.net', 'aol.com', 'me.com', 'btinternet.com', 'charter.net',
|
5
|
-
'shaw.ca', 'xplore.com', 'abnorth.com', 'pentnet.net', 'canadasurf.net', "ama.ab.ca"];
|
6
|
-
|
7
|
-
var secondLevelDomains = ["yahoo", "hotmail", "mail", "live", "outlook"]
|
8
|
-
|
9
|
-
var $email = $('[type="email"]');
|
10
|
-
var $hint = $("*.email_hint");
|
11
|
-
|
12
|
-
$email.on('blur', function() {
|
13
|
-
$(this).mailcheck({
|
14
|
-
domains: domains,
|
15
|
-
secondLevelDomains: secondLevelDomains,
|
16
|
-
suggested: function(element, suggestion) {
|
17
|
-
var text = "Did you mean <span class='suggestion'>" +
|
18
|
-
"<span class='address'>" + suggestion.address + "</span>" +
|
19
|
-
"@<a href='#' class='email_domain'>" + suggestion.domain +
|
20
|
-
"</a></span>?";
|
21
|
-
|
22
|
-
element.nextAll(".email_hint:first").html(text).fadeIn(150);
|
23
|
-
},
|
24
|
-
empty: function(element) {
|
25
|
-
element.nextAll(".email_hint:first").html("");
|
26
|
-
}
|
27
|
-
});
|
28
|
-
});
|
29
|
-
|
30
|
-
$hint.on('click', '.email_domain', function() {
|
31
|
-
email_hint = $(this).parents(".email_hint");
|
32
|
-
email = $(email_hint).prevAll('input[type=email]:last');
|
33
|
-
|
34
|
-
$(email).val($(".suggestion").first().text());
|
35
|
-
|
36
|
-
$(email_hint).fadeOut(200, function() {
|
37
|
-
$(this).empty();
|
38
|
-
});
|
39
|
-
return false;
|
40
|
-
});
|