image_input 0.0.5 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/app/views/image_input/_input.html.erb +2 -2
- data/lib/image_input/helpers.rb +13 -2
- data/lib/image_input/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f3073f6527858f59bcf55edb7a62e524ec991de2ecb30d025e25fb906eeedb9
|
4
|
+
data.tar.gz: 310174f936344a3c8598d8f2465bb20474fff0e3c58d0318828094cc61b8e726
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42fbacb8f4ba39595ff17c376eb0225f4a0bcd25773bd056fba3d2cec6276502af808554e969cd2722466855031b11db233ba1ba55c49c365da1db9ebfa6ecec
|
7
|
+
data.tar.gz: 65a504414bb3a6c3b80a87ecda10359342b7c78d9333d1e07bdc9ca9a01427e4526f670136d97c8aaf67ffb7226c63be1d27d969353ebfe126ad6da2058c9184
|
data/README.md
CHANGED
@@ -14,13 +14,13 @@
|
|
14
14
|
<%= image_tag(
|
15
15
|
blob.variant(resize_to_limit: [300, 300]),
|
16
16
|
data: { target: 'image-input.image' },
|
17
|
-
class: 'rounded-md mb-4'
|
17
|
+
class: image_class || 'rounded-md mb-4'
|
18
18
|
) %>
|
19
19
|
<% end %>
|
20
20
|
|
21
21
|
<a
|
22
22
|
href="#"
|
23
|
-
class="border border-transparent cursor-pointer duration-150 ease-in-out focus:outline-none font-bold inline-block leading-5 px-4 py-2 rounded-md text-sm transition active:bg-gray-50 active:text-gray-800 bg-white border-gray-300 hover:bg-gray-100 hover:text-gray-600 text-gray-800 mr-4"
|
23
|
+
class="<%= button_class || 'border border-transparent cursor-pointer duration-150 ease-in-out focus:outline-none font-bold inline-block leading-5 px-4 py-2 rounded-md text-sm transition active:bg-gray-50 active:text-gray-800 bg-white border-gray-300 hover:bg-gray-100 hover:text-gray-600 text-gray-800 mr-4' %>"
|
24
24
|
data-action="click->image-input#chooseFile"
|
25
25
|
data-target="image-input.button"
|
26
26
|
>
|
data/lib/image_input/helpers.rb
CHANGED
@@ -2,14 +2,25 @@
|
|
2
2
|
|
3
3
|
module ImageInput
|
4
4
|
module Helpers
|
5
|
-
def image_input(
|
5
|
+
def image_input(
|
6
|
+
form,
|
7
|
+
field,
|
8
|
+
accept: %i(png jpeg gif),
|
9
|
+
direct_upload: true,
|
10
|
+
button_class: nil,
|
11
|
+
image_class: nil,
|
12
|
+
**options
|
13
|
+
)
|
6
14
|
render(
|
7
15
|
'image_input/input',
|
8
16
|
form: form,
|
9
17
|
field: field,
|
10
18
|
blob: form.object.public_send(field),
|
11
19
|
accept: accept.map { |a| Mime[a].to_s }.join(','),
|
12
|
-
direct_upload: direct_upload
|
20
|
+
direct_upload: direct_upload,
|
21
|
+
button_class: button_class,
|
22
|
+
image_class: image_class,
|
23
|
+
**options
|
13
24
|
)
|
14
25
|
end
|
15
26
|
end
|
data/lib/image_input/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: image_input
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Katz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|