workarea-hover_zoom 3.0.0

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.
Files changed (80) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +20 -0
  3. data/.eslintignore +2 -0
  4. data/.eslintrc +24 -0
  5. data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
  6. data/.github/ISSUE_TEMPLATE/documentation-request.md +17 -0
  7. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  8. data/.github/workflows/ci.yml +54 -0
  9. data/.gitignore +13 -0
  10. data/.rspec +2 -0
  11. data/.rubocop.yml +2 -0
  12. data/.scss-lint.yml +188 -0
  13. data/CHANGELOG.md +25 -0
  14. data/CODE_OF_CONDUCT.md +3 -0
  15. data/CONTRIBUTING.md +3 -0
  16. data/Gemfile +8 -0
  17. data/LICENSE.md +3 -0
  18. data/README.md +130 -0
  19. data/Rakefile +43 -0
  20. data/app/assets/javascripts/workarea/storefront/hover_zoom/config.js +12 -0
  21. data/app/assets/javascripts/workarea/storefront/hover_zoom/modules/hover_zooms.js +64 -0
  22. data/app/assets/stylesheets/workarea/storefront/hover_zoom/components/_hover_zoom.scss +5 -0
  23. data/bin/rails +14 -0
  24. data/config/initializers/appends.rb +16 -0
  25. data/lib/workarea/hover_zoom.rb +13 -0
  26. data/lib/workarea/hover_zoom/engine.rb +8 -0
  27. data/lib/workarea/hover_zoom/version.rb +5 -0
  28. data/test/dummy/Rakefile +6 -0
  29. data/test/dummy/app/assets/config/manifest.js +4 -0
  30. data/test/dummy/app/assets/images/.keep +0 -0
  31. data/test/dummy/app/assets/javascripts/application.js +13 -0
  32. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  33. data/test/dummy/app/controllers/application_controller.rb +3 -0
  34. data/test/dummy/app/controllers/concerns/.keep +0 -0
  35. data/test/dummy/app/helpers/application_helper.rb +2 -0
  36. data/test/dummy/app/jobs/application_job.rb +2 -0
  37. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  38. data/test/dummy/app/models/concerns/.keep +0 -0
  39. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  40. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  41. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  42. data/test/dummy/bin/bundle +3 -0
  43. data/test/dummy/bin/rails +4 -0
  44. data/test/dummy/bin/rake +4 -0
  45. data/test/dummy/bin/setup +34 -0
  46. data/test/dummy/bin/update +29 -0
  47. data/test/dummy/config.ru +5 -0
  48. data/test/dummy/config/application.rb +26 -0
  49. data/test/dummy/config/boot.rb +5 -0
  50. data/test/dummy/config/cable.yml +9 -0
  51. data/test/dummy/config/environment.rb +5 -0
  52. data/test/dummy/config/environments/development.rb +54 -0
  53. data/test/dummy/config/environments/production.rb +86 -0
  54. data/test/dummy/config/environments/test.rb +43 -0
  55. data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
  56. data/test/dummy/config/initializers/assets.rb +11 -0
  57. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  58. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  59. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  60. data/test/dummy/config/initializers/inflections.rb +16 -0
  61. data/test/dummy/config/initializers/mime_types.rb +4 -0
  62. data/test/dummy/config/initializers/workarea.rb +5 -0
  63. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  64. data/test/dummy/config/locales/en.yml +23 -0
  65. data/test/dummy/config/puma.rb +47 -0
  66. data/test/dummy/config/routes.rb +5 -0
  67. data/test/dummy/config/secrets.yml +22 -0
  68. data/test/dummy/config/spring.rb +6 -0
  69. data/test/dummy/lib/assets/.keep +0 -0
  70. data/test/dummy/log/.keep +0 -0
  71. data/test/dummy/public/404.html +67 -0
  72. data/test/dummy/public/422.html +67 -0
  73. data/test/dummy/public/500.html +66 -0
  74. data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
  75. data/test/dummy/public/apple-touch-icon.png +0 -0
  76. data/test/dummy/public/favicon.ico +0 -0
  77. data/test/system/workarea/storefront/hover_zoom_test.rb +49 -0
  78. data/test/test_helper.rb +10 -0
  79. data/workarea-hover_zoom.gemspec +23 -0
  80. metadata +164 -0
