Comparing version 1.0.3 to 1.0.4
32
den.js
@@ -245,8 +245,9 @@ "use strict"; | ||
var text1 = getSelection().anchorNode | ||
var sel = getSelection() | ||
var text1 = sel.anchorNode | ||
var element1 = text1.parentNode | ||
var text1Offset = getSelection().anchorOffset | ||
var text2 = getSelection().focusNode | ||
var text1Offset = sel.anchorOffset | ||
var text2 = sel.focusNode | ||
var element2 = text2.parentNode | ||
var text2Offset = getSelection().focusOffset | ||
var text2Offset = sel.focusOffset | ||
@@ -287,2 +288,3 @@ // node1 = text1 or element1 | ||
var range = document.createRange() | ||
var sel = getSelection() | ||
if (arguments.length === 1) { | ||
@@ -297,4 +299,4 @@ range.selectNodeContents(startNode) | ||
} | ||
getSelection().removeAllRanges() | ||
getSelection().addRange(range) | ||
sel.removeAllRanges() | ||
sel.addRange(range) | ||
return range | ||
@@ -307,2 +309,15 @@ } | ||
} | ||
den.moveCursorAfter = function(node) { | ||
node = den(node).node | ||
if (!node) | ||
return null | ||
var range = document.createRange() | ||
var sel = getSelection() | ||
range.setStartAfter(node) | ||
sel.removeAllRanges() | ||
sel.addRange(range) | ||
return range | ||
} | ||
//}}}1 | ||
@@ -414,2 +429,6 @@ // ¤keystroke //{{{1 | ||
den.isDocumentFragement = function(obj) { | ||
return obj && obj.nodeType === document.DOCUMENT_FRAGEMENT_NODE | ||
} | ||
den.isWindow = function(obj) { | ||
@@ -512,3 +531,4 @@ return obj && obj === obj.window | ||
NamedNodeMap.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator] | ||
HTMLCollection.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator] | ||
// vim: fdm=marker commentstring=//%s |
{ | ||
"name": "denjs", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "den.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17699
487