ama_layout 2.6.0 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8eac84ea4bf77cfcc13f31f159c75b00607a7ea
4
- data.tar.gz: c7c76ee7a3127c285a418a62e68549b50f3c9b34
3
+ metadata.gz: 416273c0d7ade6a4e92f736aa10970b6b9c9224c
4
+ data.tar.gz: ee0dc5ad4a928099a577d4cb21222964317da30a
5
5
  SHA512:
6
- metadata.gz: 5625b5933afb3cd6a703c806d3aeeb778788b587d963b35483a7f31d5a4d41c078a6f5736a1b8ba5356a434d808ef4a5347fe029c6097bd73d025acbc0f42fbe
7
- data.tar.gz: 1fb5c2cbce4fb7696641d20c9659565d32ace692be971e0bf269bec9545d7b6c91d3bf831dd1c3568ac09a82910f75119b2d1319ba6b2e799992a1a7f51f5997
6
+ metadata.gz: c63ef60ae4218f5012c0bb72672546ef7ac9af548bfa7cafde5657f38c957023cf0514767a4ac91c984eeecae23e4d70c0fd8a1e0add6b37f6b55ed2a1a8fb08
7
+ data.tar.gz: a87bd42dfcc7228d3ab24a86c009818e91a3a486e8f3509159df148d428d34a9c5d613e2b609e68cb1c1023559120d0a5906b58daef11b590fc8384923794d55
@@ -8,5 +8,4 @@
8
8
  //= require ./sticky-footer
9
9
  //= require ./foundation-namespace
10
10
  //= require ./sidebar
11
- //= require ../mailcheck
12
- //= require ../autocorrect_email
11
+ //= require ../mailcheck/index
@@ -0,0 +1,81 @@
1
+ class AMALayout.EmailSuggestion
2
+ constructor: () ->
3
+ @domains = [
4
+ 'msn.com'
5
+ 'bellsouth.net'
6
+ 'telus.net'
7
+ 'telusplanet.net'
8
+ 'comcast.net'
9
+ 'optusnet.com.au'
10
+ 'earthlink.net'
11
+ 'qq.com'
12
+ 'sky.com'
13
+ 'icloud.com'
14
+ 'mac.com'
15
+ 'sympatico.ca'
16
+ 'googlemail.com'
17
+ 'att.net'
18
+ 'xtra.co.nz'
19
+ 'web.de'
20
+ 'cox.net'
21
+ 'gmail.com'
22
+ 'ymail.com'
23
+ 'aim.com'
24
+ 'rogers.com'
25
+ 'verizon.net'
26
+ 'rocketmail.com'
27
+ 'google.com'
28
+ 'optonline.net'
29
+ 'sbcglobal.net'
30
+ 'aol.com'
31
+ 'me.com'
32
+ 'btinternet.com'
33
+ 'charter.net'
34
+ 'shaw.ca'
35
+ 'xplore.com'
36
+ 'abnorth.com'
37
+ 'pentnet.net'
38
+ 'canadasurf.net'
39
+ 'ama.ab.ca'
40
+ ]
41
+ @secondLevelDomains = [
42
+ 'yahoo'
43
+ 'hotmail'
44
+ 'mail'
45
+ 'live'
46
+ 'outlook'
47
+ ]
48
+ @setupEvents()
49
+
50
+ setupEvents: ->
51
+ $('[type="email"]').on 'blur', (e) =>
52
+ $(e.originalEvent.target).mailcheck
53
+ domains: @domains
54
+ secondLevelDomains: @secondLevelDomains
55
+ suggested: (element, suggestion) =>
56
+ text = @suggestionMarkup suggestion.address, suggestion.domain
57
+ if !$('.email_hint').length
58
+ $("<div class='email_hint'>#{text}</div>").insertAfter(element).fadeIn 150
59
+ else
60
+ $('.email_hint').html text
61
+ empty: (element) ->
62
+ $('.email_hint').html ''
63
+
64
+ $(document).on 'click', '.email_hint .suggestion a.email_domain', (e) =>
65
+ @trackUsage()
66
+ email_hint = $(e.originalEvent.target).parents('.email_hint')
67
+ email = $(email_hint).prevAll('input[type=email]:last')
68
+ $(email).val $('.suggestion').first().text()
69
+ $('.email_hint').remove()
70
+
71
+ suggestionMarkup: (address, domain) ->
72
+ "Did you mean " +
73
+ "<span class='suggestion'>" +
74
+ "<span class='address'>#{address}</span>" +
75
+ "@<a href='#' class='email_domain'>#{domain}</a>" +
76
+ "</span>?"
77
+
78
+ trackUsage: () ->
79
+ if window.dataLayer
80
+ domain = $('.email_domain').text()
81
+ dataLayer.push({ "event" : "email-pick-#{domain}" })
@@ -0,0 +1,3 @@
1
+ //= require ./mailcheck
2
+ //= require ./email_suggestion
3
+ //= require ./ready
@@ -0,0 +1,2 @@
1
+ $(document).ready ->
2
+ new AMALayout.EmailSuggestion
@@ -2,5 +2,4 @@
2
2
  //= require ./mobile_menu
3
3
  //= require ./tablesaw.stackonly.js
4
4
  //= require ./ready
5
- //= require ../mailcheck
6
- //= require ../autocorrect_email
5
+ //= require ../mailcheck/index
@@ -1,3 +1,3 @@
1
1
  module AmaLayout
2
- VERSION = '2.6.0'
2
+ VERSION = '2.7.0'
3
3
  end
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.6.0
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael van den Beuken
@@ -18,7 +18,7 @@ authors:
18
18
  autorequire:
19
19
  bindir: bin
20
20
  cert_chain: []
