simditor 2.2.3 → 2.2.4
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/lib/simditor/version.rb +1 -1
- data/vendor/assets/javascripts/simditor/simditor.js +18 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87642817d1e352fd4361902f136770392a1f26b5
|
4
|
+
data.tar.gz: db226516ec3ed5884e0cf4d9e9c548c3a821cf58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96314d217cf800af6c5f12d4bc26713ff067a8aac4bcc7302812a9ec5129d397c1474fe4af8cfdb1c23376989f8c16ef2ec96b82f2d8e0ab3f273aa2cd561552
|
7
|
+
data.tar.gz: 9e60e8c0732f9ea65220c7ceb9772ba4dacf0653b90915601968624f7f8cef2bf332e66da1fbeba59575852c4169e47cee576923ac1a4d1817e19ceb533bd513
|
data/lib/simditor/version.rb
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
/*!
|
2
|
+
* Simditor v2.2.3
|
3
|
+
* http://simditor.tower.im/
|
4
|
+
* 2015-08-22
|
5
|
+
*/
|
1
6
|
(function (root, factory) {
|
2
7
|
if (typeof define === 'function' && define.amd) {
|
3
8
|
// AMD. Register as an anonymous module unless amdModuleId is set
|
@@ -3420,6 +3425,9 @@ BlockquoteButton = (function(superClass) {
|
|
3420
3425
|
BlockquoteButton.prototype.command = function() {
|
3421
3426
|
var $rootNodes, clearCache, nodeCache;
|
3422
3427
|
$rootNodes = this.editor.selection.rootNodes();
|
3428
|
+
$rootNodes = $rootNodes.filter(function(i, node) {
|
3429
|
+
return !$(node).parent().is('blockquote');
|
3430
|
+
});
|
3423
3431
|
this.editor.selection.save();
|
3424
3432
|
nodeCache = [];
|
3425
3433
|
clearCache = (function(_this) {
|
@@ -3502,6 +3510,7 @@ CodeButton = (function(superClass) {
|
|
3502
3510
|
|
3503
3511
|
CodeButton.prototype._status = function() {
|
3504
3512
|
CodeButton.__super__._status.call(this);
|
3513
|
+
console.log('test');
|
3505
3514
|
if (this.active) {
|
3506
3515
|
return this.popover.show(this.node);
|
3507
3516
|
} else {
|
@@ -3532,10 +3541,10 @@ CodeButton = (function(superClass) {
|
|
3532
3541
|
};
|
3533
3542
|
|
3534
3543
|
CodeButton.prototype.command = function() {
|
3535
|
-
var $rootNodes, clearCache, nodeCache,
|
3544
|
+
var $rootNodes, clearCache, nodeCache, resultNodes;
|
3536
3545
|
$rootNodes = this.editor.selection.rootNodes();
|
3537
3546
|
nodeCache = [];
|
3538
|
-
|
3547
|
+
resultNodes = [];
|
3539
3548
|
clearCache = (function(_this) {
|
3540
3549
|
return function() {
|
3541
3550
|
var $pre;
|
@@ -3543,17 +3552,18 @@ CodeButton = (function(superClass) {
|
|
3543
3552
|
return;
|
3544
3553
|
}
|
3545
3554
|
$pre = $("<" + _this.htmlTag + "/>").insertBefore(nodeCache[0]).text(_this.editor.formatter.clearHtml(nodeCache));
|
3546
|
-
|
3555
|
+
resultNodes.push($pre[0]);
|
3547
3556
|
return nodeCache.length = 0;
|
3548
3557
|
};
|
3549
3558
|
})(this);
|
3550
3559
|
$rootNodes.each((function(_this) {
|
3551
3560
|
return function(i, node) {
|
3552
|
-
var $node;
|
3561
|
+
var $node, $p;
|
3553
3562
|
$node = $(node);
|
3554
3563
|
if ($node.is(_this.htmlTag)) {
|
3555
3564
|
clearCache();
|
3556
|
-
|
3565
|
+
$p = $('<p/>').append($node.html().replace('\n', '<br/>')).replaceAll($node);
|
3566
|
+
return resultNodes.push($p[0]);
|
3557
3567
|
} else if ($node.is(_this.disableTag) || _this.editor.util.isDecoratedNode($node) || $node.is('blockquote')) {
|
3558
3568
|
return clearCache();
|
3559
3569
|
} else {
|
@@ -3562,7 +3572,7 @@ CodeButton = (function(superClass) {
|
|
3562
3572
|
};
|
3563
3573
|
})(this));
|
3564
3574
|
clearCache();
|
3565
|
-
this.editor.selection.setRangeAtEndOf($(
|
3575
|
+
this.editor.selection.setRangeAtEndOf($(resultNodes).last());
|
3566
3576
|
return this.editor.trigger('valuechanged');
|
3567
3577
|
};
|
3568
3578
|
|
@@ -3991,6 +4001,7 @@ ImageButton = (function(superClass) {
|
|
3991
4001
|
return $input = $('<input/>', {
|
3992
4002
|
type: 'file',
|
3993
4003
|
title: _this._t('uploadImage'),
|
4004
|
+
multiple: true,
|
3994
4005
|
accept: 'image/*'
|
3995
4006
|
}).appendTo($uploadItem);
|
3996
4007
|
};
|
@@ -4377,6 +4388,7 @@ ImagePopover = (function(superClass) {
|
|
4377
4388
|
return _this.input = $('<input/>', {
|
4378
4389
|
type: 'file',
|
4379
4390
|
title: _this._t('uploadImage'),
|
4391
|
+
multiple: true,
|
4380
4392
|
accept: 'image/*'
|
4381
4393
|
}).appendTo($uploadBtn);
|
4382
4394
|
};
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simditor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wentao Liu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Rails assets wrapper for https://github.com/mycolorway/simditor
|
14
14
|
email:
|