tinymce_aws_file_upload 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2585e4b33084210d913ed9f4a5d04218cb8316a2
|
4
|
+
data.tar.gz: 83e11b6e84b5255f8cd7f63db8dca99f018041f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cc7653749db32c0d897c8f182ab258642535dfb155b735059c9f2987b1c06efb7b961cc4c5ba39d1176e61a273e3f2c7347898edfe11ea351262c1038fc1c66
|
7
|
+
data.tar.gz: b44d1ef8a274ed5ddfd5694e44f37d88e51c1e63dbd40254b88150f3c6544800d9bad897107be6fb56fed83216d136e8349daacd9210c80033c357d09846df0f
|
data/README.md
CHANGED
@@ -21,11 +21,13 @@ Or install it yourself as:
|
|
21
21
|
### On your application.js add the line:
|
22
22
|
//= require tinymce-aws-file-upload
|
23
23
|
|
24
|
-
### Add these
|
24
|
+
### Add these environment variables:
|
25
25
|
|
26
26
|
1. AWS_ACCESS_KEY_ID
|
27
27
|
2. AWS_SECRET_ACCESS_KEY
|
28
28
|
3. AWS_BUCKET
|
29
|
+
4. AWS_AREA
|
30
|
+
5. HOST (development will be http://localhost:3000/)
|
29
31
|
|
30
32
|
To get this values, go to AWS and create an Amazon S3 account. (http://aws.amazon.com/s3/)
|
31
33
|
|
@@ -18,7 +18,7 @@ root.set_amazon_direct_upload = (elem) ->
|
|
18
18
|
title: $file.name
|
19
19
|
success: (data) ->
|
20
20
|
fd = create_form_data(data, 'public-read', $file)
|
21
|
-
$url = "https://#{data.bucket}.
|
21
|
+
$url = "https://#{data.bucket}.#{data.s3_area}.amazonaws.com/"
|
22
22
|
$full_url = $url + data.key
|
23
23
|
create_cors_request(fd, $url, $full_url, elem)
|
24
24
|
|
@@ -49,6 +49,8 @@ create_cors_request = (form_data, url, full_url, elem) ->
|
|
49
49
|
|
50
50
|
uploadComplete = (full_url, elem) ->
|
51
51
|
elem.val full_url
|
52
|
+
root.stop_loading ?= ->
|
53
|
+
return null
|
52
54
|
root.stop_loading()
|
53
55
|
|
54
56
|
uploadProgress = (evt) ->
|
@@ -7,9 +7,10 @@ module TinymceAwsFileUpload
|
|
7
7
|
policy: s3_upload_policy_document,
|
8
8
|
signature: s3_upload_signature,
|
9
9
|
key: "uploads/#{SecureRandom.uuid}/#{params[:doc][:title]}",
|
10
|
-
success_action_redirect:
|
10
|
+
success_action_redirect: ENV['HOST'],
|
11
11
|
access_key_id: ENV['AWS_ACCESS_KEY_ID'],
|
12
|
-
bucket: ENV['AWS_BUCKET']
|
12
|
+
bucket: ENV['AWS_BUCKET'],
|
13
|
+
s3_area: ENV['AWS_AREA']
|
13
14
|
}
|
14
15
|
end
|
15
16
|
end
|