uploadbox 0.0.10 → 0.0.11
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 +4 -4
- data/app/assets/font/fontello.eot +0 -0
- data/app/assets/font/fontello.svg +12 -0
- data/app/assets/font/fontello.ttf +0 -0
- data/app/assets/font/fontello.woff +0 -0
- data/app/assets/stylesheets/fontello.scss +53 -0
- data/app/assets/stylesheets/uploadbox.sass +90 -6
- data/app/views/uploadbox/images/_uploader.html.slim +4 -4
- data/lib/uploadbox/engine.rb +1 -1
- data/lib/uploadbox/version.rb +1 -1
- metadata +7 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d912686ada135705f14bfc97ee37a94e33d3dd35
|
|
4
|
+
data.tar.gz: 243b0106d9f5dadba7c043d65f9ec4ac759e85ba
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1be0a1a86f1ef35c00df7c0c97a56793ab201b5d8b694d958af8b287c2adfc9123650915499331ef5586066e98c47b9b2f80297af5a886e511bc94d17cc01879
|
|
7
|
+
data.tar.gz: 5082e057fa011c399043364cf571d418c967e2c945860a3e211c8f800096983ecf69b2cf68bcaf9ec9998b18abff82d2295659741af08e19dea2840ed3d23983
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg">
|
|
4
|
+
<metadata>Copyright (C) 2013 by original authors @ fontello.com</metadata>
|
|
5
|
+
<defs>
|
|
6
|
+
<font id="fontello" horiz-adv-x="1000" >
|
|
7
|
+
<font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
|
|
8
|
+
<missing-glyph horiz-adv-x="1000" />
|
|
9
|
+
<glyph glyph-name="picture-1" unicode="" d="m357 529q0-45-31-76t-76-32t-76 32t-31 76t31 75t76 32t76-32t31-75z m572-215v-250h-786v107l178 179l90-89l285 285z m53 393h-893q-7 0-12-5t-6-13v-678q0-8 6-13t12-5h893q7 0 13 5t5 13v678q0 7-5 13t-13 5z m89-18v-678q0-37-26-63t-63-27h-893q-36 0-63 27t-26 63v678q0 37 26 63t63 27h893q37 0 63-27t26-63z" horiz-adv-x="1071.4" />
|
|
10
|
+
</font>
|
|
11
|
+
</defs>
|
|
12
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: 'fontello';
|
|
3
|
+
src: url('fontello.eot?99792958');
|
|
4
|
+
src: url('fontello.eot?99792958#iefix') format('embedded-opentype'),
|
|
5
|
+
url('fontello.woff?99792958') format('woff'),
|
|
6
|
+
url('fontello.ttf?99792958') format('truetype'),
|
|
7
|
+
url('fontello.svg?99792958#fontello') format('svg');
|
|
8
|
+
font-weight: normal;
|
|
9
|
+
font-style: normal;
|
|
10
|
+
}
|
|
11
|
+
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
|
|
12
|
+
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
|
|
13
|
+
/*
|
|
14
|
+
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
|
15
|
+
@font-face {
|
|
16
|
+
font-family: 'fontello';
|
|
17
|
+
src: url('../font/fontello.svg?99792958#fontello') format('svg');
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
[class^="icon-"]:before, [class*=" icon-"]:before {
|
|
23
|
+
font-family: "fontello";
|
|
24
|
+
font-style: normal;
|
|
25
|
+
font-weight: normal;
|
|
26
|
+
speak: none;
|
|
27
|
+
|
|
28
|
+
display: inline-block;
|
|
29
|
+
text-decoration: inherit;
|
|
30
|
+
width: 1em;
|
|
31
|
+
margin-right: .2em;
|
|
32
|
+
text-align: center;
|
|
33
|
+
/* opacity: .8; */
|
|
34
|
+
|
|
35
|
+
/* For safety - reset parent styles, that can break glyph codes*/
|
|
36
|
+
font-variant: normal;
|
|
37
|
+
text-transform: none;
|
|
38
|
+
|
|
39
|
+
/* fix buttons height, for twitter bootstrap */
|
|
40
|
+
line-height: 1em;
|
|
41
|
+
|
|
42
|
+
/* Animation center compensation - margins should be symmetric */
|
|
43
|
+
/* remove if not needed */
|
|
44
|
+
margin-left: .2em;
|
|
45
|
+
|
|
46
|
+
/* you can be more comfortable with increased icons size */
|
|
47
|
+
/* font-size: 120%; */
|
|
48
|
+
|
|
49
|
+
/* Uncomment for 3D effect */
|
|
50
|
+
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.icon-picture-1:before { content: '\e800'; } /* '' */
|
|
@@ -1,11 +1,65 @@
|
|
|
1
1
|
@import bootstrap/progress
|
|
2
|
+
@import fontello
|
|
2
3
|
|
|
3
4
|
.uploadbox-image-uploader
|
|
5
|
+
position: relative
|
|
6
|
+
padding-bottom: 30px
|
|
7
|
+
|
|
4
8
|
.btn
|
|
5
9
|
background-color: #f7f7f7
|
|
6
|
-
padding: 10px
|
|
7
10
|
text-align: center
|
|
8
11
|
text-decoration: none
|
|
12
|
+
box-sizing: border-box
|
|
13
|
+
border: 1px solid #f7f7f7
|
|
14
|
+
&:hover
|
|
15
|
+
.btn
|
|
16
|
+
border: 1px solid darken(#f7f7f7, 20%)
|
|
17
|
+
|
|
18
|
+
.icon-picture-1
|
|
19
|
+
opacity: .5
|
|
20
|
+
|
|
21
|
+
.fileupload-exists
|
|
22
|
+
.icon-picture-1
|
|
23
|
+
display: none
|
|
24
|
+
|
|
25
|
+
.icon-picture-1
|
|
26
|
+
position: absolute
|
|
27
|
+
top: 0
|
|
28
|
+
left: 0
|
|
29
|
+
font-size: 40px
|
|
30
|
+
width: 100%
|
|
31
|
+
height: 100%
|
|
32
|
+
opacity: .3
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
.fileupload
|
|
36
|
+
&:before
|
|
37
|
+
box-sizing: border-box
|
|
38
|
+
z-index: 5
|
|
39
|
+
font-size: 10px
|
|
40
|
+
line-height: 12px
|
|
41
|
+
display: block
|
|
42
|
+
text-align: center
|
|
43
|
+
font-weight: 500
|
|
44
|
+
color: #fff
|
|
45
|
+
background-color: rgba(#000, .6)
|
|
46
|
+
padding: 2px
|
|
47
|
+
position: absolute
|
|
48
|
+
width: 100%
|
|
49
|
+
top: 10px
|
|
50
|
+
|
|
51
|
+
&.uploading:before
|
|
52
|
+
content: 'Enviando...'
|
|
53
|
+
|
|
54
|
+
&.processing:before
|
|
55
|
+
content: 'Processando... Quase lá.'
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
.fileupload-new .btn.fileupload-exists
|
|
59
|
+
display: none
|
|
60
|
+
|
|
61
|
+
.fileupload-new .btn-file
|
|
62
|
+
background: #f7f7f7
|
|
9
63
|
|
|
10
64
|
.clearfix
|
|
11
65
|
*zoom: 1
|
|
@@ -37,6 +91,7 @@
|
|
|
37
91
|
position: relative
|
|
38
92
|
vertical-align: middle
|
|
39
93
|
display: block
|
|
94
|
+
background: transparent
|
|
40
95
|
> input
|
|
41
96
|
position: absolute
|
|
42
97
|
top: 0
|
|
@@ -50,6 +105,9 @@
|
|
|
50
105
|
cursor: pointer
|
|
51
106
|
width: 100%
|
|
52
107
|
|
|
108
|
+
.fileupload-exists, .fileupload-new
|
|
109
|
+
margin-left: -9999px
|
|
110
|
+
|
|
53
111
|
.fileupload
|
|
54
112
|
position: relative
|
|
55
113
|
background-color: #eee
|
|
@@ -65,7 +123,7 @@
|
|
|
65
123
|
vertical-align: middle
|
|
66
124
|
text-align: center
|
|
67
125
|
> img
|
|
68
|
-
display:
|
|
126
|
+
display: block
|
|
69
127
|
vertical-align: middle
|
|
70
128
|
max-height: 100%
|
|
71
129
|
.btn
|
|
@@ -82,7 +140,6 @@
|
|
|
82
140
|
|
|
83
141
|
.thumbnail-borderless .thumbnail
|
|
84
142
|
border: none
|
|
85
|
-
padding: 0
|
|
86
143
|
border-radius: 0
|
|
87
144
|
box-shadow: none
|
|
88
145
|
|
|
@@ -127,9 +184,36 @@
|
|
|
127
184
|
right: 0
|
|
128
185
|
|
|
129
186
|
.fileupload-actions
|
|
130
|
-
position:
|
|
187
|
+
position: absolute
|
|
188
|
+
top: 0
|
|
189
|
+
left: 0
|
|
190
|
+
width: 100%
|
|
131
191
|
|
|
132
192
|
.progress
|
|
133
|
-
height:
|
|
193
|
+
height: 10px
|
|
194
|
+
width: 100%
|
|
134
195
|
margin-bottom: 0
|
|
135
|
-
border-radius: 0
|
|
196
|
+
border-radius: 0
|
|
197
|
+
position: absolute
|
|
198
|
+
z-index: 5
|
|
199
|
+
top: 0
|
|
200
|
+
left: 0
|
|
201
|
+
|
|
202
|
+
.btn.fileupload-exists
|
|
203
|
+
position: absolute
|
|
204
|
+
top: -10px
|
|
205
|
+
right: -10px
|
|
206
|
+
z-index: 3
|
|
207
|
+
padding: 0
|
|
208
|
+
border-radius: 100%
|
|
209
|
+
width: 20px
|
|
210
|
+
height: 20px
|
|
211
|
+
line-height: 20px
|
|
212
|
+
font-size: 16px
|
|
213
|
+
background: lighten(black, 20%)
|
|
214
|
+
color: darken(white, 20%)
|
|
215
|
+
display: block
|
|
216
|
+
border: 0
|
|
217
|
+
&:hover
|
|
218
|
+
background: black
|
|
219
|
+
color: white
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
= form.fields_for :image do
|
|
2
2
|
- secure_random = SecureRandom.uuid
|
|
3
|
-
.uploadbox-image-uploader data-component="ImageUploader"
|
|
3
|
+
.uploadbox-image-uploader data-component="ImageUploader" style="width: #{width}px; height: #{height}px;"
|
|
4
4
|
- if namespace
|
|
5
5
|
input name="[#{namespace}]#{upload_name}_id" data-item="id" type="hidden" value="#{resource.send(upload_name).try :id}"
|
|
6
6
|
- else
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
= image_tag default, width: width, height: height
|
|
14
14
|
|
|
15
15
|
.fileupload-actions
|
|
16
|
-
span.btn.btn-file
|
|
16
|
+
span.btn.btn-file style="width: #{width}px; height: #{height}px;"
|
|
17
17
|
span.fileupload-new = choose_label
|
|
18
18
|
span.fileupload-exists = update_label
|
|
19
|
-
|
|
20
|
-
input type="file" name="image[file]" data-callback-url="#{uploadbox.images_path}" data-find-url="#{uploadbox.find_images_path(format: :json)}" data-url="https://#{ENV['S3_BUCKET']}.s3.amazonaws.com/" data-secure-random="#{secure_random}" accept="image/x-png, image/gif, image/jpeg" style="display: none"
|
|
19
|
+
i.icon-picture-1 style="line-height: #{height}px"
|
|
20
|
+
input type="file" name="image[file]" data-callback-url="#{uploadbox.images_path}" data-find-url="#{uploadbox.find_images_path(format: :json)}" data-url="https://#{ENV['S3_BUCKET']}.s3.amazonaws.com/" data-secure-random="#{secure_random}" accept="image/x-png, image/gif, image/jpeg" style="display: none; width: #{width}px; height: #{height}px;"
|
|
21
21
|
input type="hidden" name="policy" value="#{s3_policy}"
|
|
22
22
|
input type="hidden" name="signature" value="#{s3_signature}"
|
|
23
23
|
input type="hidden" name="AWSAccessKeyId" value="#{ENV['S3_KEY']}"
|
data/lib/uploadbox/engine.rb
CHANGED
|
@@ -35,7 +35,7 @@ class ActionView::Helpers::FormBuilder
|
|
|
35
35
|
default: false,
|
|
36
36
|
update_label: 'Alterar',
|
|
37
37
|
choose_label: 'Escolher',
|
|
38
|
-
destroy_label: '
|
|
38
|
+
destroy_label: '×'.html_safe)
|
|
39
39
|
dimensions = upload_model_class.versions[options[:preview]]
|
|
40
40
|
@template.render partial: 'uploadbox/images/uploader', locals: {
|
|
41
41
|
upload_name: upload_name,
|
data/lib/uploadbox/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: uploadbox
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Julio Protzek
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-10-
|
|
12
|
+
date: 2013-10-16 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|
|
@@ -341,6 +341,10 @@ executables: []
|
|
|
341
341
|
extensions: []
|
|
342
342
|
extra_rdoc_files: []
|
|
343
343
|
files:
|
|
344
|
+
- app/assets/font/fontello.eot
|
|
345
|
+
- app/assets/font/fontello.svg
|
|
346
|
+
- app/assets/font/fontello.ttf
|
|
347
|
+
- app/assets/font/fontello.woff
|
|
344
348
|
- app/assets/javascripts/_image_uploader.coffee
|
|
345
349
|
- app/assets/javascripts/cors/jquery.postmessage-transport.js
|
|
346
350
|
- app/assets/javascripts/cors/jquery.xdr-transport.js
|
|
@@ -349,6 +353,7 @@ files:
|
|
|
349
353
|
- app/assets/javascripts/jquery.ui.widget.js
|
|
350
354
|
- app/assets/javascripts/uploadbox.coffee
|
|
351
355
|
- app/assets/stylesheets/bootstrap/_progress.css
|
|
356
|
+
- app/assets/stylesheets/fontello.scss
|
|
352
357
|
- app/assets/stylesheets/uploadbox.sass
|
|
353
358
|
- app/controllers/uploadbox/application_controller.rb
|
|
354
359
|
- app/controllers/uploadbox/images_controller.rb
|