rails_kindeditor 0.3.9 → 0.3.10
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/lib/rails_kindeditor/version.rb +1 -1
- data/vendor/assets/javascripts/kindeditor/kindeditor.js +23 -8
- data/vendor/assets/javascripts/kindeditor/lang/zh_TW.js +1 -0
- data/vendor/assets/javascripts/kindeditor/plugins/autoheight/autoheight.js +27 -0
- data/vendor/assets/javascripts/kindeditor/plugins/baidumap/baidumap.js +1 -1
- data/vendor/assets/javascripts/kindeditor/plugins/multiimage/multiimage.js +3 -0
- metadata +4 -2
data/README.md
CHANGED
@@ -13,7 +13,7 @@ Deprecation: rails_kindeditor ~> v0.3.0 only support Rails3.1+!(include Rails3.1
|
|
13
13
|
### Add this to your Gemfile
|
14
14
|
|
15
15
|
```ruby
|
16
|
-
gem 'rails_kindeditor', '~> 0.3.
|
16
|
+
gem 'rails_kindeditor', '~> 0.3.10'
|
17
17
|
```
|
18
18
|
|
19
19
|
### Run "bundle" command.
|
@@ -144,7 +144,7 @@ rails_kindeditor可以帮助你的rails程序集成kindeditor,包括了图片和
|
|
144
144
|
### 将下面代码加入Gemfile:
|
145
145
|
|
146
146
|
```ruby
|
147
|
-
gem 'rails_kindeditor', '~> 0.3.
|
147
|
+
gem 'rails_kindeditor', '~> 0.3.10'
|
148
148
|
```
|
149
149
|
|
150
150
|
### 运行"bundle"命令:
|
@@ -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.4 (2012-11-11)
|
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.4 (2012-11-11)',
|
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,
|
@@ -250,7 +250,7 @@ K.options = {
|
|
250
250
|
cssData : '',
|
251
251
|
minWidth : 650,
|
252
252
|
minHeight : 100,
|
253
|
-
minChangeSize :
|
253
|
+
minChangeSize : 50,
|
254
254
|
items : [
|
255
255
|
'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
|
256
256
|
'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
|
@@ -3563,7 +3563,15 @@ function _getInitHtml(themesPath, bodyClass, cssPath, cssData) {
|
|
3563
3563
|
return arr.join('\n');
|
3564
3564
|
}
|
3565
3565
|
function _elementVal(knode, val) {
|
3566
|
-
|
3566
|
+
if (knode.hasVal()) {
|
3567
|
+
if (val === undefined) {
|
3568
|
+
var html = knode.val();
|
3569
|
+
html = html.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/ig, '');
|
3570
|
+
return html;
|
3571
|
+
}
|
3572
|
+
return knode.val(val);
|
3573
|
+
}
|
3574
|
+
return knode.html(val);
|
3567
3575
|
}
|
3568
3576
|
function KEdit(options) {
|
3569
3577
|
this.init(options);
|
@@ -4180,6 +4188,7 @@ _extend(KDialog, KWidget, {
|
|
4180
4188
|
var shadowMode = _undef(options.shadowMode, true);
|
4181
4189
|
options.z = options.z || 811213;
|
4182
4190
|
options.shadowMode = false;
|
4191
|
+
options.autoScroll = _undef(options.autoScroll, true);
|
4183
4192
|
KDialog.parent.init.call(self, options);
|
4184
4193
|
var title = options.title,
|
4185
4194
|
body = K(options.body, self.doc),
|
@@ -4587,6 +4596,13 @@ function _bindNewlineEvent() {
|
|
4587
4596
|
return;
|
4588
4597
|
}
|
4589
4598
|
if (_GECKO) {
|
4599
|
+
var root = self.cmd.commonAncestor('p');
|
4600
|
+
var a = self.cmd.commonAncestor('a');
|
4601
|
+
if (a.text() == '') {
|
4602
|
+
a.remove(true);
|
4603
|
+
self.cmd.range.selectNodeContents(root[0]).collapse(true);
|
4604
|
+
self.cmd.select();
|
4605
|
+
}
|
4590
4606
|
return;
|
4591
4607
|
}
|
4592
4608
|
self.cmd.selection();
|
@@ -5179,7 +5195,7 @@ KEditor.prototype = {
|
|
5179
5195
|
html = _removeTempTag(body.innerHTML), bookmark;
|
5180
5196
|
if (checkSize && self._undoStack.length > 0) {
|
5181
5197
|
var prev = self._undoStack[self._undoStack.length - 1];
|
5182
|
-
if (Math.abs(html.length -
|
5198
|
+
if (Math.abs(html.length - _removeBookmarkTag(prev.html).length) < self.minChangeSize) {
|
5183
5199
|
return self;
|
5184
5200
|
}
|
5185
5201
|
}
|
@@ -5255,7 +5271,6 @@ KEditor.prototype = {
|
|
5255
5271
|
},
|
5256
5272
|
createDialog : function(options) {
|
5257
5273
|
var self = this, name = options.name;
|
5258
|
-
options.autoScroll = _undef(options.autoScroll, true);
|
5259
5274
|
options.shadowMode = _undef(options.shadowMode, self.shadowMode);
|
5260
5275
|
options.closeBtn = _undef(options.closeBtn, {
|
5261
5276
|
name : self.lang('close'),
|
@@ -5771,7 +5786,7 @@ _plugin('core', function(K) {
|
|
5771
5786
|
})
|
5772
5787
|
.replace(/(<[^>]*)data-ke-src="([^"]*)"([^>]*>)/ig, function(full, start, src, end) {
|
5773
5788
|
full = full.replace(/(\s+(?:href|src)=")[^"]*(")/i, function($0, $1, $2) {
|
5774
|
-
return $1 +
|
5789
|
+
return $1 + _unescape(src) + $2;
|
5775
5790
|
});
|
5776
5791
|
full = full.replace(/\s+data-ke-src="[^"]*"/i, '');
|
5777
5792
|
return full;
|
@@ -5805,7 +5820,7 @@ _plugin('core', function(K) {
|
|
5805
5820
|
if (full.match(/\sdata-ke-src="[^"]*"/i)) {
|
5806
5821
|
return full;
|
5807
5822
|
}
|
5808
|
-
full = start + key + '="' + src + '"' + ' data-ke-src="' +
|
5823
|
+
full = start + key + '="' + src + '"' + ' data-ke-src="' + _escape(src) + '"' + end;
|
5809
5824
|
return full;
|
5810
5825
|
})
|
5811
5826
|
.replace(/(<[^>]+\s)(on\w+="[^"]*"[^>]*>)/ig, function(full, start, end) {
|
@@ -101,6 +101,7 @@ KindEditor.lang({
|
|
101
101
|
invalidBorder : '边框必须为数字。',
|
102
102
|
pleaseInput : "請輸入內容。",
|
103
103
|
invalidJson : '伺服器發生故障。',
|
104
|
+
uploadSuccess : '上傳成功。',
|
104
105
|
cutError : '您的瀏覽器安全設置不允許使用剪下操作,請使用快捷鍵(Ctrl+X)完成。',
|
105
106
|
copyError : '您的瀏覽器安全設置不允許使用剪下操作,請使用快捷鍵(Ctrl+C)完成。',
|
106
107
|
pasteError : '您的瀏覽器安全設置不允許使用剪下操作,請使用快捷鍵(Ctrl+V)完成。',
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/*******************************************************************************
|
2
|
+
* KindEditor - WYSIWYG HTML Editor for Internet
|
3
|
+
* Copyright (C) 2006-2011 kindsoft.net
|
4
|
+
*
|
5
|
+
* @author Roddy <luolonghao@gmail.com>
|
6
|
+
* @site http://www.kindsoft.net/
|
7
|
+
* @licence http://www.kindsoft.net/license.php
|
8
|
+
*******************************************************************************/
|
9
|
+
|
10
|
+
KindEditor.plugin('autoheight', function(K) {
|
11
|
+
var self = this;
|
12
|
+
|
13
|
+
if (!self.autoHeightMode) {
|
14
|
+
return;
|
15
|
+
}
|
16
|
+
|
17
|
+
var edit = self.edit;
|
18
|
+
var body = edit.doc.body;
|
19
|
+
var minHeight = K.removeUnit(self.height);
|
20
|
+
|
21
|
+
edit.iframe[0].scroll = 'no';
|
22
|
+
body.style.overflowY = 'hidden';
|
23
|
+
|
24
|
+
edit.afterChange(function() {
|
25
|
+
self.resize(null, Math.max((K.IE ? body.scrollHeight : body.offsetHeight) + 62, minHeight));
|
26
|
+
});
|
27
|
+
});
|
@@ -43,7 +43,7 @@ KindEditor.plugin('baidumap', function(K) {
|
|
43
43
|
var centerObj = map.getCenter();
|
44
44
|
var center = centerObj.lng + ',' + centerObj.lat;
|
45
45
|
var zoom = map.getZoom();
|
46
|
-
var url = [checkbox[0].checked ? self.pluginsPath + 'baidumap/' : 'http://api.map.baidu.com/staticimage',
|
46
|
+
var url = [checkbox[0].checked ? self.pluginsPath + 'baidumap/index.html' : 'http://api.map.baidu.com/staticimage',
|
47
47
|
'?center=' + encodeURIComponent(center),
|
48
48
|
'&zoom=' + encodeURIComponent(zoom),
|
49
49
|
'&width=' + mapWidth,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_kindeditor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: carrierwave
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- vendor/assets/javascripts/kindeditor/lang/zh_CN.js
|
95
95
|
- vendor/assets/javascripts/kindeditor/lang/zh_TW.js
|
96
96
|
- vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
|
97
|
+
- vendor/assets/javascripts/kindeditor/plugins/autoheight/autoheight.js
|
97
98
|
- vendor/assets/javascripts/kindeditor/plugins/baidumap/baidumap.js
|
98
99
|
- vendor/assets/javascripts/kindeditor/plugins/baidumap/index.html
|
99
100
|
- vendor/assets/javascripts/kindeditor/plugins/baidumap/map.html
|
@@ -308,3 +309,4 @@ signing_key:
|
|
308
309
|
specification_version: 3
|
309
310
|
summary: Kindeditor for Ruby on Rails
|
310
311
|
test_files: []
|
312
|
+
has_rdoc:
|