rails_kindeditor 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66f2473afc715a6acb5b4d9d409d8e1e954f074f
4
- data.tar.gz: db64a6dc2c6fc7d9168c5ce6e0874983653772f3
3
+ metadata.gz: adc58562fa6e23f4a3950d6265c474596ffeb061
4
+ data.tar.gz: fc1df1f4d38711ed2c3a756a41886866daac53a3
5
5
  SHA512:
6
- metadata.gz: 14bbd52ce96ba95977fb855182b1aa07c0c66a4737389ea22cf94ad8fcefed5eac8df8dca08828832a0f344b8cf1ae48262ac54fa38375a19110d23c1c216ebf
7
- data.tar.gz: 1989a75fef926c16fb4451d0e23d0dea67adb57cd2d96f0d1f18b637e811ce367126c63958f1ee11ede7373134901703af5a82e39b0da3e5555e9383b7aee661
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.kindeditor_tag :content, :simple_mode => true
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.kindeditor_tag :content, :simple_mode => true
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
- "#{root_url}kindeditor/upload#{owner_id_query_string}"
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
- "#{root_url}kindeditor/filemanager"
26
+ "#{main_app_root_url}kindeditor/filemanager"
27
27
  end
28
28
 
29
29
  private
30
30
 
31
- def root_url
32
- main_app.respond_to?(:root_url) ? main_app.root_url : '/'
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 'SecureRandom'
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;
@@ -1,4 +1,4 @@
1
1
  module RailsKindeditor
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.5"
3
3
  end
4
4
 
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
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: 2013-12-05 00:00:00.000000000 Z
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.0.6
305
+ rubygems_version: 2.1.11
306
306
  signing_key:
307
307
  specification_version: 4
308
308
  summary: Kindeditor for Ruby on Rails