tinymce-rails-imageupload 3.4.9 → 3.4.9.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,7 @@
1
+ ## 3.4.9.1 (April 24, 2012)
2
+
3
+ * Work with Rails' CSRF protection by copying the token into our form before submitting it
4
+
1
5
  ## 3.4.9 (April 5, 2012)
2
6
 
3
7
  * Document how to use I18n with the gem
data/README.markdown CHANGED
@@ -25,12 +25,14 @@ Set up TinyMCE as you would normally, but in the call to `.tinymce()`, add
25
25
 
26
26
  and the rest should happen automatically.
27
27
 
28
- The plugin POSTs to `/tinymce_assets` by default, which is currently not configurable.
28
+ The plugin POSTs to `/tinymce_assets` by default, which is currently not configurable ([issue #3](https://github.com/PerfectlyNormal/tinymce-rails-imageupload/issues/3)).
29
29
  Set it up using something similar in `routes.rb`
30
30
 
31
31
  post '/tinymce_assets' => 'tinymce_assets#create'
32
32
 
33
- This action gets called with a file parameter creatively called `file`, and must respond with JSON, containing the URL to the image. Example:
33
+ This action gets called with a file parameter creatively called `file`, and must respond with JSON, containing the URL to the image.
34
+ The JSON has to be returned with a content type of "text/html" to work, which is going to be fixed as soon as possible ([issue #7](https://github.com/PerfectlyNormal/tinymce-rails-imageupload/issues/7)).
35
+ Example:
34
36
 
35
37
  class TinymceAssetsController < ApplicationController
36
38
  def create
@@ -40,7 +42,7 @@ This action gets called with a file parameter creatively called `file`, and must
40
42
  image: {
41
43
  url: view_context.image_url(image)
42
44
  }
43
- }
45
+ }, content_type: "text/html"
44
46
  end
45
47
  end
46
48
 
@@ -48,7 +50,9 @@ If the JSON response contains a `width` and/or `height` key, those will be used
48
50
 
49
51
  ## Internationalization
50
52
 
51
- I18n is taken care of by `tinymce-rails`. This gem includes strings for English and Norwegian. To add your own language, create the files `<code>.js` and `<code>_dlg.js` in `vendor/assets/javascripts/tinymce/plugins/uploadimage/langs` in your application.
53
+ I18n is taken care of by `tinymce-rails`. This gem includes strings for English and Norwegian.
54
+ To add your own language, create the files `<code>.js` and `<code>_dlg.js` in `vendor/assets/javascripts/tinymce/plugins/uploadimage/langs` in your application,
55
+ or fork the gem and add your own translations there.
52
56
 
53
57
  The available strings are listed below:
54
58
 
@@ -1,7 +1,7 @@
1
1
  module Tinymce
2
2
  module Rails
3
3
  module Imageupload
4
- VERSION = "3.4.9"
4
+ VERSION = "3.4.9.1"
5
5
  end
6
6
  end
7
7
  end
@@ -44,6 +44,7 @@
44
44
  },
45
45
 
46
46
  insert: function() {
47
+ document.getElementById("authenticity_token").value = tinyMCE.$("meta[name='csrf-token']")[0].content;
47
48
  document.forms[0].submit();
48
49
  }
49
50
  };
@@ -54,6 +55,7 @@
54
55
  <body>
55
56
  <form method="post" enctype='multipart/form-data' accept-charset="UTF-8" target="hidden_upload" action='/tinymce_assets' name="uploadimageForm">
56
57
  <input type="hidden" name="utf8" value="✓">
58
+ <input type="hidden" name="authenticity_token" id="authenticity_token" value="">
57
59
  <iframe id="hidden_upload" name="hidden_upload" src='' onload='uploadDone("hidden_upload")' style='width:0;height:0;border:0px solid #fff'></iframe>
58
60
 
59
61
  <h1>{#uploadimage_dlg.header}</h1>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tinymce-rails-imageupload
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.9
4
+ version: 3.4.9.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-05 00:00:00.000000000 Z
12
+ date: 2012-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
16
- requirement: &6045900 !ruby/object:Gem::Requirement
16
+ requirement: &3266980 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *6045900
24
+ version_requirements: *3266980
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: tinymce-rails
27
- requirement: &6044200 !ruby/object:Gem::Requirement
27
+ requirement: &3265820 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 3.4.9
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *6044200
35
+ version_requirements: *3265820
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bundler
38
- requirement: &5180520 !ruby/object:Gem::Requirement
38
+ requirement: &3264980 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.0.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *5180520
46
+ version_requirements: *3264980
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rails
49
- requirement: &5179840 !ruby/object:Gem::Requirement
49
+ requirement: &3264180 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '3.1'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *5179840
57
+ version_requirements: *3264180
58
58
  description: TinyMCE plugin for taking image uploads in Rails >= 3.1
59
59
  email:
60
60
  - perchr@northblue.org