wysihtml-rails 0.5.0.beta12 → 0.5.0.beta13
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a79f93a11f62b9a5968cc94d9c2c7f8351cb9b7e
|
4
|
+
data.tar.gz: 49601e86e3255bcc8bbc4b15f79f2d828110da70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b86153a882e2772ac3082297ab25a72e863d8a528573c49e2e5676137575afc7d033aa019ec0453b8dafda8f0b9e112a4ee3aa4d7f5e58994c780f40de6565e8
|
7
|
+
data.tar.gz: b73e798b9da47ad9080e49c9adf227839dd453f57e80149d4f2ec1b7f8afcf24640d7d83b293eb0cc4ab534aff941dbe46700d3e62bc4d4cfcb23f3582f4d859
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license wysihtml v0.5.0-
|
2
|
+
* @license wysihtml v0.5.0-beta13
|
3
3
|
* https://github.com/Voog/wysihtml
|
4
4
|
*
|
5
5
|
* Author: Christopher Blum (https://github.com/tiff)
|
@@ -10,7 +10,7 @@
|
|
10
10
|
*
|
11
11
|
*/
|
12
12
|
var wysihtml5 = {
|
13
|
-
version: "0.5.0-
|
13
|
+
version: "0.5.0-beta13",
|
14
14
|
|
15
15
|
// namespaces
|
16
16
|
commands: {},
|
@@ -405,6 +405,8 @@ var wysihtml5 = {
|
|
405
405
|
return all;
|
406
406
|
};
|
407
407
|
|
408
|
+
|
409
|
+
|
408
410
|
var normalizeFix = function() {
|
409
411
|
var f = Node.prototype.normalize;
|
410
412
|
var nf = function() {
|
@@ -412,13 +414,15 @@ var wysihtml5 = {
|
|
412
414
|
s = this.ownerDocument.defaultView.getSelection(),
|
413
415
|
anode = s.anchorNode,
|
414
416
|
aoffset = s.anchorOffset,
|
417
|
+
aelement = anode && anode.nodeType === 1 && anode.childNodes.length > 0 ? anode.childNodes[aoffset] : undefined,
|
415
418
|
fnode = s.focusNode,
|
416
419
|
foffset = s.focusOffset,
|
420
|
+
felement = fnode && fnode.nodeType === 1 && foffset > 0 ? fnode.childNodes[foffset -1] : undefined,
|
417
421
|
r = this.ownerDocument.createRange(),
|
418
422
|
prevTxt = texts.shift(),
|
419
423
|
curText = prevTxt ? texts.shift() : null;
|
420
424
|
|
421
|
-
if ((anode === fnode && foffset < aoffset) || (anode !== fnode && (anode.compareDocumentPosition(fnode) & Node.DOCUMENT_POSITION_PRECEDING))) {
|
425
|
+
if ((anode === fnode && foffset < aoffset) || (anode !== fnode && (anode.compareDocumentPosition(fnode) & Node.DOCUMENT_POSITION_PRECEDING) && !(anode.compareDocumentPosition(fnode) & Node.DOCUMENT_POSITION_CONTAINS))) {
|
422
426
|
fnode = [anode, anode = fnode][0];
|
423
427
|
foffset = [aoffset, aoffset = foffset][0];
|
424
428
|
}
|
@@ -442,13 +446,20 @@ var wysihtml5 = {
|
|
442
446
|
}
|
443
447
|
}
|
444
448
|
|
449
|
+
if (felement) {
|
450
|
+
foffset = Array.prototype.indexOf.call(felement.parentNode.childNodes, felement) + 1;
|
451
|
+
}
|
452
|
+
|
453
|
+
if (aelement) {
|
454
|
+
aoffset = Array.prototype.indexOf.call(aelement.parentNode.childNodes, aelement);
|
455
|
+
}
|
456
|
+
|
445
457
|
if (anode && anode.parentNode && fnode && fnode.parentNode) {
|
446
458
|
r.setStart(anode, aoffset);
|
447
459
|
r.setEnd(fnode, foffset);
|
448
460
|
s.removeAllRanges();
|
449
461
|
s.addRange(r);
|
450
462
|
}
|
451
|
-
|
452
463
|
};
|
453
464
|
Node.prototype.normalize = nf;
|
454
465
|
};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license wysihtml v0.5.0-
|
2
|
+
* @license wysihtml v0.5.0-beta13
|
3
3
|
* https://github.com/Voog/wysihtml
|
4
4
|
*
|
5
5
|
* Author: Christopher Blum (https://github.com/tiff)
|
@@ -10,7 +10,7 @@
|
|
10
10
|
*
|
11
11
|
*/
|
12
12
|
var wysihtml5 = {
|
13
|
-
version: "0.5.0-
|
13
|
+
version: "0.5.0-beta13",
|
14
14
|
|
15
15
|
// namespaces
|
16
16
|
commands: {},
|
@@ -405,6 +405,8 @@ var wysihtml5 = {
|
|
405
405
|
return all;
|
406
406
|
};
|
407
407
|
|
408
|
+
|
409
|
+
|
408
410
|
var normalizeFix = function() {
|
409
411
|
var f = Node.prototype.normalize;
|
410
412
|
var nf = function() {
|
@@ -412,13 +414,15 @@ var wysihtml5 = {
|
|
412
414
|
s = this.ownerDocument.defaultView.getSelection(),
|
413
415
|
anode = s.anchorNode,
|
414
416
|
aoffset = s.anchorOffset,
|
417
|
+
aelement = anode && anode.nodeType === 1 && anode.childNodes.length > 0 ? anode.childNodes[aoffset] : undefined,
|
415
418
|
fnode = s.focusNode,
|
416
419
|
foffset = s.focusOffset,
|
420
|
+
felement = fnode && fnode.nodeType === 1 && foffset > 0 ? fnode.childNodes[foffset -1] : undefined,
|
417
421
|
r = this.ownerDocument.createRange(),
|
418
422
|
prevTxt = texts.shift(),
|
419
423
|
curText = prevTxt ? texts.shift() : null;
|
420
424
|
|
421
|
-
if ((anode === fnode && foffset < aoffset) || (anode !== fnode && (anode.compareDocumentPosition(fnode) & Node.DOCUMENT_POSITION_PRECEDING))) {
|
425
|
+
if ((anode === fnode && foffset < aoffset) || (anode !== fnode && (anode.compareDocumentPosition(fnode) & Node.DOCUMENT_POSITION_PRECEDING) && !(anode.compareDocumentPosition(fnode) & Node.DOCUMENT_POSITION_CONTAINS))) {
|
422
426
|
fnode = [anode, anode = fnode][0];
|
423
427
|
foffset = [aoffset, aoffset = foffset][0];
|
424
428
|
}
|
@@ -442,13 +446,20 @@ var wysihtml5 = {
|
|
442
446
|
}
|
443
447
|
}
|
444
448
|
|
449
|
+
if (felement) {
|
450
|
+
foffset = Array.prototype.indexOf.call(felement.parentNode.childNodes, felement) + 1;
|
451
|
+
}
|
452
|
+
|
453
|
+
if (aelement) {
|
454
|
+
aoffset = Array.prototype.indexOf.call(aelement.parentNode.childNodes, aelement);
|
455
|
+
}
|
456
|
+
|
445
457
|
if (anode && anode.parentNode && fnode && fnode.parentNode) {
|
446
458
|
r.setStart(anode, aoffset);
|
447
459
|
r.setEnd(fnode, foffset);
|
448
460
|
s.removeAllRanges();
|
449
461
|
s.addRange(r);
|
450
462
|
}
|
451
|
-
|
452
463
|
};
|
453
464
|
Node.prototype.normalize = nf;
|
454
465
|
};
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wysihtml-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.0.
|
4
|
+
version: 0.5.0.beta13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tanel Jakobsoo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|