rails_kindeditor 0.3.18 → 0.3.19

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: b3dc74f16ab4f4f760f3a76336079ebfe81442ed
4
- data.tar.gz: bbdafec8a442c643d7f4c21dda19a4f3a1bb01d7
3
+ metadata.gz: f051713b361f1eaeb094c8ff8ea1f9399cfe99d4
4
+ data.tar.gz: ead6e7b8a42d747ecf889e64bff980f3df6c80fb
5
5
  SHA512:
6
- metadata.gz: efa75924a62806a2e10ea7f9b4c2276fc86636c570bf4cc6e5d4de01fce21b12f6f34fd80dae073b61d3717105b8a30d5b007eab778731f653e52acbf9d34d69
7
- data.tar.gz: 990a07e11462e58dbbff0e5c1f9ca06659a96c70a944386cf76fc7eff7702338600871cfff0bdfde3c17a0d86e8f0c92bd177b40bcb2e5f1f9eb3437dffac6f7
6
+ metadata.gz: 95f844d3a29b958041be1066e50bc89683d55fd107df9aee43389220343be7cb1a404bdd8a1a0adbb4af6bd5762e27e535c7e0bcc376860139f3cf2e1bd40125
7
+ data.tar.gz: 2e1447e268d1080dd332d2760bdce1efb9a738a9b2e3db1831638c7bc63a4a8d09b5cf5ea7dd264f87e26e1657b2714dac75b2d347e92b9dfd72de65c9f7fbd5
data/README.md CHANGED
@@ -10,7 +10,7 @@ rails_kindeditor will helps your rails app integrate with kindeditor, includes i
10
10
  ### Add this to your Gemfile
11
11
 
12
12
  ```ruby
13
- gem 'rails_kindeditor', '~> 0.3.18'
13
+ gem 'rails_kindeditor', '~> 0.3.19'
14
14
  ```
15
15
 
16
16
  ### Run "bundle" command.
@@ -172,7 +172,7 @@ rails_kindeditor可以帮助你的rails程序集成kindeditor,包括了图片和
172
172
  ### 将下面代码加入Gemfile:
173
173
 
174
174
  ```ruby
175
- gem 'rails_kindeditor', '~> 0.3.18'
175
+ gem 'rails_kindeditor', '~> 0.3.19'
176
176
  ```
177
177
 
178
178
  ### 运行"bundle"命令:
@@ -1,4 +1,4 @@
1
1
  module RailsKindeditor
2
- VERSION = "0.3.18"
2
+ VERSION = "0.3.19"
3
3
  end
4
4
 
@@ -212,17 +212,27 @@ var _INLINE_TAG_MAP = _toMap('a,abbr,acronym,b,basefont,bdo,big,br,button,cite,c
212
212
  _AUTOCLOSE_TAG_MAP = _toMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr'),
213
213
  _FILL_ATTR_MAP = _toMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected'),
214
214
  _VALUE_TAG_MAP = _toMap('input,button,textarea,select');
215
+
216
+ // Begining of modification by Macrow
215
217
  function _getBasePath() {
216
218
  var els = document.getElementsByTagName('script'), src;
217
219
  for (var i = 0, len = els.length; i < len; i++) {
218
220
  src = els[i].src || '';
219
- if (/kindeditor[\w\-\.]*\.js/.test(src)) {
221
+ if (/kindeditor[\w\-\.]*\.js/.test(src)) { // in development mode
220
222
  return src.substring(0, src.lastIndexOf('/') + 1);
221
223
  }
224
+ if (/application[\w\-\.]*\.js/.test(src)) { // in production mode, we need application.js.
225
+ return src.substring(0, src.lastIndexOf('/') + 1) + 'kindeditor/';
226
+ }
227
+ if (/[\w\-\.]*\.js/.test(src)) { // if no application.js found, we just use the first js file path.
228
+ return src.substring(0, src.lastIndexOf('/') + 1) + 'kindeditor/';
229
+ }
222
230
  }
223
- return '';
231
+ return '/assets/kindeditor/';
224
232
  }
225
- K.basePath = '/assets/kindeditor/'; //_getBasePath(); ##### Modified by Macrow #####
233
+ // End of modification by Macrow
234
+
235
+ K.basePath = _getBasePath();
226
236
  K.options = {
227
237
  designMode : true,
228
238
  fullscreenMode : false,
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.3.18
4
+ version: 0.3.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Macrow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-06 00:00:00.000000000 Z
11
+ date: 2013-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carrierwave