rails_kindeditor 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/rails_kindeditor/helper.rb +9 -5
- data/lib/rails_kindeditor/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adc58562fa6e23f4a3950d6265c474596ffeb061
|
4
|
+
data.tar.gz: fc1df1f4d38711ed2c3a756a41886866daac53a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca79e861074bc168e3c00e38dd84792e695f296c1414a13d1833fc29f849abe4868fddf359fec9aa08473f99f0092f4b65c23aef055355eb4633e01a425b1f02
|
7
|
+
data.tar.gz: e6719f9e2dfc9ea3ac456e91891a5062bd879e1ff16e14701a5e0428cb7f73ab3b36949ebdb331ec23029a5685b2e5617f5fe2847d87dfbb7e334f8a6558ee95
|
data/README.md
CHANGED
@@ -60,7 +60,7 @@ additionally, rails_kindeditor provides one "simple_mode" parameter for render s
|
|
60
60
|
|
61
61
|
```ruby
|
62
62
|
kindeditor_tag :content, 'default content value', :simple_mode => true
|
63
|
-
f.
|
63
|
+
f.kindeditor :content, :simple_mode => true
|
64
64
|
f.input :content, :as => :kindeditor, :input_html => { :simple_mode => true } # simple_form & formtastic
|
65
65
|
```
|
66
66
|
|
@@ -309,7 +309,7 @@ rails_kindeditor可以帮助你的rails程序集成kindeditor,包括了图片和
|
|
309
309
|
|
310
310
|
```ruby
|
311
311
|
kindeditor_tag :content, 'default content value', :simple_mode => true
|
312
|
-
f.
|
312
|
+
f.kindeditor :content, :simple_mode => true
|
313
313
|
f.input :content, :as => :kindeditor, :input_html => { :simple_mode => true } # simple_form & formtastic
|
314
314
|
```
|
315
315
|
|
@@ -19,23 +19,27 @@ module RailsKindeditor
|
|
19
19
|
def kindeditor_upload_json_path(*args)
|
20
20
|
options = args.extract_options!
|
21
21
|
owner_id_query_string = options[:owner_id] ? "?owner_id=#{options[:owner_id]}" : ''
|
22
|
-
"#{
|
22
|
+
"#{main_app_root_url}kindeditor/upload#{owner_id_query_string}"
|
23
23
|
end
|
24
24
|
|
25
25
|
def kindeditor_file_manager_json_path
|
26
|
-
"#{
|
26
|
+
"#{main_app_root_url}kindeditor/filemanager"
|
27
27
|
end
|
28
28
|
|
29
29
|
private
|
30
30
|
|
31
|
-
def
|
32
|
-
|
31
|
+
def main_app_root_url
|
32
|
+
begin
|
33
|
+
main_app.root_url.slice(0, main_app.root_url.rindex(main_app.root_path)) + '/'
|
34
|
+
rescue
|
35
|
+
'/'
|
36
|
+
end
|
33
37
|
end
|
34
38
|
|
35
39
|
def js_replace(dom_id, options = {})
|
36
40
|
editor_id = options[:editor_id].nil? ? '' : "#{options[:editor_id].to_s.downcase} = "
|
37
41
|
if options[:window_onload]
|
38
|
-
require '
|
42
|
+
require 'securerandom'
|
39
43
|
random_name = SecureRandom.hex;
|
40
44
|
"var old_onload_#{random_name};
|
41
45
|
if(typeof window.onload == 'function') old_onload_#{random_name} = window.onload;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_kindeditor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Macrow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carrierwave
|
@@ -302,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
302
302
|
version: '0'
|
303
303
|
requirements: []
|
304
304
|
rubyforge_project: rails_kindeditor
|
305
|
-
rubygems_version: 2.
|
305
|
+
rubygems_version: 2.1.11
|
306
306
|
signing_key:
|
307
307
|
specification_version: 4
|
308
308
|
summary: Kindeditor for Ruby on Rails
|