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: 6e9be785292bfb80e02f63626119a0b7b971aff1
4
- data.tar.gz: 32fadf6a9d75f5fab6b1b2a86fc0375ad824af75
3
+ metadata.gz: 2585e4b33084210d913ed9f4a5d04218cb8316a2
4
+ data.tar.gz: 83e11b6e84b5255f8cd7f63db8dca99f018041f4
5
5
  SHA512:
6
- metadata.gz: 716859928f5653a83b2ddf984a8f5bea9a175dec7ae75c91015a0edb65f8f55c6579003888287947eae7e879e918d487600f1377865a1881a5feb45c0b1b266d
7
- data.tar.gz: ba5b217008e6c55b39e30e7c2ce9b39eb3f325feea919dd88e7d09975d61956664398cf6f8ccf4ce20b10a2ba960ad078c026e3a4a49dc183ffead3eb4eaf6f9
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 3 environment variables:
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}.s3.amazonaws.com/"
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: "http://localhost:3000/",
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
@@ -1,3 +1,3 @@
1
1
  module TinymceAwsFileUpload
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tinymce_aws_file_upload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ariel Schvartz