@@ -0,0 +1,5 @@
1
+ Rails.application.routes.draw do
2
+ mount Workarea::Core::Engine => '/'
3
+ mount Workarea::Admin::Engine => '/admin', as: 'admin'
4
+ mount Workarea::Storefront::Engine => '/', as: 'storefront'
5
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rails secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: 355cb53c035eea94d0d991f8bcbf9891e97001012f41ff592444d18fad5cf834469fcf0a3fae691ffe9ef56e9817c78c46d9bd1bc475d141e536e38988598b4d
15
+
16
+ test:
17
+ secret_key_base: 97c0daf9a898cc67db49e886f79604590d9c3ee46915430fea434fa63dc40faaaa61739094b6899a84f1267c8f3f984778ada1cbda14b3c93ca224fd2ac1211f
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,6 @@
1
+ %w(
2
+ .ruby-version
3
+ .rbenv-vars
4
+ tmp/restart.txt
5
+ tmp/caching-dev.txt
6
+ ).each { |path| Spring.watch(path) }
File without changes
File without changes
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/404.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The page you were looking for doesn't exist.</h1>
62
+ <p>You may have mistyped the address or the page may have moved.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+ </body>
66
+ </html>
File without changes
File without changes
@@ -0,0 +1,49 @@
1
+ require 'test_helper'
2
+
3
+ module Workarea
4
+ module Storefront
5
+ class HoverZoomTest < Workarea::SystemTest
6
+ include BreakpointHelpers
7
+
8
+ def test_setup_zoom_image_on_desktop
9
+ visit storefront.product_path(create_product)
10
+
11
+ primary_image_link.hover
12
+ wait_for_xhr
13
+
14
+ assert plugin_magnify?
15
+ end
16
+
17
+ def test_setup_zoom_image_on_mobile
18
+ resize_window_to('small')
19
+ visit storefront.product_path(create_product)
20
+
21
+ wait_for_xhr
22
+
23
+ assert plugin_zoom?
24
+ end
25
+
26
+ private
27
+
28
+ def primary_image
29
+ page.find('.product-details__primary-image')
30
+ end
31
+
32
+ def primary_image_link
33
+ primary_image.find('a')
34
+ end
35
+
36
+ def plugin_magnify?
37
+ has_class?(primary_image, 'hover-zoom--magnify')
38
+ end
39
+
40
+ def plugin_zoom?
41
+ has_class?(primary_image, 'hover-zoom--zoom')
42
+ end
43
+
44
+ def has_class?(element, klass)
45
+ element[:class].split.include?(klass)
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,10 @@
1
+ # Configure Rails Environment
2
+ ENV['RAILS_ENV'] = 'test'
3
+
4
+ require File.expand_path('../../test/dummy/config/environment.rb', __FILE__)
5
+ require 'rails/test_help'
6
+ require 'workarea/test_help'
7
+
8
+ # Filter out Minitest backtrace while allowing backtrace from other libraries
9
+ # to be shown.
10
+ Minitest.backtrace_filter = Minitest::BacktraceFilter.new
@@ -0,0 +1,23 @@
1
+ $:.push File.expand_path('../lib', __FILE__)
2
+
3
+ # Maintain your gem's version:
4
+ require 'workarea/hover_zoom/version'
5
+
6
+ # Describe your gem and declare its dependencies:
7
+ Gem::Specification.new do |s|
8
+ s.name = 'workarea-hover_zoom'
9
+ s.version = Workarea::HoverZoom::VERSION
10
+ s.authors = ['Curt Howard', 'Ges Jeremie']
11
+ s.email = ['choward@workarea.com', 'jges@weblinc.com']
12
+ s.summary = 'A Hover Zoom plugin for Product Detail Pages.'
13
+ s.description = 'This plugin adds zoom capabilities (desktop/mobile) on primary images.'
14
+ s.files = `git ls-files`.split("\n")
15
+ # s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]
16
+
17
+ s.required_ruby_version = '>= 2.3.0'
18
+
19
+ s.add_dependency 'workarea-jquery_zoom'
20
+ s.add_dependency 'workarea-jquery_magnify'
21
+
22
+ s.add_dependency 'workarea', '~> 3.x'
23
+ end
metadata ADDED
@@ -0,0 +1,164 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: workarea-hover_zoom
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Curt Howard
8
+ - Ges Jeremie
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2019-12-06 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: workarea-jquery_zoom
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: workarea-jquery_magnify
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: workarea
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: 3.x
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: 3.x
56
+ description: This plugin adds zoom capabilities (desktop/mobile) on primary images.
57
+ email:
58
+ - choward@workarea.com
59
+ - jges@weblinc.com
60
+ executables: []
61
+ extensions: []
62
+ extra_rdoc_files: []
63
+ files:
64
+ - ".editorconfig"
65
+ - ".eslintignore"
66
+ - ".eslintrc"
67
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
68
+ - ".github/ISSUE_TEMPLATE/documentation-request.md"
69
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
70
+ - ".github/workflows/ci.yml"
71
+ - ".gitignore"
72
+ - ".rspec"
73
+ - ".rubocop.yml"
74
+ - ".scss-lint.yml"
75
+ - CHANGELOG.md
76
+ - CODE_OF_CONDUCT.md
77
+ - CONTRIBUTING.md
78
+ - Gemfile
79
+ - LICENSE.md
80
+ - README.md
81
+ - Rakefile
82
+ - app/assets/javascripts/workarea/storefront/hover_zoom/config.js
83
+ - app/assets/javascripts/workarea/storefront/hover_zoom/modules/hover_zooms.js
84
+ - app/assets/stylesheets/workarea/storefront/hover_zoom/components/_hover_zoom.scss
85
+ - bin/rails
86
+ - config/initializers/appends.rb
87
+ - lib/workarea/hover_zoom.rb
88
+ - lib/workarea/hover_zoom/engine.rb
89
+ - lib/workarea/hover_zoom/version.rb
90
+ - test/dummy/Rakefile
91
+ - test/dummy/app/assets/config/manifest.js
92
+ - test/dummy/app/assets/images/.keep
93
+ - test/dummy/app/assets/javascripts/application.js
94
+ - test/dummy/app/assets/stylesheets/application.css
95
+ - test/dummy/app/controllers/application_controller.rb
96
+ - test/dummy/app/controllers/concerns/.keep
97
+ - test/dummy/app/helpers/application_helper.rb
98
+ - test/dummy/app/jobs/application_job.rb
99
+ - test/dummy/app/mailers/application_mailer.rb
100
+ - test/dummy/app/models/concerns/.keep
101
+ - test/dummy/app/views/layouts/application.html.erb
102
+ - test/dummy/app/views/layouts/mailer.html.erb
103
+ - test/dummy/app/views/layouts/mailer.text.erb
104
+ - test/dummy/bin/bundle
105
+ - test/dummy/bin/rails
106
+ - test/dummy/bin/rake
107
+ - test/dummy/bin/setup
108
+ - test/dummy/bin/update
109
+ - test/dummy/config.ru
110
+ - test/dummy/config/application.rb
111
+ - test/dummy/config/boot.rb
112
+ - test/dummy/config/cable.yml
113
+ - test/dummy/config/environment.rb
114
+ - test/dummy/config/environments/development.rb
115
+ - test/dummy/config/environments/production.rb
116
+ - test/dummy/config/environments/test.rb
117
+ - test/dummy/config/initializers/application_controller_renderer.rb
118
+ - test/dummy/config/initializers/assets.rb
119
+ - test/dummy/config/initializers/backtrace_silencers.rb
120
+ - test/dummy/config/initializers/cookies_serializer.rb
121
+ - test/dummy/config/initializers/filter_parameter_logging.rb
122
+ - test/dummy/config/initializers/inflections.rb
123
+ - test/dummy/config/initializers/mime_types.rb
124
+ - test/dummy/config/initializers/workarea.rb
125
+ - test/dummy/config/initializers/wrap_parameters.rb
126
+ - test/dummy/config/locales/en.yml
127
+ - test/dummy/config/puma.rb
128
+ - test/dummy/config/routes.rb
129
+ - test/dummy/config/secrets.yml
130
+ - test/dummy/config/spring.rb
131
+ - test/dummy/lib/assets/.keep
132
+ - test/dummy/log/.keep
133
+ - test/dummy/public/404.html
134
+ - test/dummy/public/422.html
135
+ - test/dummy/public/500.html
136
+ - test/dummy/public/apple-touch-icon-precomposed.png
137
+ - test/dummy/public/apple-touch-icon.png
138
+ - test/dummy/public/favicon.ico
139
+ - test/system/workarea/storefront/hover_zoom_test.rb
140
+ - test/test_helper.rb
141
+ - workarea-hover_zoom.gemspec
142
+ homepage:
143
+ licenses: []
144
+ metadata: {}
145
+ post_install_message:
146
+ rdoc_options: []
147
+ require_paths:
148
+ - lib
149
+ required_ruby_version: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ version: 2.3.0
154
+ required_rubygems_version: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
159
+ requirements: []
160
+ rubygems_version: 3.0.6
161
+ signing_key:
162
+ specification_version: 4
163
+ summary: A Hover Zoom plugin for Product Detail Pages.
164
+ test_files: []