rails_kindeditor 0.4.0 → 0.4.1
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 +4 -4
- data/README.md +16 -8
- data/app/controllers/kindeditor/assets_controller.rb +1 -0
- data/lib/generators/rails_kindeditor/migration/templates/models/mongoid/kindeditor/asset.rb +5 -1
- data/lib/rails_kindeditor/version.rb +1 -1
- data/vendor/assets/javascripts/kindeditor/kindeditor.js +121 -49
- data/vendor/assets/javascripts/kindeditor/lang/ar.js +0 -0
- data/vendor/assets/javascripts/kindeditor/lang/en.js +0 -0
- data/vendor/assets/javascripts/kindeditor/lang/ko.js +0 -0
- data/vendor/assets/javascripts/kindeditor/lang/zh_CN.js +0 -0
- data/vendor/assets/javascripts/kindeditor/lang/zh_TW.js +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/autoheight/autoheight.js +20 -3
- data/vendor/assets/javascripts/kindeditor/plugins/baidumap/baidumap.js +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/baidumap/index.html +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/baidumap/map.html +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/clearhtml/clearhtml.js +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/code/code.js +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/code/prettify.css +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/code/prettify.js +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/emoticons.js +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/0.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/1.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/10.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/100.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/101.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/102.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/103.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/104.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/105.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/106.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/107.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/108.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/109.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/11.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/110.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/111.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/112.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/113.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/114.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/115.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/116.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/117.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/118.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/119.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/12.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/120.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/121.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/122.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/123.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/124.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/125.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/126.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/127.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/128.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/129.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/13.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/130.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/131.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/132.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/133.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/134.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/14.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/15.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/16.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/17.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/18.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/19.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/2.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/20.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/21.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/22.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/23.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/24.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/25.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/26.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/27.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/28.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/29.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/3.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/30.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/31.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/32.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/33.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/34.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/35.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/36.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/37.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/38.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/39.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/4.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/40.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/41.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/42.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/43.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/44.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/45.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/46.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/47.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/48.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/49.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/5.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/50.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/51.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/52.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/53.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/54.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/55.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/56.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/57.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/58.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/59.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/6.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/60.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/61.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/62.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/63.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/64.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/65.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/66.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/67.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/68.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/69.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/7.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/70.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/71.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/72.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/73.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/74.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/75.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/76.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/77.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/78.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/79.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/8.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/80.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/81.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/82.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/83.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/84.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/85.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/86.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/87.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/88.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/89.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/9.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/90.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/91.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/92.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/93.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/94.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/95.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/96.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/97.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/98.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/99.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/static.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/filemanager/filemanager.js +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/filemanager/images/file-16.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/filemanager/images/file-64.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/filemanager/images/folder-16.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/filemanager/images/folder-64.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/filemanager/images/go-up.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/flash/flash.js +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/image/image.js +11 -1
- data/vendor/assets/javascripts/kindeditor/plugins/image/images/align_left.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/image/images/align_right.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/image/images/align_top.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/image/images/refresh.png +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/insertfile/insertfile.js +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/lineheight/lineheight.js +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/link/link.js +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/map/map.html +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/map/map.js +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/media/media.js +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/multiimage/images/image.png +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/multiimage/images/select-files-en.png +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/multiimage/images/select-files-zh_CN.png +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/multiimage/images/swfupload.swf +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/multiimage/multiimage.js +1 -5
- data/vendor/assets/javascripts/kindeditor/plugins/pagebreak/pagebreak.js +1 -3
- data/vendor/assets/javascripts/kindeditor/plugins/plainpaste/plainpaste.js +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/preview/preview.js +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/quickformat/quickformat.js +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/table/table.js +7 -0
- data/vendor/assets/javascripts/kindeditor/plugins/template/html/1.html +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/template/html/2.html +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/template/html/3.html +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/template/template.js +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/wordpaste/wordpaste.js +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/common/anchor.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/common/blank.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/common/flash.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/common/loading.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/common/media.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/common/rm.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/default/background.png +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/default/default.css +1 -1
- data/vendor/assets/javascripts/kindeditor/themes/default/default.png +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/qq/editor.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/qq/qq.css +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/simple/simple.css +0 -0
- 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: d30fcab200a2e0ec0b53b5c5f0f7d31a4499bcb1
|
|
4
|
+
data.tar.gz: d22f4f71e755c17389482d6700512d345c22de52
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e319fe32e2d3013ec7ab5ed854f17b8b3c7b248e1f59452b3cf7f92100037334c76d15d6c35958be3c3fb9182848228c1875232e18a2c3f6368de7d032b57d24
|
|
7
|
+
data.tar.gz: ce05b3e941cab4471f14319372246fe1e539788f05342b50dbfef7a5aa23e9e0758ef2d7763b8a70c2d494efdd9fe81d69293e2d99fb29fde7383b0cc68fc3d4
|
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.4.
|
|
13
|
+
gem 'rails_kindeditor', '~> 0.4.1'
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
### Run "bundle" command.
|
|
@@ -24,6 +24,7 @@ rails_kindeditor will helps your rails app integrate with kindeditor, includes i
|
|
|
24
24
|
```bash
|
|
25
25
|
rails generate rails_kindeditor:install
|
|
26
26
|
```
|
|
27
|
+
notice: rails_kindeditor needs applications.js in your project.
|
|
27
28
|
|
|
28
29
|
### Rails4 in production mode
|
|
29
30
|
|
|
@@ -205,7 +206,7 @@ rails_kindeditor can save upload file information into database.
|
|
|
205
206
|
|
|
206
207
|
You can specify the owner for uploaded files, when the owner was destroying, all the uploaded files(belongs to the owner) will be destroyed automatically.
|
|
207
208
|
|
|
208
|
-
1. specify the owner_id for kindeditor
|
|
209
|
+
####1. specify the owner_id for kindeditor
|
|
209
210
|
|
|
210
211
|
```ruby
|
|
211
212
|
<%= form_for @article do |f| %>
|
|
@@ -214,9 +215,12 @@ You can specify the owner for uploaded files, when the owner was destroying, all
|
|
|
214
215
|
...
|
|
215
216
|
<% end %>
|
|
216
217
|
```
|
|
218
|
+
|
|
219
|
+
```ruby
|
|
217
220
|
Warnning: the @article must be created before this scene, the @article.id should not be empty.
|
|
221
|
+
```
|
|
218
222
|
|
|
219
|
-
2. add has_many_kindeditor_assets in your own model
|
|
223
|
+
####2. add has_many_kindeditor_assets in your own model
|
|
220
224
|
|
|
221
225
|
```ruby
|
|
222
226
|
class Article < ActiveRecord::Base
|
|
@@ -226,7 +230,7 @@ Warnning: the @article must be created before this scene, the @article.id should
|
|
|
226
230
|
end
|
|
227
231
|
```
|
|
228
232
|
|
|
229
|
-
3. relationship
|
|
233
|
+
####3. relationship
|
|
230
234
|
|
|
231
235
|
```ruby
|
|
232
236
|
article = Article.first
|
|
@@ -257,7 +261,7 @@ rails_kindeditor可以帮助你的rails程序集成kindeditor,包括了图片和
|
|
|
257
261
|
### 将下面代码加入Gemfile:
|
|
258
262
|
|
|
259
263
|
```ruby
|
|
260
|
-
gem 'rails_kindeditor', '~> 0.4.
|
|
264
|
+
gem 'rails_kindeditor', '~> 0.4.1'
|
|
261
265
|
```
|
|
262
266
|
|
|
263
267
|
### 运行"bundle"命令:
|
|
@@ -271,6 +275,7 @@ rails_kindeditor可以帮助你的rails程序集成kindeditor,包括了图片和
|
|
|
271
275
|
```bash
|
|
272
276
|
rails generate rails_kindeditor:install
|
|
273
277
|
```
|
|
278
|
+
注意: 在你的工程中需要有application.js文件。
|
|
274
279
|
|
|
275
280
|
### Rails4 in production mode
|
|
276
281
|
|
|
@@ -448,7 +453,7 @@ rails_kindeditor 可以将上传文件信息记录入数据库,以便扩展应
|
|
|
448
453
|
|
|
449
454
|
你可以为上传的文件指定归属,比如一名用户,或者一篇文章,当用户或者文章被删除时,所有属于该用户或者该文章的上传文件将会被自动删除。
|
|
450
455
|
|
|
451
|
-
1. 为kindeditor指定owner_id
|
|
456
|
+
####1. 为kindeditor指定owner_id
|
|
452
457
|
|
|
453
458
|
```ruby
|
|
454
459
|
<%= form_for @article do |f| %>
|
|
@@ -457,9 +462,12 @@ rails_kindeditor 可以将上传文件信息记录入数据库,以便扩展应
|
|
|
457
462
|
...
|
|
458
463
|
<% end %>
|
|
459
464
|
```
|
|
465
|
+
|
|
466
|
+
```ruby
|
|
460
467
|
警告: @article应该事先被创建,@article.id不应该是空的。
|
|
468
|
+
```
|
|
461
469
|
|
|
462
|
-
2. 在你自己的模型里加入has_many_kindeditor_assets
|
|
470
|
+
####2. 在你自己的模型里加入has_many_kindeditor_assets
|
|
463
471
|
|
|
464
472
|
```ruby
|
|
465
473
|
class Article < ActiveRecord::Base
|
|
@@ -469,7 +477,7 @@ rails_kindeditor 可以将上传文件信息记录入数据库,以便扩展应
|
|
|
469
477
|
end
|
|
470
478
|
```
|
|
471
479
|
|
|
472
|
-
3. 相互关系
|
|
480
|
+
####3. 相互关系
|
|
473
481
|
|
|
474
482
|
```ruby
|
|
475
483
|
article = Article.first
|
|
@@ -9,6 +9,7 @@ class Kindeditor::AssetsController < ApplicationController
|
|
|
9
9
|
begin
|
|
10
10
|
@asset = "Kindeditor::#{@dir.camelize}".constantize.new(:asset => @imgFile)
|
|
11
11
|
@asset.owner_id = params[:owner_id] ? params[:owner_id] : 0
|
|
12
|
+
logger.warn '========= Warning: the owner_id is 0, "delete uploaded files automatically" will not work. =========' if defined?(logger) && @asset.owner_id == 0
|
|
12
13
|
@asset.asset_type = @dir
|
|
13
14
|
if @asset.save
|
|
14
15
|
render :text => ({:error => 0, :url => @asset.asset.url}.to_json)
|
|
@@ -3,9 +3,13 @@ require 'carrierwave/mongoid'
|
|
|
3
3
|
class Kindeditor::Asset
|
|
4
4
|
include Mongoid::Document
|
|
5
5
|
include Mongoid::Timestamps
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
field :file_size, :type => Integer
|
|
8
8
|
field :file_type, :type => String
|
|
9
|
+
field :owner_id, :type => Integer
|
|
10
|
+
field :asset_type, :type => String
|
|
11
|
+
|
|
12
|
+
mount_uploader :asset, Kindeditor::AssetUploader
|
|
9
13
|
validates_presence_of :asset
|
|
10
14
|
before_save :update_asset_attributes
|
|
11
15
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @author Roddy <luolonghao@gmail.com>
|
|
6
6
|
* @website http://www.kindsoft.net/
|
|
7
7
|
* @licence http://www.kindsoft.net/license.php
|
|
8
|
-
* @version 4.1.
|
|
8
|
+
* @version 4.1.9 (2013-10-08)
|
|
9
9
|
*******************************************************************************/
|
|
10
10
|
(function (window, undefined) {
|
|
11
11
|
if (window.KindEditor) {
|
|
@@ -17,7 +17,7 @@ if (!window.console) {
|
|
|
17
17
|
if (!console.log) {
|
|
18
18
|
console.log = function () {};
|
|
19
19
|
}
|
|
20
|
-
var _VERSION = '4.1.
|
|
20
|
+
var _VERSION = '4.1.9 (2013-10-08)',
|
|
21
21
|
_ua = navigator.userAgent.toLowerCase(),
|
|
22
22
|
_IE = _ua.indexOf('msie') > -1 && _ua.indexOf('opera') == -1,
|
|
23
23
|
_GECKO = _ua.indexOf('gecko') > -1 && _ua.indexOf('khtml') == -1,
|
|
@@ -26,6 +26,7 @@ var _VERSION = '4.1.7 (2013-04-21)',
|
|
|
26
26
|
_MOBILE = _ua.indexOf('mobile') > -1,
|
|
27
27
|
_IOS = /ipad|iphone|ipod/.test(_ua),
|
|
28
28
|
_QUIRKS = document.compatMode != 'CSS1Compat',
|
|
29
|
+
_IERANGE = !window.getSelection,
|
|
29
30
|
_matches = /(?:msie|firefox|webkit|opera)[\/:\s](\d+)/.exec(_ua),
|
|
30
31
|
_V = _matches ? _matches[1] : '0',
|
|
31
32
|
_TIME = new Date().getTime();
|
|
@@ -551,12 +552,18 @@ function _ctrl(el, key, fn) {
|
|
|
551
552
|
}
|
|
552
553
|
});
|
|
553
554
|
}
|
|
555
|
+
var _readyFinished = false;
|
|
554
556
|
function _ready(fn) {
|
|
557
|
+
if (_readyFinished) {
|
|
558
|
+
fn(KindEditor);
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
555
561
|
var loaded = false;
|
|
556
562
|
function readyFunc() {
|
|
557
563
|
if (!loaded) {
|
|
558
564
|
loaded = true;
|
|
559
565
|
fn(KindEditor);
|
|
566
|
+
_readyFinished = true;
|
|
560
567
|
}
|
|
561
568
|
}
|
|
562
569
|
function ieReadyFunc() {
|
|
@@ -713,6 +720,9 @@ function _formatUrl(url, mode, host, pathname) {
|
|
|
713
720
|
return url;
|
|
714
721
|
}
|
|
715
722
|
function _formatHtml(html, htmlTags, urlType, wellFormatted, indentChar) {
|
|
723
|
+
if (html == null) {
|
|
724
|
+
html = '';
|
|
725
|
+
}
|
|
716
726
|
urlType = urlType || '';
|
|
717
727
|
wellFormatted = _undef(wellFormatted, false);
|
|
718
728
|
indentChar = _undef(indentChar, '\t');
|
|
@@ -724,6 +734,9 @@ function _formatHtml(html, htmlTags, urlType, wellFormatted, indentChar) {
|
|
|
724
734
|
html = html.replace(/(<(?:p|p\s[^>]*)>)\s*(<\/p>)/ig, '$1<br />$2');
|
|
725
735
|
html = html.replace(/\u200B/g, '');
|
|
726
736
|
html = html.replace(/\u00A9/g, '©');
|
|
737
|
+
html = html.replace(/<[^>]+>/g, function($0) {
|
|
738
|
+
return $0.replace(/\s+/g, ' ');
|
|
739
|
+
});
|
|
727
740
|
var htmlTagMap = {};
|
|
728
741
|
if (htmlTags) {
|
|
729
742
|
_each(htmlTags, function(key, val) {
|
|
@@ -739,7 +752,7 @@ function _formatHtml(html, htmlTags, urlType, wellFormatted, indentChar) {
|
|
|
739
752
|
html = html.replace(/(<(?:style|style\s[^>]*)>)([\s\S]*?)(<\/style>)/ig, '');
|
|
740
753
|
}
|
|
741
754
|
}
|
|
742
|
-
var re = /(
|
|
755
|
+
var re = /(\s*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"'<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+='[^']*'))*)(\/)?>(\s*)/g;
|
|
743
756
|
var tagStack = [];
|
|
744
757
|
html = html.replace(re, function($0, $1, $2, $3, $4, $5, $6) {
|
|
745
758
|
var full = $0,
|
|
@@ -927,10 +940,14 @@ function _mediaImg(blankPath, attrs) {
|
|
|
927
940
|
type = attrs.type || _mediaType(attrs.src),
|
|
928
941
|
srcTag = _mediaEmbed(attrs),
|
|
929
942
|
style = '';
|
|
930
|
-
if (width
|
|
943
|
+
if (/\D/.test(width)) {
|
|
944
|
+
style += 'width:' + width + ';';
|
|
945
|
+
} else if (width > 0) {
|
|
931
946
|
style += 'width:' + width + 'px;';
|
|
932
947
|
}
|
|
933
|
-
if (height
|
|
948
|
+
if (/\D/.test(height)) {
|
|
949
|
+
style += 'height:' + height + ';';
|
|
950
|
+
} else if (height > 0) {
|
|
934
951
|
style += 'height:' + height + 'px;';
|
|
935
952
|
}
|
|
936
953
|
var html = '<img class="' + _mediaClass(type) + '" src="' + blankPath + '" ';
|
|
@@ -1075,7 +1092,7 @@ function _queryAll(expr, root) {
|
|
|
1075
1092
|
for (var i = 0, len = els.length; i < len; i++) {
|
|
1076
1093
|
el = els[i];
|
|
1077
1094
|
if (cmpTag(tag, el.nodeName) && _contains(root, el)) {
|
|
1078
|
-
if (el.
|
|
1095
|
+
if (el.getAttribute('name') !== null) {
|
|
1079
1096
|
arr.push(el);
|
|
1080
1097
|
}
|
|
1081
1098
|
}
|
|
@@ -2049,7 +2066,7 @@ function _toRange(rng) {
|
|
|
2049
2066
|
start.offset = 0;
|
|
2050
2067
|
}
|
|
2051
2068
|
}
|
|
2052
|
-
if (
|
|
2069
|
+
if (_IERANGE) {
|
|
2053
2070
|
if (rng.item) {
|
|
2054
2071
|
doc = _getDoc(rng.item(0));
|
|
2055
2072
|
range = new KRange(doc);
|
|
@@ -2161,7 +2178,7 @@ _extend(KRange, {
|
|
|
2161
2178
|
},
|
|
2162
2179
|
compareBoundaryPoints : function(how, range) {
|
|
2163
2180
|
var rangeA = this.get(), rangeB = range.get();
|
|
2164
|
-
if (
|
|
2181
|
+
if (_IERANGE) {
|
|
2165
2182
|
var arr = {};
|
|
2166
2183
|
arr[_START_TO_START] = 'StartToStart';
|
|
2167
2184
|
arr[_START_TO_END] = 'EndToStart';
|
|
@@ -2222,7 +2239,7 @@ _extend(KRange, {
|
|
|
2222
2239
|
return new KRange(this.doc).setStart(this.startContainer, this.startOffset).setEnd(this.endContainer, this.endOffset);
|
|
2223
2240
|
},
|
|
2224
2241
|
toString : function() {
|
|
2225
|
-
var rng = this.get(), str =
|
|
2242
|
+
var rng = this.get(), str = _IERANGE ? rng.text : rng.toString();
|
|
2226
2243
|
return str.replace(/\r\n|\n|\r/g, '');
|
|
2227
2244
|
},
|
|
2228
2245
|
cloneContents : function() {
|
|
@@ -2301,7 +2318,7 @@ _extend(KRange, {
|
|
|
2301
2318
|
},
|
|
2302
2319
|
get : function(hasControlRange) {
|
|
2303
2320
|
var self = this, doc = self.doc, node, rng;
|
|
2304
|
-
if (!
|
|
2321
|
+
if (!_IERANGE) {
|
|
2305
2322
|
rng = doc.createRange();
|
|
2306
2323
|
try {
|
|
2307
2324
|
rng.setStart(self.startContainer, self.startOffset);
|
|
@@ -2506,7 +2523,7 @@ function _nativeCommandValue(doc, key) {
|
|
|
2506
2523
|
}
|
|
2507
2524
|
function _getSel(doc) {
|
|
2508
2525
|
var win = _getWin(doc);
|
|
2509
|
-
return doc.selection
|
|
2526
|
+
return _IERANGE ? doc.selection : win.getSelection();
|
|
2510
2527
|
}
|
|
2511
2528
|
function _getRng(doc) {
|
|
2512
2529
|
var sel = _getSel(doc), rng;
|
|
@@ -2517,7 +2534,7 @@ function _getRng(doc) {
|
|
|
2517
2534
|
rng = sel.createRange();
|
|
2518
2535
|
}
|
|
2519
2536
|
} catch(e) {}
|
|
2520
|
-
if (
|
|
2537
|
+
if (_IERANGE && (!rng || (!rng.item && rng.parentElement().ownerDocument !== doc))) {
|
|
2521
2538
|
return null;
|
|
2522
2539
|
}
|
|
2523
2540
|
return rng;
|
|
@@ -2710,7 +2727,7 @@ _extend(KCmd, {
|
|
|
2710
2727
|
ec = range.endContainer, eo = range.endOffset,
|
|
2711
2728
|
doc = _getDoc(sc), win = self.win, rng, hasU200b = false;
|
|
2712
2729
|
if (hasDummy && sc.nodeType == 1 && range.collapsed) {
|
|
2713
|
-
if (
|
|
2730
|
+
if (_IERANGE) {
|
|
2714
2731
|
var dummy = K('<span> </span>', doc);
|
|
2715
2732
|
range.insertNode(dummy[0]);
|
|
2716
2733
|
rng = doc.body.createTextRange();
|
|
@@ -2731,7 +2748,7 @@ _extend(KCmd, {
|
|
|
2731
2748
|
}
|
|
2732
2749
|
}
|
|
2733
2750
|
}
|
|
2734
|
-
if (
|
|
2751
|
+
if (_IERANGE) {
|
|
2735
2752
|
try {
|
|
2736
2753
|
rng = range.get(true);
|
|
2737
2754
|
rng.select();
|
|
@@ -3160,7 +3177,7 @@ _extend(KCmd, {
|
|
|
3160
3177
|
range.collapse(false);
|
|
3161
3178
|
self.select(false);
|
|
3162
3179
|
}
|
|
3163
|
-
if (
|
|
3180
|
+
if (_IERANGE && quickMode) {
|
|
3164
3181
|
try {
|
|
3165
3182
|
pasteHtml(range, val);
|
|
3166
3183
|
} catch(e) {
|
|
@@ -3222,14 +3239,26 @@ _extend(KCmd, {
|
|
|
3222
3239
|
range.selectNode(node[0]);
|
|
3223
3240
|
return self.select();
|
|
3224
3241
|
}
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
K(this).attr('href', url).attr('data-ke-src', url);
|
|
3242
|
+
function setAttr(node, url, type) {
|
|
3243
|
+
K(node).attr('href', url).attr('data-ke-src', url);
|
|
3228
3244
|
if (type) {
|
|
3229
|
-
K(
|
|
3245
|
+
K(node).attr('target', type);
|
|
3230
3246
|
} else {
|
|
3231
|
-
K(
|
|
3247
|
+
K(node).removeAttr('target');
|
|
3248
|
+
}
|
|
3249
|
+
}
|
|
3250
|
+
var sc = range.startContainer, so = range.startOffset,
|
|
3251
|
+
ec = range.endContainer, eo = range.endOffset;
|
|
3252
|
+
if (sc.nodeType == 1 && sc === ec && so + 1 === eo) {
|
|
3253
|
+
var child = sc.childNodes[so];
|
|
3254
|
+
if (child.nodeName.toLowerCase() == 'a') {
|
|
3255
|
+
setAttr(child, url, type);
|
|
3256
|
+
return self;
|
|
3232
3257
|
}
|
|
3258
|
+
}
|
|
3259
|
+
_nativeCommand(doc, 'createlink', '__kindeditor_temp_url__');
|
|
3260
|
+
K('a[href="__kindeditor_temp_url__"]', doc).each(function() {
|
|
3261
|
+
setAttr(this, url, type);
|
|
3233
3262
|
});
|
|
3234
3263
|
return self;
|
|
3235
3264
|
},
|
|
@@ -3261,7 +3290,10 @@ _each(('formatblock,selectall,justifyleft,justifycenter,justifyright,justifyfull
|
|
|
3261
3290
|
var self = this;
|
|
3262
3291
|
self.select();
|
|
3263
3292
|
_nativeCommand(self.doc, name, val);
|
|
3264
|
-
if (
|
|
3293
|
+
if (_IERANGE && _inArray(name, 'justifyleft,justifycenter,justifyright,justifyfull'.split(',')) >= 0) {
|
|
3294
|
+
self.selection();
|
|
3295
|
+
}
|
|
3296
|
+
if (!_IERANGE || _inArray(name, 'formatblock,selectall,insertorderedlist,insertunorderedlist'.split(',')) >= 0) {
|
|
3265
3297
|
self.selection();
|
|
3266
3298
|
}
|
|
3267
3299
|
return self;
|
|
@@ -3605,13 +3637,16 @@ _extend(KEdit, KWidget, {
|
|
|
3605
3637
|
bodyClass = options.bodyClass,
|
|
3606
3638
|
cssPath = options.cssPath,
|
|
3607
3639
|
cssData = options.cssData,
|
|
3608
|
-
isDocumentDomain = location.host.replace(/:\d+/, '') !== document.domain,
|
|
3640
|
+
isDocumentDomain = location.protocol != 'res:' && location.host.replace(/:\d+/, '') !== document.domain,
|
|
3609
3641
|
srcScript = ('document.open();' +
|
|
3610
3642
|
(isDocumentDomain ? 'document.domain="' + document.domain + '";' : '') +
|
|
3611
3643
|
'document.close();'),
|
|
3612
3644
|
iframeSrc = _IE ? ' src="javascript:void(function(){' + encodeURIComponent(srcScript) + '}())"' : '';
|
|
3613
3645
|
self.iframe = K('<iframe class="ke-edit-iframe" hidefocus="true" frameborder="0"' + iframeSrc + '></iframe>').css('width', '100%');
|
|
3614
3646
|
self.textarea = K('<textarea class="ke-edit-textarea" hidefocus="true"></textarea>').css('width', '100%');
|
|
3647
|
+
self.tabIndex = isNaN(parseInt(options.tabIndex, 10)) ? self.srcElement.attr('tabindex') : parseInt(options.tabIndex, 10);
|
|
3648
|
+
self.iframe.attr('tabindex', self.tabIndex);
|
|
3649
|
+
self.textarea.attr('tabindex', self.tabIndex);
|
|
3615
3650
|
if (self.width) {
|
|
3616
3651
|
self.setWidth(self.width);
|
|
3617
3652
|
}
|
|
@@ -4146,8 +4181,7 @@ _extend(KUploadButton, {
|
|
|
4146
4181
|
self.button = button;
|
|
4147
4182
|
self.iframe = options.target ? K('iframe[name="' + target + '"]') : K('iframe', div);
|
|
4148
4183
|
self.form = options.form ? K(options.form) : K('form', div);
|
|
4149
|
-
|
|
4150
|
-
self.fileBox = K('.ke-upload-file', div).width(width);
|
|
4184
|
+
self.fileBox = K('.ke-upload-file', div);
|
|
4151
4185
|
self.options = options;
|
|
4152
4186
|
},
|
|
4153
4187
|
submit : function() {
|
|
@@ -4773,12 +4807,10 @@ function KEditor(options) {
|
|
|
4773
4807
|
self.initContent = '';
|
|
4774
4808
|
self.plugin = {};
|
|
4775
4809
|
self.isCreated = false;
|
|
4776
|
-
self.isLoading = false;
|
|
4777
4810
|
self._handlers = {};
|
|
4778
4811
|
self._contextmenus = [];
|
|
4779
4812
|
self._undoStack = [];
|
|
4780
4813
|
self._redoStack = [];
|
|
4781
|
-
self._calledPlugins = {};
|
|
4782
4814
|
self._firstAddBookmark = true;
|
|
4783
4815
|
self.menu = self.contextmenu = null;
|
|
4784
4816
|
self.dialogs = [];
|
|
@@ -4790,28 +4822,25 @@ KEditor.prototype = {
|
|
|
4790
4822
|
loadPlugin : function(name, fn) {
|
|
4791
4823
|
var self = this;
|
|
4792
4824
|
if (_plugins[name]) {
|
|
4793
|
-
if (
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
}
|
|
4825
|
+
if (!_isFunction(_plugins[name])) {
|
|
4826
|
+
setTimeout(function() {
|
|
4827
|
+
self.loadPlugin(name, fn);
|
|
4828
|
+
}, 100);
|
|
4797
4829
|
return self;
|
|
4798
4830
|
}
|
|
4799
4831
|
_plugins[name].call(self, KindEditor);
|
|
4800
4832
|
if (fn) {
|
|
4801
4833
|
fn.call(self);
|
|
4802
4834
|
}
|
|
4803
|
-
self._calledPlugins[name] = true;
|
|
4804
4835
|
return self;
|
|
4805
4836
|
}
|
|
4806
|
-
|
|
4807
|
-
return self;
|
|
4808
|
-
}
|
|
4809
|
-
self.isLoading = true;
|
|
4837
|
+
_plugins[name] = 'loading';
|
|
4810
4838
|
_loadScript(self.pluginsPath + name + '/' + name + '.js?ver=' + encodeURIComponent(K.DEBUG ? _TIME : _VERSION), function() {
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4839
|
+
setTimeout(function() {
|
|
4840
|
+
if (_plugins[name]) {
|
|
4841
|
+
self.loadPlugin(name, fn);
|
|
4842
|
+
}
|
|
4843
|
+
}, 0);
|
|
4815
4844
|
});
|
|
4816
4845
|
return self;
|
|
4817
4846
|
},
|
|
@@ -4967,6 +4996,7 @@ KEditor.prototype = {
|
|
|
4967
4996
|
cssData : self.cssData,
|
|
4968
4997
|
beforeGetHtml : function(html) {
|
|
4969
4998
|
html = self.beforeGetHtml(html);
|
|
4999
|
+
html = _removeBookmarkTag(_removeTempTag(html));
|
|
4970
5000
|
return _formatHtml(html, self.filterMode ? self.htmlTags : null, self.urlType, self.wellFormatMode, self.indentChar);
|
|
4971
5001
|
},
|
|
4972
5002
|
beforeSetHtml : function(html) {
|
|
@@ -5014,6 +5044,14 @@ KEditor.prototype = {
|
|
|
5014
5044
|
if (self.initContent === '') {
|
|
5015
5045
|
self.initContent = self.html();
|
|
5016
5046
|
}
|
|
5047
|
+
if (self._undoStack.length > 0) {
|
|
5048
|
+
var prev = self._undoStack.pop();
|
|
5049
|
+
if (prev.start) {
|
|
5050
|
+
self.html(prev.html);
|
|
5051
|
+
edit.cmd.range.moveToBookmark(prev);
|
|
5052
|
+
self.select();
|
|
5053
|
+
}
|
|
5054
|
+
}
|
|
5017
5055
|
self.afterCreate();
|
|
5018
5056
|
if (self.options.afterCreate) {
|
|
5019
5057
|
self.options.afterCreate.call(self);
|
|
@@ -5160,13 +5198,15 @@ KEditor.prototype = {
|
|
|
5160
5198
|
return _trim(this.initContent.replace(/\r\n|\n|\r|t/g, '')) !== _trim(this.html().replace(/\r\n|\n|\r|t/g, ''));
|
|
5161
5199
|
},
|
|
5162
5200
|
selectedHtml : function() {
|
|
5163
|
-
|
|
5201
|
+
var val = this.isCreated ? this.cmd.range.html() : '';
|
|
5202
|
+
val = _removeBookmarkTag(_removeTempTag(val));
|
|
5203
|
+
return val;
|
|
5164
5204
|
},
|
|
5165
5205
|
count : function(mode) {
|
|
5166
5206
|
var self = this;
|
|
5167
5207
|
mode = (mode || 'html').toLowerCase();
|
|
5168
5208
|
if (mode === 'html') {
|
|
5169
|
-
return
|
|
5209
|
+
return self.html().length;
|
|
5170
5210
|
}
|
|
5171
5211
|
if (mode === 'text') {
|
|
5172
5212
|
return self.text().replace(/<(?:img|embed).*?>/ig, 'K').replace(/\r\n|\n|\r/g, '').length;
|
|
@@ -5252,6 +5292,7 @@ KEditor.prototype = {
|
|
|
5252
5292
|
},
|
|
5253
5293
|
fullscreen : function(bool) {
|
|
5254
5294
|
this.fullscreenMode = (bool === undefined ? !this.fullscreenMode : bool);
|
|
5295
|
+
this.addBookmark(false);
|
|
5255
5296
|
return this.remove().create();
|
|
5256
5297
|
},
|
|
5257
5298
|
readonly : function(isReadonly) {
|
|
@@ -5383,7 +5424,9 @@ function _create(expr, options) {
|
|
|
5383
5424
|
}
|
|
5384
5425
|
function create(editor) {
|
|
5385
5426
|
_each(_plugins, function(name, fn) {
|
|
5386
|
-
fn
|
|
5427
|
+
if (_isFunction(fn)) {
|
|
5428
|
+
fn.call(editor, KindEditor);
|
|
5429
|
+
}
|
|
5387
5430
|
});
|
|
5388
5431
|
return editor.create();
|
|
5389
5432
|
}
|
|
@@ -5412,7 +5455,7 @@ function _eachEditor(expr, fn) {
|
|
|
5412
5455
|
K(expr).each(function(i, el) {
|
|
5413
5456
|
K.each(_instances, function(j, editor) {
|
|
5414
5457
|
if (editor && editor.srcElement[0] == el) {
|
|
5415
|
-
fn.call(editor, j
|
|
5458
|
+
fn.call(editor, j);
|
|
5416
5459
|
return false;
|
|
5417
5460
|
}
|
|
5418
5461
|
});
|
|
@@ -5429,6 +5472,21 @@ K.sync = function(expr) {
|
|
|
5429
5472
|
this.sync();
|
|
5430
5473
|
});
|
|
5431
5474
|
};
|
|
5475
|
+
K.html = function(expr, val) {
|
|
5476
|
+
_eachEditor(expr, function() {
|
|
5477
|
+
this.html(val);
|
|
5478
|
+
});
|
|
5479
|
+
};
|
|
5480
|
+
K.insertHtml = function(expr, val) {
|
|
5481
|
+
_eachEditor(expr, function() {
|
|
5482
|
+
this.insertHtml(val);
|
|
5483
|
+
});
|
|
5484
|
+
};
|
|
5485
|
+
K.appendHtml = function(expr, val) {
|
|
5486
|
+
_eachEditor(expr, function() {
|
|
5487
|
+
this.appendHtml(val);
|
|
5488
|
+
});
|
|
5489
|
+
};
|
|
5432
5490
|
if (_IE && _V < 7) {
|
|
5433
5491
|
_nativeCommand(document, 'BackgroundImageCache', true);
|
|
5434
5492
|
}
|
|
@@ -5486,7 +5544,13 @@ _plugin('core', function(K) {
|
|
|
5486
5544
|
self.toolbar.disableAll(false);
|
|
5487
5545
|
self.edit.design(true);
|
|
5488
5546
|
self.toolbar.unselect('source');
|
|
5489
|
-
|
|
5547
|
+
if (_GECKO) {
|
|
5548
|
+
setTimeout(function() {
|
|
5549
|
+
self.cmd.selection();
|
|
5550
|
+
}, 0);
|
|
5551
|
+
} else {
|
|
5552
|
+
self.cmd.selection();
|
|
5553
|
+
}
|
|
5490
5554
|
}
|
|
5491
5555
|
self.designMode = self.edit.designMode;
|
|
5492
5556
|
});
|
|
@@ -5816,11 +5880,19 @@ _plugin('core', function(K) {
|
|
|
5816
5880
|
return $1 + _unescape($2).replace(/\s+/g, ' ') + $3;
|
|
5817
5881
|
})
|
|
5818
5882
|
.replace(/<img[^>]*class="?ke-(flash|rm|media)"?[^>]*>/ig, function(full) {
|
|
5819
|
-
var imgAttrs = _getAttrList(full)
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5883
|
+
var imgAttrs = _getAttrList(full);
|
|
5884
|
+
var styles = _getCssList(imgAttrs.style || '');
|
|
5885
|
+
var attrs = _mediaAttrs(imgAttrs['data-ke-tag']);
|
|
5886
|
+
var width = _undef(styles.width, '');
|
|
5887
|
+
var height = _undef(styles.height, '');
|
|
5888
|
+
if (/px/i.test(width)) {
|
|
5889
|
+
width = _removeUnit(width);
|
|
5890
|
+
}
|
|
5891
|
+
if (/px/i.test(height)) {
|
|
5892
|
+
height = _removeUnit(height);
|
|
5893
|
+
}
|
|
5894
|
+
attrs.width = _undef(imgAttrs.width, width);
|
|
5895
|
+
attrs.height = _undef(imgAttrs.height, height);
|
|
5824
5896
|
return _mediaEmbed(attrs);
|
|
5825
5897
|
})
|
|
5826
5898
|
.replace(/<img[^>]*class="?ke-anchor"?[^>]*>/ig, function(full) {
|