21
- date: 2016-04-05 00:00:00.000000000 Z
21
+ date: 2016-04-06 00:00:00.000000000 Z
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
24
  name: foundation-rails
@@ -247,21 +247,23 @@ files:
247
247
  - app/assets/images/cc-type-mc.png
248
248
  - app/assets/images/cc-type-visa.png
249
249
  - app/assets/images/footer-racetrack-big.png
250
- - app/assets/javascripts/ama_layout/ama_layout_namespace.js.coffee
251
- - app/assets/javascripts/ama_layout/autocorrect_email.js.coffee
252
- - app/assets/javascripts/ama_layout/desktop/drop_down.js.coffee
250
+ - app/assets/javascripts/ama_layout/ama_layout_namespace.coffee
251
+ - app/assets/javascripts/ama_layout/desktop/drop_down.coffee
253
252
  - app/assets/javascripts/ama_layout/desktop/foundation-namespace.coffee
254
- - app/assets/javascripts/ama_layout/desktop/foundation-ready.js.coffee
253
+ - app/assets/javascripts/ama_layout/desktop/foundation-ready.coffee
255
254
  - app/assets/javascripts/ama_layout/desktop/header_menu.coffee
256
255
  - app/assets/javascripts/ama_layout/desktop/index.js
257
- - app/assets/javascripts/ama_layout/desktop/ready.js.coffee
256
+ - app/assets/javascripts/ama_layout/desktop/ready.coffee
258
257
  - app/assets/javascripts/ama_layout/desktop/sidebar.coffee
259
258
  - app/assets/javascripts/ama_layout/desktop/sticky-footer.coffee
260
- - app/assets/javascripts/ama_layout/desktop/toggle_menu.js.coffee
261
- - app/assets/javascripts/ama_layout/mailcheck.js
259
+ - app/assets/javascripts/ama_layout/desktop/toggle_menu.coffee
260
+ - app/assets/javascripts/ama_layout/mailcheck/email_suggestion.coffee
261
+ - app/assets/javascripts/ama_layout/mailcheck/index.js
262
+ - app/assets/javascripts/ama_layout/mailcheck/mailcheck.js
263
+ - app/assets/javascripts/ama_layout/mailcheck/ready.coffee
262
264
  - app/assets/javascripts/ama_layout/mobile/index.js
263
- - app/assets/javascripts/ama_layout/mobile/mobile_menu.js.coffee
264
- - app/assets/javascripts/ama_layout/mobile/ready.js.coffee
265
+ - app/assets/javascripts/ama_layout/mobile/mobile_menu.coffee
266
+ - app/assets/javascripts/ama_layout/mobile/ready.coffee
265
267
  - app/assets/javascripts/ama_layout/mobile/tablesaw.stackonly.js
266
268
  - app/assets/stylesheets/ama_layout/application.scss
267
269
  - app/assets/stylesheets/ama_layout/foundation_and_overrides.scss
@@ -363,7 +365,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
363
365
  version: '0'
364
366
  requirements: []
365
367
  rubyforge_project:
366
- rubygems_version: 2.4.5
368
+ rubygems_version: 2.2.0
367
369
  signing_key:
368
370
  specification_version: 4
369
371
  summary: ".ama.ab.ca site layouts"
@@ -1,76 +0,0 @@
1
- window.onload = ->
2
- domains = [
3
- 'msn.com'
4
- 'bellsouth.net'
5
- 'telus.net'
6
- 'telusplanet.net'
7
- 'comcast.net'
8
- 'optusnet.com.au'
9
- 'earthlink.net'
10
- 'qq.com'
11
- 'sky.com'
12
- 'icloud.com'
13
- 'mac.com'
14
- 'sympatico.ca'
15
- 'googlemail.com'
16
- 'att.net'
17
- 'xtra.co.nz'
18
- 'web.de'
19
- 'cox.net'
20
- 'gmail.com'
21
- 'ymail.com'
22
- 'aim.com'
23
- 'rogers.com'
24
- 'verizon.net'
25
- 'rocketmail.com'
26
- 'google.com'
27
- 'optonline.net'
28
- 'sbcglobal.net'
29
- 'aol.com'
30
- 'me.com'
31
- 'btinternet.com'
32
- 'charter.net'
33
- 'shaw.ca'
34
- 'xplore.com'
35
- 'abnorth.com'
36
- 'pentnet.net'
37
- 'canadasurf.net'
38
- 'ama.ab.ca'
39
- ]
40
-
41
- secondLevelDomains = [
42
- 'yahoo'
43
- 'hotmail'
44
- 'mail'
45
- 'live'
46
- 'outlook'
47
- ]
48
-
49
- $email = $('[type="email"]')
50
- $email.on 'blur', ->
51
- $(this).mailcheck
52
- domains: domains
53
- secondLevelDomains: secondLevelDomains
54
- suggested: (element, suggestion) ->
55
- text = 'Did you mean ' +
56
- '<span class="suggestion">' +
57
- '<span class="address">' + suggestion.address + '</span>' +
58
- '@<a href="#" class="email_domain">' + suggestion.domain + '</a>' +
59
- '</span>?'
60
- if !$('.email_hint').length
61
- $('<div class="email_hint">' + text + '</div>').insertAfter(element).fadeIn 150
62
- else
63
- $('.email_hint').html text
64
- return
65
- empty: (element) ->
66
- $('.email_hint').html ''
67
- return
68
- return
69
-
70
- $(document).on 'click', '.email_hint .suggestion a.email_domain', ->
71
- email_hint = $(this).parents('.email_hint')
72
- email = $(email_hint).prevAll('input[type=email]:last')
73
- $(email).val $('.suggestion').first().text()
74
- $('.email_hint').remove()
75
- false
76
- return