workarea-jquery_zoom 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +20 -0
- data/.eslintrc.json +35 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
- data/.github/ISSUE_TEMPLATE/documentation-request.md +17 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.github/workflows/ci.yml +54 -0
- data/.gitignore +21 -0
- data/.rubocop.yml +2 -0
- data/CHANGELOG.md +1 -0
- data/CODE_OF_CONDUCT.md +3 -0
- data/CONTRIBUTING.md +3 -0
- data/Gemfile +6 -0
- data/LICENSE.md +3 -0
- data/README.md +100 -0
- data/Rakefile +109 -0
- data/app/assets/javascripts/jquery_zoom/jquery.zoom.js +610 -0
- data/bin/rails +20 -0
- data/config/initializers/appends.rb +7 -0
- data/config/initializers/workarea.rb +3 -0
- data/config/routes.rb +2 -0
- data/lib/tasks/jquery_zoom_tasks.rake +4 -0
- data/lib/workarea/jquery_zoom.rb +11 -0
- data/lib/workarea/jquery_zoom/engine.rb +9 -0
- data/lib/workarea/jquery_zoom/version.rb +5 -0
- data/package.json +9 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/config/manifest.js +4 -0
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/jobs/application_job.rb +2 -0
- data/test/dummy/app/mailers/application_mailer.rb +4 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +38 -0
- data/test/dummy/bin/update +29 -0
- data/test/dummy/bin/yarn +11 -0
- data/test/dummy/config.ru +5 -0
- data/test/dummy/config/application.rb +28 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/cable.yml +10 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +54 -0
- data/test/dummy/config/environments/production.rb +91 -0
- data/test/dummy/config/environments/test.rb +44 -0
- data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/test/dummy/config/initializers/assets.rb +14 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/workarea.rb +5 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +33 -0
- data/test/dummy/config/puma.rb +56 -0
- data/test/dummy/config/routes.rb +5 -0
- data/test/dummy/config/secrets.yml +32 -0
- data/test/dummy/config/spring.rb +6 -0
- data/test/dummy/db/seeds.rb +2 -0
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/dummy/package.json +5 -0
- data/test/teaspoon_env.rb +6 -0
- data/test/test_helper.rb +10 -0
- data/workarea-jquery_zoom.gemspec +22 -0
- data/yarn.lock +3290 -0
- metadata +147 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bc4ad932f9d3196ef02457fef2f0beccddec6650b5739567419eda1a4d625cbe
|
4
|
+
data.tar.gz: 134d450b6f476e7ad949544b9789d071cc9bad8cb17f3c6453400eb4fc7e602a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0af9e3f90dee9bf4f69985034e5c9e7a59805cc30e2a7c596657368fc56d7f5cd50a22bd1ca3441f58a5d230283ddb0bba7c4ecec3c7a8fffb3b92366e9b82c7
|
7
|
+
data.tar.gz: b29220e48ca4af1d662cb220ad1562dd82f1a2c1116260c1771a284d883daf7853b4095ea06a7e8264cc16440307ee35d8b43d414f99bf8eaa7b507c21ab795b
|
data/.editorconfig
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# editorconfig.org
|
2
|
+
root = true
|
3
|
+
|
4
|
+
[*]
|
5
|
+
charset = utf-8
|
6
|
+
indent_style = space
|
7
|
+
end_of_line = lf
|
8
|
+
trim_trailing_whitespace = true
|
9
|
+
insert_final_newline = true
|
10
|
+
|
11
|
+
[{*.rb,*.haml,*.decorator,*.yml,*.yaml,*.jbuilder}]
|
12
|
+
indent_size = 2
|
13
|
+
indent_style = space
|
14
|
+
|
15
|
+
[{*.js,*.jst,*.ejs,*.scss}]
|
16
|
+
indent_size = 4
|
17
|
+
|
18
|
+
[*.md]
|
19
|
+
indent_size = 4
|
20
|
+
trim_trailing_whitespace = false
|
data/.eslintrc.json
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
{
|
2
|
+
"extends": "eslint:recommended",
|
3
|
+
"rules": {
|
4
|
+
"semi": ["error", "always"],
|
5
|
+
"eqeqeq": ["error", "always"]
|
6
|
+
},
|
7
|
+
"globals": {
|
8
|
+
"window": true,
|
9
|
+
"document": true,
|
10
|
+
"WORKAREA": true,
|
11
|
+
"$": true,
|
12
|
+
"jQuery": true,
|
13
|
+
"_": true,
|
14
|
+
"feature": true,
|
15
|
+
"JST": true,
|
16
|
+
"Turbolinks": true,
|
17
|
+
"I18n": true,
|
18
|
+
"Chart": true,
|
19
|
+
"Dropzone": true,
|
20
|
+
"strftime": true,
|
21
|
+
"Waypoint": true,
|
22
|
+
"wysihtml": true,
|
23
|
+
"LocalTime": true,
|
24
|
+
"describe": true,
|
25
|
+
"after": true,
|
26
|
+
"afterEach": true,
|
27
|
+
"before": true,
|
28
|
+
"beforeEach": true,
|
29
|
+
"it": true,
|
30
|
+
"expect": true,
|
31
|
+
"sinon": true,
|
32
|
+
"fixture": true,
|
33
|
+
"chai": true
|
34
|
+
}
|
35
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve Workarea
|
4
|
+
title: ''
|
5
|
+
labels: bug
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
⚠️**Before you create**⚠️
|
11
|
+
Please verify the issue you're experiencing is not part of your Workarea project customizations. The best way to do this is with a [vanilla Workarea installation](https://developer.workarea.com/articles/create-a-new-host-application.html). This will help us spend time on fixes/improvements for the whole community. Thank you!
|
12
|
+
|
13
|
+
**Describe the bug**
|
14
|
+
A clear and concise description of what the bug is.
|
15
|
+
|
16
|
+
**To Reproduce**
|
17
|
+
Steps to reproduce the behavior:
|
18
|
+
1. Go to '...'
|
19
|
+
2. Click on '....'
|
20
|
+
3. Scroll down to '....'
|
21
|
+
4. See error
|
22
|
+
|
23
|
+
**Expected behavior**
|
24
|
+
A clear and concise description of what you expected to happen.
|
25
|
+
|
26
|
+
**Workarea Setup (please complete the following information):**
|
27
|
+
- Workarea Version: [e.g. v3.4.6]
|
28
|
+
- Plugins [e.g. workarea-blog, workarea-sitemaps]
|
29
|
+
|
30
|
+
**Attachments**
|
31
|
+
If applicable, add any attachments to help explain your problem, things like:
|
32
|
+
- screenshots
|
33
|
+
- Gemfile.lock
|
34
|
+
- test cases
|
35
|
+
|
36
|
+
**Additional context**
|
37
|
+
Add any other context about the problem here.
|
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
name: Documentation request
|
3
|
+
about: Suggest documentation
|
4
|
+
title: ''
|
5
|
+
labels: documentation
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Is your documentation related to a problem? Please describe.**
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm confused by [...]
|
12
|
+
|
13
|
+
**Describe the article you'd like**
|
14
|
+
A clear and concise description of what would be in the documentation article.
|
15
|
+
|
16
|
+
**Additional context**
|
17
|
+
Add any other context or screenshots about the feature request here.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
name: Feature request
|
3
|
+
about: Suggest an idea for Workarea
|
4
|
+
title: ''
|
5
|
+
labels: enhancement
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
12
|
+
|
13
|
+
**Describe the solution you'd like**
|
14
|
+
A clear and concise description of what you want to happen.
|
15
|
+
|
16
|
+
**Describe alternatives you've considered**
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
18
|
+
|
19
|
+
**Additional context**
|
20
|
+
Add any other context or screenshots about the feature request here.
|
@@ -0,0 +1,54 @@
|
|
1
|
+
name: CI
|
2
|
+
on: [push]
|
3
|
+
|
4
|
+
jobs:
|
5
|
+
static_analysis:
|
6
|
+
runs-on: ubuntu-latest
|
7
|
+
steps:
|
8
|
+
- uses: actions/checkout@v1
|
9
|
+
- uses: workarea-commerce/ci/bundler-audit@v1
|
10
|
+
- uses: workarea-commerce/ci/rubocop@v1
|
11
|
+
|
12
|
+
admin_tests:
|
13
|
+
runs-on: ubuntu-latest
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v1
|
16
|
+
- uses: actions/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: 2.6.x
|
19
|
+
- uses: workarea-commerce/ci/test@v1
|
20
|
+
with:
|
21
|
+
command: bin/rails app:workarea:test:admin
|
22
|
+
|
23
|
+
core_tests:
|
24
|
+
runs-on: ubuntu-latest
|
25
|
+
steps:
|
26
|
+
- uses: actions/checkout@v1
|
27
|
+
- uses: actions/setup-ruby@v1
|
28
|
+
with:
|
29
|
+
ruby-version: 2.6.x
|
30
|
+
- uses: workarea-commerce/ci/test@v1
|
31
|
+
with:
|
32
|
+
command: bin/rails app:workarea:test:core
|
33
|
+
|
34
|
+
storefront_tests:
|
35
|
+
runs-on: ubuntu-latest
|
36
|
+
steps:
|
37
|
+
- uses: actions/checkout@v1
|
38
|
+
- uses: actions/setup-ruby@v1
|
39
|
+
with:
|
40
|
+
ruby-version: 2.6.x
|
41
|
+
- uses: workarea-commerce/ci/test@v1
|
42
|
+
with:
|
43
|
+
command: bin/rails app:workarea:test:storefront
|
44
|
+
|
45
|
+
plugins_tests:
|
46
|
+
runs-on: ubuntu-latest
|
47
|
+
steps:
|
48
|
+
- uses: actions/checkout@v1
|
49
|
+
- uses: actions/setup-ruby@v1
|
50
|
+
with:
|
51
|
+
ruby-version: 2.6.x
|
52
|
+
- uses: workarea-commerce/ci/test@v1
|
53
|
+
with:
|
54
|
+
command: bin/rails app:workarea:test:plugins
|
data/.gitignore
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
.bundle/
|
2
|
+
log/*.log
|
3
|
+
pkg/
|
4
|
+
test/dummy/db/*.sqlite3
|
5
|
+
test/dummy/db/*.sqlite3-journal
|
6
|
+
test/dummy/log/*.log
|
7
|
+
test/dummy/tmp/
|
8
|
+
.DS_Store
|
9
|
+
.byebug_history
|
10
|
+
.bundle/
|
11
|
+
.sass-cache/
|
12
|
+
Gemfile.lock
|
13
|
+
pkg/
|
14
|
+
test/dummy/tmp/
|
15
|
+
test/dummy/public/
|
16
|
+
log/*.log
|
17
|
+
test/dummy/log/*.log
|
18
|
+
test/dummy/db/*.sqlite3
|
19
|
+
test/dummy/db/*.sqlite3-journal
|
20
|
+
node_modules/
|
21
|
+
.rubocop-http*
|
data/.rubocop.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
|
data/CODE_OF_CONDUCT.md
ADDED
data/CONTRIBUTING.md
ADDED
data/Gemfile
ADDED
data/LICENSE.md
ADDED
data/README.md
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
Workarea Jquery Zoom
|
2
|
+
================================================================================
|
3
|
+
|
4
|
+
Note: This work is in progress and part of the workarea-zoom plugin.
|
5
|
+
|
6
|
+
About
|
7
|
+
--------------------------------------------------------------------------------
|
8
|
+
Jquery Zoom add image zoom capabilities on touch enabled devices and is a great candidate for phone/tablet devices.
|
9
|
+
|
10
|
+
|
11
|
+
Getting Started
|
12
|
+
--------------------------------------------------------------------------------
|
13
|
+
|
14
|
+
Add the gem to your application's Gemfile:
|
15
|
+
|
16
|
+
# ...
|
17
|
+
gem 'workarea-jquery_zoom'
|
18
|
+
# ...
|
19
|
+
|
20
|
+
|
21
|
+
Example
|
22
|
+
--------------------------------------------------------------------------------
|
23
|
+
|
24
|
+
```html
|
25
|
+
<div class="zoom">
|
26
|
+
<div data-zoom-src="http://example.com/big-image.jpg" class="zoom__container">
|
27
|
+
<img src="http://example.com/thumbnail-image.jpg" class="zoom__image">
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
```
|
31
|
+
|
32
|
+
```css
|
33
|
+
.zoom {
|
34
|
+
width: 320px;
|
35
|
+
}
|
36
|
+
|
37
|
+
.zoom__container {
|
38
|
+
position: relative;
|
39
|
+
}
|
40
|
+
|
41
|
+
.zoom__image {
|
42
|
+
display: block;
|
43
|
+
width: 100%;
|
44
|
+
min-width: 100%;
|
45
|
+
}
|
46
|
+
```
|
47
|
+
|
48
|
+
```javascript
|
49
|
+
$(document).ready(function() {
|
50
|
+
$('.zoom__container').zoom();
|
51
|
+
});
|
52
|
+
```
|
53
|
+
|
54
|
+
|
55
|
+
Options
|
56
|
+
--------------------------------------------------------------------------------
|
57
|
+
|
58
|
+
You have the ability to pass your options like this:
|
59
|
+
|
60
|
+
```javascript
|
61
|
+
$('.zoom__container').zoom({
|
62
|
+
lazyLoad: true,
|
63
|
+
deltaScale: 0.05,
|
64
|
+
url: null
|
65
|
+
});
|
66
|
+
```
|
67
|
+
|
68
|
+
Different options are available:
|
69
|
+
|
70
|
+
Name | Default | Description
|
71
|
+
------------- | ------------- | -------------
|
72
|
+
lazyLoad | ```true``` | If set to true, jquery.zoom will lazy load the zoom image when the user clicks for the first time on the container
|
73
|
+
deltaScale |``` 0.05``` | What is the increment scale you want to use when scale up/down
|
74
|
+
url | ```null``` | The url of the zoom image, if not defined, jquery.zoom will fetch the attribute ```data-zoom-src```given.
|
75
|
+
|
76
|
+
|
77
|
+
Events
|
78
|
+
--------------------------------------------------------------------------------
|
79
|
+
|
80
|
+
You can destroy the widget for the instance given, it's helpful when you want to go back to a clean state.
|
81
|
+
|
82
|
+
```javascript
|
83
|
+
// Create instance
|
84
|
+
$('.zoom__container').zoom();
|
85
|
+
|
86
|
+
// Remove instance
|
87
|
+
$('.zoom__container').trigger('zoom.destroy');
|
88
|
+
```
|
89
|
+
|
90
|
+
|
91
|
+
Workarea Commerce Documentation
|
92
|
+
--------------------------------------------------------------------------------
|
93
|
+
|
94
|
+
See [https://developer.workarea.com](https://developer.workarea.com) for Workarea Commerce documentation.
|
95
|
+
|
96
|
+
License
|
97
|
+
--------------------------------------------------------------------------------
|
98
|
+
|
99
|
+
Workarea Styled Selects is released under the [Business Software License](LICENSE)
|
100
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
9
|
+
rdoc.rdoc_dir = 'rdoc'
|
10
|
+
rdoc.title = 'Jquery Zoom'
|
11
|
+
rdoc.options << '--line-numbers'
|
12
|
+
rdoc.rdoc_files.include('README.md')
|
13
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
14
|
+
end
|
15
|
+
|
16
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
17
|
+
load 'rails/tasks/engine.rake'
|
18
|
+
load 'rails/tasks/statistics.rake'
|
19
|
+
|
20
|
+
require 'rake/testtask'
|
21
|
+
Rake::TestTask.new(:test) do |t|
|
22
|
+
t.libs << 'lib'
|
23
|
+
t.libs << 'test'
|
24
|
+
t.pattern = 'test/**/*_test.rb'
|
25
|
+
t.verbose = false
|
26
|
+
end
|
27
|
+
task default: :test
|
28
|
+
|
29
|
+
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
|
30
|
+
require 'workarea/jquery_zoom/version'
|
31
|
+
|
32
|
+
desc 'Generate the changelog based on git history'
|
33
|
+
task :changelog, :from, :to do |t, args|
|
34
|
+
require 'date'
|
35
|
+
|
36
|
+
from = args[:from] || `git describe --tags --abbrev=0`.strip
|
37
|
+
to = args[:to] || 'HEAD'
|
38
|
+
log = `git log #{from}..#{to} --pretty=format:'%an|%B___'`
|
39
|
+
|
40
|
+
puts "Workarea Jquery Zoom #{Workarea::JqueryZoom::VERSION} (#{Time.zone.today})"
|
41
|
+
puts '-' * 80
|
42
|
+
puts
|
43
|
+
|
44
|
+
log.split(/___/).each do |commit|
|
45
|
+
pieces = commit.split('|').reverse
|
46
|
+
author = pieces.pop.strip
|
47
|
+
message = pieces.join.strip
|
48
|
+
|
49
|
+
next if message =~ /^\s*Merge pull request/
|
50
|
+
next if message =~ /No changelog/i
|
51
|
+
|
52
|
+
project_key = nil # TODO Replace with your Project's Jira key
|
53
|
+
|
54
|
+
if project_key.blank?
|
55
|
+
puts "To clean up your release notes, add your project's Jira key to the Changelog Rake task!"
|
56
|
+
else
|
57
|
+
ticket = message.scan(/#{project_key}-\d+/)[0]
|
58
|
+
next if ticket.nil?
|
59
|
+
next if message =~ /^\s*Merge branch/ && ticket.nil?
|
60
|
+
end
|
61
|
+
|
62
|
+
first_line = false
|
63
|
+
|
64
|
+
message.each_line do |line|
|
65
|
+
if !first_line
|
66
|
+
first_line = true
|
67
|
+
puts "* #{line}"
|
68
|
+
elsif line.strip.empty?
|
69
|
+
puts
|
70
|
+
else
|
71
|
+
puts " #{line}"
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
puts " #{author}"
|
76
|
+
puts
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
desc "Release version #{Workarea::JqueryZoom::VERSION} of the gem"
|
81
|
+
task :release do
|
82
|
+
host = "https://#{ENV['BUNDLE_GEMS__WEBLINC__COM']}@gems.weblinc.com"
|
83
|
+
|
84
|
+
system 'touch CHANGELOG.md'
|
85
|
+
system 'echo "$(rake changelog)
|
86
|
+
|
87
|
+
|
88
|
+
$(cat CHANGELOG.md)" > CHANGELOG.md'
|
89
|
+
system 'git add CHANGELOG.md && git commit -m "Update changelog" && git push origin HEAD'
|
90
|
+
|
91
|
+
system "git tag -a v#{Workarea::JqueryZoom::VERSION} -m 'Tagging #{Workarea::JqueryZoom::VERSION}'"
|
92
|
+
system 'git push --tags'
|
93
|
+
|
94
|
+
system "gem build workarea-jquery_zoom.gemspec"
|
95
|
+
system "gem push workarea-jquery_zoom-#{Workarea::JqueryZoom::VERSION}.gem"
|
96
|
+
system "gem push workarea-jquery_zoom-#{Workarea::JqueryZoom::VERSION}.gem --host #{host}"
|
97
|
+
system "rm workarea-jquery_zoom-#{Workarea::JqueryZoom::VERSION}.gem"
|
98
|
+
end
|
99
|
+
|
100
|
+
desc 'Run the JavaScript tests'
|
101
|
+
ENV['TEASPOON_RAILS_ENV'] = File.expand_path('../test/dummy/config/environment', __FILE__)
|
102
|
+
task teaspoon: 'app:teaspoon'
|
103
|
+
|
104
|
+
desc 'Start a server at http://localhost:3000/teaspoon for JavaScript tests'
|
105
|
+
task :teaspoon_server do
|
106
|
+
Dir.chdir("test/dummy")
|
107
|
+
teaspoon_env = File.expand_path('../test/teaspoon_env.rb', __FILE__)
|
108
|
+
system "RAILS_ENV=test TEASPOON_ENV=#{teaspoon_env} rails s"
|
109
|
+
end
|