alchemy-crop-image 0.1.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.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +289 -0
- data/MIT-LICENSE +20 -0
- data/README.md +37 -0
- data/Rakefile +32 -0
- data/alchemy-crop-image.gemspec +42 -0
- data/app/assets/config/alchemy_crop_image_manifest.js +2 -0
- data/app/assets/images/alchemy/crop/image/.keep +0 -0
- data/app/assets/javascripts/alchemy/crop/image/application.js +4 -0
- data/app/assets/javascripts/alchemy/crop/image/cropping.js +277 -0
- data/app/assets/javascripts/alchemy/crop/image/routes.js.erb +1 -0
- data/app/assets/stylesheets/alchemy/crop/image/application.scss +17 -0
- data/app/assets/stylesheets/alchemy/crop/image/cropping.scss +144 -0
- data/app/controllers/alchemy/admin/pictures/crops_controller.rb +46 -0
- data/app/helpers/alchemy/crop/image/application_helper.rb +8 -0
- data/app/jobs/alchemy/crop/image/application_job.rb +8 -0
- data/app/mailers/alchemy/crop/image/application_mailer.rb +10 -0
- data/app/views/alchemy/admin/pictures/_cropping.html.erb +93 -0
- data/app/views/alchemy/admin/pictures/show.html.erb +44 -0
- data/app/views/layouts/alchemy/crop/image/application.html.erb +15 -0
- data/bin/rails +14 -0
- data/config/initializers/assets.rb +1 -0
- data/config/locales/en.yml +30 -0
- data/config/locales/it.yml +30 -0
- data/config/routes.rb +13 -0
- data/lib/alchemy/crop/image/configuration.rb +23 -0
- data/lib/alchemy/crop/image/engine.rb +13 -0
- data/lib/alchemy/crop/image/version.rb +7 -0
- data/lib/alchemy/crop/image.rb +9 -0
- data/lib/generators/alchemy/crop/image/install_generator.rb +26 -0
- data/lib/tasks/alchemy/crop/image_tasks.rake +4 -0
- metadata +203 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
en:
|
2
|
+
alchemy:
|
3
|
+
alchemy_crop_image:
|
4
|
+
enable_cropping: "Enable editing"
|
5
|
+
cancel: "Cancel"
|
6
|
+
save_crop: "Save as new Image"
|
7
|
+
|
8
|
+
cropping_actions:
|
9
|
+
move_image: "Move image"
|
10
|
+
crop_image: "Crop image"
|
11
|
+
|
12
|
+
height_crop: Height
|
13
|
+
width_crop: Width
|
14
|
+
|
15
|
+
you_can_select_a_preset_ratio_for_cropping: You can select a cropping box's preset ratio.
|
16
|
+
preset_crop_ratio_none: None
|
17
|
+
|
18
|
+
cropped_image_not_saved: Cropped image not saved
|
19
|
+
cropped_image_succesfully_save: Cropped image saved succesfully
|
20
|
+
|
21
|
+
button_labels:
|
22
|
+
label_preview_image: Preview Image
|
23
|
+
label_crop_preset_none: No crop box preset
|
24
|
+
label_crop_preset: "Crop-box preset: %{preset}"
|
25
|
+
label_zoom_out: Zoom Out
|
26
|
+
label_zoom_in: Zoom In
|
27
|
+
label_drag_image: Drag Image
|
28
|
+
|
29
|
+
|
30
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
it:
|
2
|
+
alchemy:
|
3
|
+
alchemy_crop_image:
|
4
|
+
enable_cropping: "Modifica"
|
5
|
+
cancel: "Annulla"
|
6
|
+
save_crop: "Salva nuova immagine"
|
7
|
+
|
8
|
+
cropping_actions:
|
9
|
+
move_image: "Trascina immagine"
|
10
|
+
crop_image: "Ritaglia immagine"
|
11
|
+
|
12
|
+
height_crop: Altezza
|
13
|
+
width_crop: Larghezza
|
14
|
+
|
15
|
+
you_can_select_a_preset_ratio_for_cropping: Puoi selezionare un rapporto predefinito per il riquadro di ritaglio.
|
16
|
+
preset_crop_ratio_none: Nessuno
|
17
|
+
|
18
|
+
cropped_image_not_saved: Immagine non salvata
|
19
|
+
cropped_image_succesfully_save: Immagine salvata correttamente
|
20
|
+
|
21
|
+
button_labels:
|
22
|
+
label_preview_image: Visualizza immagine
|
23
|
+
label_crop_preset_none: Nessun riquadro preselezionato
|
24
|
+
label_crop_preset: "Riquadro preselezionato: %{preset}"
|
25
|
+
label_zoom_out: Zoom -
|
26
|
+
label_zoom_in: Zoom +
|
27
|
+
label_drag_image: Trascina immagine
|
28
|
+
|
29
|
+
|
30
|
+
|
data/config/routes.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
module Alchemy
|
2
|
+
module Crop
|
3
|
+
module Image
|
4
|
+
class Configuration
|
5
|
+
|
6
|
+
cattr_accessor :available_preset_cropbox
|
7
|
+
@@available_preset_cropbox = [
|
8
|
+
{
|
9
|
+
value: 16.0 / 9.0,
|
10
|
+
label: "16:9"
|
11
|
+
},
|
12
|
+
{
|
13
|
+
value: (4.0 / 3.0),
|
14
|
+
label: "4:3"
|
15
|
+
}]
|
16
|
+
|
17
|
+
def self.set
|
18
|
+
yield self
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class Alchemy::Crop::Image::InstallGenerator < Rails::Generators::Base
|
2
|
+
|
3
|
+
|
4
|
+
desc "Add yarn needed packages"
|
5
|
+
|
6
|
+
def run_yarn_add
|
7
|
+
run("yarn add cropperjs@1.5.6")
|
8
|
+
end
|
9
|
+
|
10
|
+
|
11
|
+
desc "Add required assets"
|
12
|
+
|
13
|
+
def add_required_assets
|
14
|
+
|
15
|
+
inject_into_file "vendor/assets/javascripts/alchemy/admin/all.js", after: '//= require alchemy/admin' do
|
16
|
+
"\n//= require alchemy/crop/image/application\n"
|
17
|
+
end
|
18
|
+
|
19
|
+
inject_into_file "vendor/assets/stylesheets/alchemy/admin/all.css", after: ' *= require alchemy/admin' do
|
20
|
+
"\n *= require alchemy/crop/image/application\n"
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,203 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: alchemy-crop-image
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Alessandro Baccanelli
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-04-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 5.2.0
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 7.0.0
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 5.2.0
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 7.0.0
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: alchemy_cms
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '4.1'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '4.1'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: sprockets-rails
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 2.0.0
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 2.0.0
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: js-routes
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '1.4'
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 1.4.9
|
71
|
+
type: :runtime
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - "~>"
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '1.4'
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: 1.4.9
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: sqlite3
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: alchemy-devise
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - "~>"
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '4.5'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - "~>"
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '4.5'
|
109
|
+
- !ruby/object:Gem::Dependency
|
110
|
+
name: puma
|
111
|
+
requirement: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - "~>"
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '3.11'
|
116
|
+
type: :development
|
117
|
+
prerelease: false
|
118
|
+
version_requirements: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - "~>"
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '3.11'
|
123
|
+
- !ruby/object:Gem::Dependency
|
124
|
+
name: webpacker
|
125
|
+
requirement: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - "~>"
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '4.0'
|
130
|
+
type: :development
|
131
|
+
prerelease: false
|
132
|
+
version_requirements: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- - "~>"
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '4.0'
|
137
|
+
description: With this gem you can crop and resize images directly in Alchemy Library
|
138
|
+
and create a new verison of image
|
139
|
+
email:
|
140
|
+
- alessandro.baccanelli@archimedianet.it
|
141
|
+
executables: []
|
142
|
+
extensions: []
|
143
|
+
extra_rdoc_files: []
|
144
|
+
files:
|
145
|
+
- ".gitignore"
|
146
|
+
- ".ruby-gemset"
|
147
|
+
- ".ruby-version"
|
148
|
+
- Gemfile
|
149
|
+
- Gemfile.lock
|
150
|
+
- MIT-LICENSE
|
151
|
+
- README.md
|
152
|
+
- Rakefile
|
153
|
+
- alchemy-crop-image.gemspec
|
154
|
+
- app/assets/config/alchemy_crop_image_manifest.js
|
155
|
+
- app/assets/images/alchemy/crop/image/.keep
|
156
|
+
- app/assets/javascripts/alchemy/crop/image/application.js
|
157
|
+
- app/assets/javascripts/alchemy/crop/image/cropping.js
|
158
|
+
- app/assets/javascripts/alchemy/crop/image/routes.js.erb
|
159
|
+
- app/assets/stylesheets/alchemy/crop/image/application.scss
|
160
|
+
- app/assets/stylesheets/alchemy/crop/image/cropping.scss
|
161
|
+
- app/controllers/alchemy/admin/pictures/crops_controller.rb
|
162
|
+
- app/helpers/alchemy/crop/image/application_helper.rb
|
163
|
+
- app/jobs/alchemy/crop/image/application_job.rb
|
164
|
+
- app/mailers/alchemy/crop/image/application_mailer.rb
|
165
|
+
- app/views/alchemy/admin/pictures/_cropping.html.erb
|
166
|
+
- app/views/alchemy/admin/pictures/show.html.erb
|
167
|
+
- app/views/layouts/alchemy/crop/image/application.html.erb
|
168
|
+
- bin/rails
|
169
|
+
- config/initializers/assets.rb
|
170
|
+
- config/locales/en.yml
|
171
|
+
- config/locales/it.yml
|
172
|
+
- config/routes.rb
|
173
|
+
- lib/alchemy/crop/image.rb
|
174
|
+
- lib/alchemy/crop/image/configuration.rb
|
175
|
+
- lib/alchemy/crop/image/engine.rb
|
176
|
+
- lib/alchemy/crop/image/version.rb
|
177
|
+
- lib/generators/alchemy/crop/image/install_generator.rb
|
178
|
+
- lib/tasks/alchemy/crop/image_tasks.rake
|
179
|
+
homepage: https://github.com/ArchimediaZerogroup/alchemy-crop-image
|
180
|
+
licenses:
|
181
|
+
- MIT
|
182
|
+
metadata:
|
183
|
+
allowed_push_host: https://rubygems.org/
|
184
|
+
post_install_message:
|
185
|
+
rdoc_options: []
|
186
|
+
require_paths:
|
187
|
+
- lib
|
188
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
189
|
+
requirements:
|
190
|
+
- - ">="
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: '0'
|
193
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
194
|
+
requirements:
|
195
|
+
- - ">="
|
196
|
+
- !ruby/object:Gem::Version
|
197
|
+
version: '0'
|
198
|
+
requirements: []
|
199
|
+
rubygems_version: 3.1.2
|
200
|
+
signing_key:
|
201
|
+
specification_version: 4
|
202
|
+
summary: A gem for enable image cropping in Alchemy Library
|
203
|
+
test_files: []
|