effective_assets 0.1 → 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/MIT-LICENSE +1 -1
- data/README.md +341 -72
- data/app/assets/javascripts/effective/snippets/effective_asset.js.coffee +53 -0
- data/app/assets/javascripts/effective_assets.js +4 -0
- data/app/assets/javascripts/effective_assets/asset_box.js.coffee +36 -0
- data/app/assets/javascripts/effective_assets/asset_box_dialog.js.coffee +49 -0
- data/app/assets/javascripts/effective_assets/asset_box_drag_and_drop.js.coffee +2 -0
- data/app/assets/javascripts/effective_assets/asset_box_filtering.js.coffee +16 -0
- data/app/assets/javascripts/effective_assets/asset_box_sorting.js.coffee +8 -0
- data/app/assets/javascripts/effective_assets/jquery_ui_sortable.js +813 -585
- data/app/assets/javascripts/effective_assets/s3_uploader.js.coffee +268 -0
- data/app/assets/javascripts/effective_assets_iframe.js.coffee +28 -0
- data/app/assets/stylesheets/active_admin/effective_assets.css.scss +57 -0
- data/app/assets/stylesheets/effective_assets/_asset_box_input.scss +54 -175
- data/app/assets/stylesheets/effective_assets/_iframe_bootstrap.scss +1714 -0
- data/app/assets/stylesheets/effective_assets/_input_bootstrap.scss +508 -0
- data/app/assets/stylesheets/effective_assets_iframe.css.scss +23 -0
- data/app/controllers/effective/assets_controller.rb +41 -0
- data/app/controllers/effective/s3_uploads_controller.rb +58 -74
- data/app/helpers/effective_assets_helper.rb +30 -14
- data/app/helpers/effective_assets_s3_helper.rb +69 -0
- data/app/models/concerns/acts_as_asset_box.rb +75 -11
- data/app/models/effective/access_denied.rb +17 -0
- data/app/models/effective/asset.rb +130 -93
- data/app/models/effective/attachment.rb +2 -7
- data/app/models/effective/delayed_job.rb +33 -78
- data/app/models/effective/snippets/effective_asset.rb +19 -0
- data/app/models/effective/user_uploads.rb +19 -0
- data/app/models/inputs/asset_box.rb +154 -0
- data/app/models/inputs/asset_box_form_input.rb +7 -0
- data/app/models/inputs/asset_box_formtastic_input.rb +9 -0
- data/app/models/inputs/asset_box_input.rb +13 -82
- data/app/models/inputs/asset_box_simple_form_input.rb +7 -0
- data/app/uploaders/effective_assets_uploader.rb +14 -2
- data/app/uploaders/{asset_uploader.rb → test_asset_uploader.rb} +1 -1
- data/app/views/active_admin/effective_assets/_edit.html.haml +3 -3
- data/app/views/active_admin/effective_assets/_new.html.haml +2 -1
- data/app/views/asset_box_input/_attachment_as_list.html.haml +17 -0
- data/app/views/asset_box_input/_attachment_as_table.html.haml +32 -0
- data/app/views/asset_box_input/_attachment_as_thumbnail.html.haml +20 -0
- data/app/views/asset_box_input/_dialog.html.haml +18 -0
- data/app/views/asset_box_input/_progress_bar_template.html.haml +8 -0
- data/app/views/asset_box_input/_uploader.html.haml +21 -115
- data/app/views/effective/assets/iframe.html.haml +17 -0
- data/app/views/effective/snippets/_effective_asset.html.haml +8 -0
- data/config/routes.rb +8 -2
- data/db/migrate/01_create_effective_assets.rb.erb +3 -0
- data/lib/effective_assets.rb +34 -3
- data/lib/effective_assets/engine.rb +11 -8
- data/lib/effective_assets/version.rb +1 -1
- data/lib/generators/templates/asset_uploader.rb +35 -0
- data/lib/generators/templates/effective_assets.rb +31 -4
- data/lib/tasks/effective_assets_tasks.rake +115 -4
- data/spec/internal/config/database.yml +3 -0
- data/spec/internal/config/initializers/effective_assets.rb +18 -0
- data/spec/internal/config/routes.rb +3 -0
- data/spec/internal/db/combustion_test.sqlite +0 -0
- data/spec/internal/db/schema.rb +52 -0
- data/spec/internal/log/test.log +793 -0
- data/spec/{dummy → internal}/public/favicon.ico +0 -0
- data/spec/internal/public/sprites.png +0 -0
- data/spec/models/asset_spec.rb +119 -35
- data/spec/spec_helper.rb +9 -3
- metadata +95 -234
- data/app/assets/images/effective_assets/s3_down_button.gif +0 -0
- data/app/assets/images/effective_assets/s3_over_button.gif +0 -0
- data/app/assets/images/effective_assets/s3_up_button.gif +0 -0
- data/app/assets/images/effective_assets/s3_upload.swf +0 -0
- data/app/assets/javascripts/effective_assets/asset_box_input.js.coffee +0 -71
- data/app/assets/javascripts/effective_assets/asset_box_uploader.js +0 -122
- data/app/assets/javascripts/effective_assets/asset_box_uploader_customization.js +0 -166
- data/app/controllers/effective/attachments_controller.rb +0 -14
- data/app/views/asset_box_input/_attachment_fields.html.haml +0 -14
- data/spec/dummy/README.rdoc +0 -261
- data/spec/dummy/Rakefile +0 -7
- data/spec/dummy/app/assets/javascripts/application.js +0 -15
- data/spec/dummy/app/assets/stylesheets/application.css +0 -13
- data/spec/dummy/app/controllers/application_controller.rb +0 -3
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/config/application.rb +0 -65
- data/spec/dummy/config/boot.rb +0 -10
- data/spec/dummy/config/database.yml +0 -25
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -37
- data/spec/dummy/config/environments/production.rb +0 -67
- data/spec/dummy/config/environments/test.rb +0 -37
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/inflections.rb +0 -15
- data/spec/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy/config/initializers/secret_token.rb +0 -7
- data/spec/dummy/config/initializers/session_store.rb +0 -8
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy/config/locales/en.yml +0 -5
- data/spec/dummy/config/routes.rb +0 -58
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +0 -16
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +0 -71
- data/spec/dummy/log/test.log +0 -33
- data/spec/dummy/public/404.html +0 -26
- data/spec/dummy/public/422.html +0 -26
- data/spec/dummy/public/500.html +0 -25
- data/spec/dummy/script/rails +0 -6
- data/spec/dummy/spec_link +0 -3
@@ -0,0 +1,268 @@
|
|
1
|
+
$ = jQuery
|
2
|
+
|
3
|
+
$.fn.S3Uploader = (options) ->
|
4
|
+
|
5
|
+
# support multiple elements
|
6
|
+
if @length > 1
|
7
|
+
@each -> $(this).S3Uploader options
|
8
|
+
return this
|
9
|
+
|
10
|
+
$uploadForm = this # the .asset-box-uploader div .asset-box-input > [.attachments, .uploads, .asset-box-uploader]
|
11
|
+
|
12
|
+
settings =
|
13
|
+
url: ''
|
14
|
+
remove_completed_progress_bar: true
|
15
|
+
remove_failed_progress_bar: true
|
16
|
+
progress_bar_target: null
|
17
|
+
progress_bar_template: null
|
18
|
+
allow_multiple_files: true
|
19
|
+
valid_s3_keys: ['key', 'acl', 'AWSAccessKeyId', 'policy', 'signature', 'success_action_status', 'X-Requested-With', 'content-type']
|
20
|
+
create_asset_url: null
|
21
|
+
update_asset_url: null
|
22
|
+
file_types: 'any'
|
23
|
+
|
24
|
+
$.extend settings, options
|
25
|
+
|
26
|
+
current_files = []
|
27
|
+
|
28
|
+
setUploadForm = ->
|
29
|
+
$uploadForm.fileupload
|
30
|
+
url: settings.url
|
31
|
+
|
32
|
+
add: (e, data) ->
|
33
|
+
file = data.files[0]
|
34
|
+
|
35
|
+
# Check File Type
|
36
|
+
if settings.file_types != 'any'
|
37
|
+
types = new RegExp("(\.|\/)(#{settings.file_types})$")
|
38
|
+
unless types.test(file.type) || types.test(file.name.toLowerCase())
|
39
|
+
alert("Unable to add #{file.name}.\n\nOnly #{settings.file_types.replace(/\|/g, ', ')} files allowed.")
|
40
|
+
return false
|
41
|
+
|
42
|
+
# We're all good. Let's go ahead and add this
|
43
|
+
current_files.push data
|
44
|
+
$uploadForm.trigger("s3_file_added", [e, file])
|
45
|
+
|
46
|
+
template = settings.progress_bar_template
|
47
|
+
data.context = $($.trim(tmpl(template.html(), file)))
|
48
|
+
$(data.context).appendTo(settings.progress_bar_target)
|
49
|
+
data.submit()
|
50
|
+
|
51
|
+
start: (e) ->
|
52
|
+
$uploadForm.trigger("s3_uploads_start", [e])
|
53
|
+
disable_submit()
|
54
|
+
|
55
|
+
progress: (e, data) ->
|
56
|
+
if data.context
|
57
|
+
progress = parseInt(data.loaded / data.total * 100, 10)
|
58
|
+
data.context.find('.bar').css('width', progress + '%').html(format_bitrate(data.bitrate))
|
59
|
+
data.context.find('.progress > span').remove()
|
60
|
+
|
61
|
+
done: (e, data) ->
|
62
|
+
content = build_content_object($uploadForm, data.files[0], data.result)
|
63
|
+
|
64
|
+
if settings.update_asset_url
|
65
|
+
update_asset_and_load_attachment(content)
|
66
|
+
|
67
|
+
data.context.fadeOut('slow', -> $(this).remove()) if data.context && settings.remove_completed_progress_bar # remove progress bar
|
68
|
+
$uploadForm.trigger("s3_upload_complete", [$uploadForm, content])
|
69
|
+
|
70
|
+
current_files.splice($.inArray(data, current_files), 1) # remove that element from the array
|
71
|
+
|
72
|
+
unless current_files.length
|
73
|
+
$uploadForm.trigger("s3_uploads_complete", [$uploadForm, content])
|
74
|
+
enable_submit()
|
75
|
+
|
76
|
+
fail: (e, data) ->
|
77
|
+
content = build_content_object($uploadForm, data.files[0], data.result)
|
78
|
+
content.error_thrown = data.errorThrown
|
79
|
+
|
80
|
+
data.context.fadeOut('slow', -> $(this).remove()) if data.context && settings.remove_failed_progress_bar # remove progress bar
|
81
|
+
$uploadForm.trigger("s3_upload_failed", [$uploadForm, content])
|
82
|
+
enable_submit()
|
83
|
+
|
84
|
+
formData: (form) ->
|
85
|
+
inputs = form.find($uploadForm).children('input')
|
86
|
+
inputs.each -> $(this).prop('disabled', false)
|
87
|
+
data = inputs.serializeArray()
|
88
|
+
|
89
|
+
inputs = form.find($uploadForm).children("input:not([name='file'])")
|
90
|
+
inputs.each -> $(this).prop('disabled', true)
|
91
|
+
|
92
|
+
fileType = ""
|
93
|
+
if "type" of @files[0]
|
94
|
+
fileType = @files[0].type
|
95
|
+
data.push
|
96
|
+
name: "content-type"
|
97
|
+
value: fileType
|
98
|
+
|
99
|
+
# Remove anything we can't submit to S3
|
100
|
+
for item in data
|
101
|
+
data.splice(data.indexOf(data), 1) unless item.name in settings.valid_s3_keys
|
102
|
+
|
103
|
+
# Ask our server for a unique ID for this Asset
|
104
|
+
asset = create_asset(@files[0])
|
105
|
+
@files[0].asset_id = asset.id
|
106
|
+
key = asset.s3_key
|
107
|
+
|
108
|
+
# substitute upload timestamp and unique_id into key
|
109
|
+
key_field = $.grep data, (n) ->
|
110
|
+
n if n.name == "key"
|
111
|
+
|
112
|
+
if key_field.length > 0
|
113
|
+
key_field[0].value = key
|
114
|
+
|
115
|
+
# IE <= 9 doesn't have XHR2 hence it can't use formData
|
116
|
+
# replace 'key' field to submit form
|
117
|
+
unless 'FormData' of window
|
118
|
+
$uploadForm.find("input[name='key']").val(key)
|
119
|
+
data
|
120
|
+
|
121
|
+
build_content_object = ($uploadForm, file, result) ->
|
122
|
+
content = {}
|
123
|
+
if result # Use the S3 response to set the URL to avoid character encodings bugs
|
124
|
+
content.url = $(result).find("Location").text()
|
125
|
+
content.filepath = $('<a />').attr('href', content.url)[0].pathname
|
126
|
+
else # IE <= 9 return a null result object so we use the file object instead
|
127
|
+
domain = settings.url
|
128
|
+
content.filepath = $uploadForm.find('input[name=key]').val().replace('/${filename}', '')
|
129
|
+
content.url = domain + content.filepath + '/' + encodeURIComponent(file.name)
|
130
|
+
|
131
|
+
content.url = s3urlDecode(content.url)
|
132
|
+
content.filepath = s3urlDecode(content.filepath)
|
133
|
+
|
134
|
+
content.filename = file.name
|
135
|
+
content.filesize = file.size if 'size' of file
|
136
|
+
content.lastModifiedDate = file.lastModifiedDate if 'lastModifiedDate' of file
|
137
|
+
content.filetype = file.type if 'type' of file
|
138
|
+
content.asset_id = file.asset_id if 'asset_id' of file
|
139
|
+
content.relativePath = build_relativePath(file) if has_relativePath(file)
|
140
|
+
content
|
141
|
+
|
142
|
+
has_relativePath = (file) ->
|
143
|
+
file.relativePath || file.webkitRelativePath
|
144
|
+
|
145
|
+
build_relativePath = (file) ->
|
146
|
+
file.relativePath || (file.webkitRelativePath.split("/")[0..-2].join("/") + "/" if file.webkitRelativePath)
|
147
|
+
|
148
|
+
s3urlDecode = (url) -> url.replace(/%2F/g, "/").replace(/\+/g, '%20')
|
149
|
+
|
150
|
+
extra_fields_for_asset = ->
|
151
|
+
# Any field in our form that shares our name like effective_asset[#{box}][something2] should be gotten
|
152
|
+
# And we return something2 => something2.value
|
153
|
+
box = $uploadForm.closest('.asset-box-input').data('box')
|
154
|
+
fields = $uploadForm.closest('form').find(":input[name*='[#{box}]']").serializeArray()
|
155
|
+
|
156
|
+
extra = {}
|
157
|
+
|
158
|
+
$.each fields, (i, field) ->
|
159
|
+
pieces = field.name.split('[').map (piece) -> piece.replace(']', '')
|
160
|
+
|
161
|
+
if (index_of_box = pieces.indexOf(box)) == -1
|
162
|
+
name = pieces.join()
|
163
|
+
else
|
164
|
+
name = pieces.slice(index_of_box+1, pieces.length).join()
|
165
|
+
|
166
|
+
extra[name] = field.value if name.length > 0
|
167
|
+
|
168
|
+
extra
|
169
|
+
|
170
|
+
create_asset = (file) ->
|
171
|
+
asset = 'false'
|
172
|
+
|
173
|
+
$.ajax
|
174
|
+
url: settings.create_asset_url
|
175
|
+
type: 'POST'
|
176
|
+
dataType: 'json'
|
177
|
+
data:
|
178
|
+
title: file.name
|
179
|
+
content_type: file.type
|
180
|
+
data_size: file.size
|
181
|
+
extra: extra_fields_for_asset()
|
182
|
+
async: false
|
183
|
+
success: (data) -> asset = data
|
184
|
+
|
185
|
+
asset
|
186
|
+
|
187
|
+
update_asset_and_load_attachment = (file) ->
|
188
|
+
asset_box = $uploadForm.closest('.asset-box-input')
|
189
|
+
|
190
|
+
$.ajax
|
191
|
+
url: settings.update_asset_url.replace(':id', file.asset_id)
|
192
|
+
type: 'PUT'
|
193
|
+
data:
|
194
|
+
upload_file: file.url
|
195
|
+
data_size: file.filesize
|
196
|
+
content_type: file.filetype
|
197
|
+
title: file.filename
|
198
|
+
attachable_type: asset_box.data('attachable-type')
|
199
|
+
attachable_id: asset_box.data('attachable-id')
|
200
|
+
attachable_object_name: asset_box.data('attachable-object-name')
|
201
|
+
attachment_style: asset_box.data('attachment-style')
|
202
|
+
attachment_actions: asset_box.data('attachment-actions')
|
203
|
+
aws_acl: asset_box.data('aws-acl')
|
204
|
+
box: asset_box.data('box')
|
205
|
+
async: true
|
206
|
+
success: (data) ->
|
207
|
+
limit = asset_box.data('limit')
|
208
|
+
|
209
|
+
if limit == 10000 # Guard value for no limit
|
210
|
+
asset_box.find('.attachments').append($(data))
|
211
|
+
else
|
212
|
+
asset_box.find('.attachments').prepend($(data))
|
213
|
+
|
214
|
+
asset_box.find("input.asset-box-remove").each (index) ->
|
215
|
+
if "#{$(this).val()}" == '1' # If we're going to delete it...
|
216
|
+
$(this).closest('.attachment').hide()
|
217
|
+
limit = limit + 1
|
218
|
+
return
|
219
|
+
|
220
|
+
if index >= limit
|
221
|
+
$(this).closest('.attachment').hide()
|
222
|
+
else
|
223
|
+
$(this).closest('.attachment').show()
|
224
|
+
|
225
|
+
|
226
|
+
disable_submit = ->
|
227
|
+
$uploadForm.data('effective-assets-uploading', true)
|
228
|
+
|
229
|
+
$uploadForm.closest('form').find('input[type=submit]').each ->
|
230
|
+
submit = $(this)
|
231
|
+
submit.data('effective-assets-original-label', submit.val()) if submit.data('effective-assets-original-label') == undefined
|
232
|
+
submit.prop('disabled', true)
|
233
|
+
submit.val('Uploading...')
|
234
|
+
|
235
|
+
enable_submit = ->
|
236
|
+
$uploadForm.data('effective-assets-uploading', false)
|
237
|
+
|
238
|
+
anyUploading = false
|
239
|
+
$uploadForm.closest('form').find('.asset-box-uploader').each ->
|
240
|
+
anyUploading = true if $(this).data('effective-assets-uploading') == true
|
241
|
+
|
242
|
+
unless anyUploading
|
243
|
+
$uploadForm.closest('form').find('input[type=submit]').each ->
|
244
|
+
submit = $(this)
|
245
|
+
submit.val(submit.data('effective-assets-original-label') || 'Submit')
|
246
|
+
submit.prop('disabled', false)
|
247
|
+
submit.removeData('effective-assets-original-label')
|
248
|
+
|
249
|
+
format_bitrate = (bits) ->
|
250
|
+
if typeof bits != 'number'
|
251
|
+
''
|
252
|
+
else if (bits >= 1000000000)
|
253
|
+
(bits / 1000000000).toFixed(2) + ' Gbit/s'
|
254
|
+
else if (bits >= 1000000)
|
255
|
+
(bits / 1000000).toFixed(2) + ' Mbit/s'
|
256
|
+
else if (bits >= 1000)
|
257
|
+
(bits / 1000).toFixed(2) + ' kbit/s'
|
258
|
+
else
|
259
|
+
bits.toFixed(2) + ' bit/s'
|
260
|
+
|
261
|
+
#public methods
|
262
|
+
@initialize = ->
|
263
|
+
# Save key for IE9 Fix
|
264
|
+
$uploadForm.data("key", $uploadForm.find("input[name='key']").val())
|
265
|
+
setUploadForm()
|
266
|
+
this
|
267
|
+
|
268
|
+
@initialize()
|
@@ -0,0 +1,28 @@
|
|
1
|
+
getCkEditorFuncNum = ->
|
2
|
+
reParam = new RegExp( '(?:[\?&]|&)' + 'CKEditorFuncNum' + '=([^&]+)', 'i' )
|
3
|
+
match = window.location.search.match(reParam)
|
4
|
+
|
5
|
+
if match && match.length > 0
|
6
|
+
match[1]
|
7
|
+
|
8
|
+
$(document).on 'click', 'a.attachment-insert', (event) ->
|
9
|
+
ckeditor = getCkEditorFuncNum()
|
10
|
+
|
11
|
+
if ckeditor && window.opener && window.opener.CKEDITOR
|
12
|
+
event.preventDefault()
|
13
|
+
|
14
|
+
obj = $(event.currentTarget)
|
15
|
+
asset = $(obj.data('asset'))
|
16
|
+
|
17
|
+
url = asset.attr('src') || asset.attr('href')
|
18
|
+
alt = asset.attr('alt') || ''
|
19
|
+
|
20
|
+
window.opener.CKEDITOR.tools.callFunction(ckeditor, url, ->
|
21
|
+
dialog = this.getDialog()
|
22
|
+
|
23
|
+
if dialog && dialog.getName() == 'image2'
|
24
|
+
dialog.getContentElement('info', 'alt').setValue(alt)
|
25
|
+
)
|
26
|
+
|
27
|
+
window.close()
|
28
|
+
|
@@ -0,0 +1,57 @@
|
|
1
|
+
body.active_admin {
|
2
|
+
.asset-box-input {
|
3
|
+
@import "effective_assets/input_bootstrap";
|
4
|
+
margin-left: 20%;
|
5
|
+
|
6
|
+
.thumbnails { // This was added for active_admin
|
7
|
+
margin-left: 0px;
|
8
|
+
position: relative;
|
9
|
+
left: -20px;
|
10
|
+
}
|
11
|
+
}
|
12
|
+
|
13
|
+
@import "effective_assets/asset_box_input";
|
14
|
+
|
15
|
+
// This is for the ActiveAdmin Attach... functionality
|
16
|
+
.effective-assets-overlay {
|
17
|
+
background-color: rgba(0, 0, 0, 0.7);
|
18
|
+
position: fixed;
|
19
|
+
left: 0;
|
20
|
+
top: 0;
|
21
|
+
width: 100%;
|
22
|
+
height: 100%;
|
23
|
+
opacity: 1.0;
|
24
|
+
z-index: 2000;
|
25
|
+
}
|
26
|
+
|
27
|
+
.effective-assets-dialog {
|
28
|
+
position: fixed !important;
|
29
|
+
top: 40px !important;
|
30
|
+
z-index: 2001;
|
31
|
+
|
32
|
+
.ui-dialog-titlebar { display: none; }
|
33
|
+
|
34
|
+
.ui-dialog-buttonpane {
|
35
|
+
-moz-border-bottom-colors: none;
|
36
|
+
-moz-border-left-colors: none;
|
37
|
+
-moz-border-right-colors: none;
|
38
|
+
-moz-border-top-colors: none;
|
39
|
+
background: -moz-linear-gradient(-90deg, #EFEFEF, #DFE1E2) repeat scroll 0 0 rgba(0, 0, 0, 0);
|
40
|
+
border-color: #E6E6E6 #D4D4D4 #EEEEEE;
|
41
|
+
border-image: none;
|
42
|
+
border-style: solid;
|
43
|
+
border-width: 1px;
|
44
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.37);
|
45
|
+
color: #5E6469;
|
46
|
+
font-size: 1em;
|
47
|
+
font-weight: bold;
|
48
|
+
line-height: 18px;
|
49
|
+
margin-bottom: 0.5em;
|
50
|
+
padding: 5px 10px 3px;
|
51
|
+
text-shadow: 0 1px 0 #FFFFFF;
|
52
|
+
|
53
|
+
button { margin: 2px; }
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
}
|
@@ -1,8 +1,3 @@
|
|
1
|
-
@mixin clearfix {
|
2
|
-
display: block;
|
3
|
-
&:after { content:"\0020";display:block;height:0;clear:both;visibility:hidden;overflow:hidden; }
|
4
|
-
}
|
5
|
-
|
6
1
|
@mixin border-radius ($radius) {
|
7
2
|
position: relative;
|
8
3
|
-webkit-border-radius: $radius;
|
@@ -12,195 +7,79 @@
|
|
12
7
|
border-radius: $radius;
|
13
8
|
}
|
14
9
|
|
15
|
-
.
|
16
|
-
width:
|
17
|
-
|
18
|
-
text-align: left;
|
10
|
+
.asset-box-input {
|
11
|
+
width: 100%;
|
12
|
+
height: 100%;
|
19
13
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
14
|
+
// asset_box_input/attachment_as_table
|
15
|
+
tbody.attachments {
|
16
|
+
.attachment-image img {
|
17
|
+
max-height: 48px;
|
18
|
+
}
|
25
19
|
}
|
26
20
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
padding: 0;
|
31
|
-
margin: 0;
|
32
|
-
|
33
|
-
li {
|
34
|
-
border: 1px solid #B7B9BB;
|
35
|
-
height: 60px;
|
36
|
-
line-height: 45px;
|
21
|
+
// asset_box_input/attachment_as_list
|
22
|
+
ul.attachments {
|
23
|
+
.attachment {
|
37
24
|
position: relative;
|
38
|
-
padding: 0 0 25px 0;
|
39
|
-
}
|
40
|
-
|
41
|
-
.progress {
|
42
|
-
display: block;
|
43
|
-
height: 85px;
|
44
|
-
text-align: right;
|
45
|
-
background: #EFEFEF;
|
46
|
-
background: -webkit-gradient(linear, left top, left bottom, from(#EFEFEF), to(#DFE1E2));
|
47
|
-
background: -moz-linear-gradient(-90deg, #EFEFEF, #DFE1E2);
|
48
|
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#efefef, endColorstr=#dfe1e2);
|
49
|
-
-ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#efefef, endColorstr=#dfe1e2);
|
50
25
|
|
51
|
-
.
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
color: #666;
|
56
|
-
text-shadow: 1px 1px #fff;
|
26
|
+
.attachment-title {
|
27
|
+
overflow: hidden;
|
28
|
+
word-break: keep-all;
|
29
|
+
text-align: left;
|
57
30
|
}
|
58
|
-
}
|
59
|
-
|
60
|
-
.file_name {
|
61
|
-
display: block;
|
62
|
-
position: absolute;
|
63
|
-
font-weight: bold;
|
64
|
-
margin: 0 0 15px 10px;
|
65
|
-
}
|
66
|
-
|
67
|
-
.file_size {
|
68
|
-
display: block;
|
69
|
-
position: absolute;
|
70
|
-
right: 10px;
|
71
|
-
bottom: 0;
|
72
|
-
line-height: 2;
|
73
|
-
color: #AEAEAE;
|
74
|
-
}
|
75
31
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
display: block;
|
81
|
-
|
82
|
-
label {
|
83
|
-
float: left !important;
|
84
|
-
line-height: 2 !important;
|
85
|
-
margin-right: 4px !important;
|
86
|
-
}
|
87
|
-
|
88
|
-
input[type="text"] {
|
89
|
-
float: left !important;
|
90
|
-
margin-right: 30px !important;
|
91
|
-
width: 130px !important;
|
32
|
+
.attachment-remove {
|
33
|
+
position: absolute;
|
34
|
+
top: 0px;
|
35
|
+
right: 7px;
|
92
36
|
}
|
93
37
|
}
|
94
38
|
}
|
95
39
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
.file_done_list {
|
101
|
-
.progress { width: 100%; }
|
102
|
-
}
|
103
|
-
|
104
|
-
.overall {
|
105
|
-
border: 1px solid #B7B9BB;
|
106
|
-
height: 35px;
|
107
|
-
line-height: 35px;
|
108
|
-
position: relative;
|
109
|
-
font-size: 130%;
|
110
|
-
margin-bottom: 10px;
|
40
|
+
// asset_box_input/attachment_as_thumbnail
|
41
|
+
div.attachments {
|
42
|
+
.attachment {
|
43
|
+
position: relative;
|
111
44
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
background: -moz-linear-gradient(-90deg, #6A7176, #4D5256);
|
118
|
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6a7176, endColorstr=#4d5256);
|
119
|
-
-ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#6a7176, endColorstr=#4d5256);
|
45
|
+
.attachment-title {
|
46
|
+
overflow: hidden;
|
47
|
+
word-break: keep-all;
|
48
|
+
text-align: center;
|
49
|
+
}
|
120
50
|
|
121
|
-
.
|
122
|
-
padding-right: 0px;
|
123
|
-
color: #eaeaea;
|
124
|
-
text-shadow: 1px 1px #333;
|
51
|
+
.attachment-remove {
|
125
52
|
position: absolute;
|
126
|
-
|
53
|
+
top: 7px;
|
54
|
+
right: 22px;
|
127
55
|
}
|
128
56
|
}
|
129
|
-
|
130
|
-
.status {
|
131
|
-
text-align: center;
|
132
|
-
display: block;
|
133
|
-
width: 100%;
|
134
|
-
font-weight: bold;
|
135
|
-
color: #aaa;
|
136
|
-
position: absolute;
|
137
|
-
}
|
138
|
-
|
139
57
|
}
|
140
58
|
|
141
|
-
.
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
59
|
+
.uploads {
|
60
|
+
.upload {
|
61
|
+
border-top: solid 1px #CCC;
|
62
|
+
width: 100%;
|
63
|
+
min-width: 400px;
|
64
|
+
padding-top: 10px;
|
65
|
+
margin-top: 10px;
|
66
|
+
|
67
|
+
.progress {
|
68
|
+
margin-top: 8px;
|
69
|
+
border: solid 1px #555;
|
70
|
+
@include border-radius(3px);
|
71
|
+
|
72
|
+
.spinner {
|
73
|
+
height: 20px;
|
74
|
+
width: 20px;
|
75
|
+
}
|
76
|
+
|
77
|
+
.bar {
|
78
|
+
height: 100%;
|
79
|
+
background: #3EC144;
|
80
|
+
}
|
81
|
+
}
|
153
82
|
}
|
154
83
|
}
|
155
|
-
|
156
|
-
label {
|
157
|
-
float: none;
|
158
|
-
width: auto !important;
|
159
|
-
text-align: left;
|
160
|
-
margin: 0 !important;
|
161
|
-
}
|
162
|
-
}
|
163
|
-
|
164
|
-
.asset-box-attachment {
|
165
|
-
position: relative;
|
166
|
-
width: 128px;
|
167
|
-
float: left;
|
168
|
-
margin-right: 20px;
|
169
|
-
height: 190px;
|
170
|
-
|
171
|
-
p.title {
|
172
|
-
font-size: 14px;
|
173
|
-
color: #818181;
|
174
|
-
padding: 10px;
|
175
|
-
margin: 0;
|
176
|
-
}
|
177
|
-
}
|
178
|
-
|
179
|
-
.asset-box-spinner {
|
180
|
-
height: 128px;
|
181
|
-
width: 128px;
|
182
|
-
background: rgba(255,255,255,0.8) image-url('effective_assets/spinner.gif') no-repeat center center;
|
183
|
-
display: block;
|
184
|
-
margin-bottom: 6px;
|
185
84
|
}
|
186
85
|
|
187
|
-
.attachments {
|
188
|
-
@include clearfix;
|
189
|
-
}
|
190
|
-
|
191
|
-
.file_to_upload .delete, .asset-box-remove {
|
192
|
-
@include border-radius(3px);
|
193
|
-
display: block;
|
194
|
-
position: absolute;
|
195
|
-
background: rgba(255,255,255,0.8) image-url('effective_assets/icon_close.png') no-repeat center center;
|
196
|
-
text-indent: -99999px !important;
|
197
|
-
height: 20px;
|
198
|
-
width: 20px;
|
199
|
-
right: 10px;
|
200
|
-
top: 10px;
|
201
|
-
cursor: pointer;
|
202
|
-
}
|
203
|
-
|
204
|
-
.assets {
|
205
|
-
clear: both;
|
206
|
-
}
|