Skip to content

Commit 8044445

Browse files
committed
updated built files
1 parent 63423f4 commit 8044445

8 files changed

Lines changed: 46 additions & 36 deletions

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,8 @@ There is an official Rangy module on NPM called [`rangy`](https://www.npmjs.org/
3535
## Documentation
3636

3737
Documentation is in [the docs folder](https://github.com/pburrows/rangy-updated/blob/master/docs/).
38+
39+
40+
## Build
41+
42+
run `node .\builder\build.js` locally

builder/build.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ function createArchiver(fileExtension, archiveCreatorFunc) {
340340
});
341341

342342
archive.pipe(output);
343+
343344
archive.bulk([
344345
{
345346
expand: true,
@@ -403,9 +404,9 @@ var actions = [
403404
lint,
404405
minify,
405406
zip,
406-
tarGz,
407+
// tarGz,
407408
copyToLib,
408-
copyToRelease
409+
// copyToRelease
409410
];
410411

411412
function callback() {

lib/rangy-classapplier.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
*
88
* Depends on Rangy core.
99
*
10-
* Copyright 2015, Tim Down
10+
* Copyright 2019, Tim Down
1111
* Licensed under the MIT license.
12-
* Version: 1.3.1-dev
13-
* Build date: 20 May 2015
12+
* Version: 1.3.2
13+
* Build date: 2 January 2019
1414
*/
1515
(function(factory, root) {
1616
if (typeof define == "function" && define.amd) {
@@ -698,13 +698,10 @@
698698
// Normalizes nodes after applying a class to a Range.
699699
postApply: function(textNodes, range, positionsToPreserve, isUndo) {
700700
var firstNode = textNodes[0], lastNode = textNodes[textNodes.length - 1];
701-
702701
var merges = [], currentMerge;
703-
704702
var rangeStartNode = firstNode, rangeEndNode = lastNode;
705703
var rangeStartOffset = 0, rangeEndOffset = lastNode.length;
706-
707-
var textNode, precedingTextNode;
704+
var precedingTextNode;
708705

709706
// Check for every required merge and create a Merge object for each
710707
forEach(textNodes, function(textNode) {
@@ -741,7 +738,7 @@
741738

742739
// Apply the merges
743740
if (merges.length) {
744-
for (i = 0, len = merges.length; i < len; ++i) {
741+
for (var i = 0, len = merges.length; i < len; ++i) {
745742
merges[i].doMerge(positionsToPreserve);
746743
}
747744

lib/rangy-core.js

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
* Rangy, a cross-browser JavaScript range and selection library
33
* https://github.com/timdown/rangy
44
*
5-
* Copyright 2015, Tim Down
5+
* Copyright 2019, Tim Down
66
* Licensed under the MIT license.
7-
* Version: 1.3.1-dev
8-
* Build date: 20 May 2015
7+
* Version: 1.3.2
8+
* Build date: 2 January 2019
99
*/
1010

1111
(function(factory, root) {
@@ -109,7 +109,7 @@
109109
};
110110

111111
var api = {
112-
version: "1.3.1-dev",
112+
version: "1.3.2",
113113
initialized: false,
114114
isBrowser: isBrowser,
115115
supported: true,
@@ -222,7 +222,7 @@
222222
})();
223223

224224
// Very simple event handler wrapper function that doesn't attempt to solve issues such as "this" handling or
225-
// normalization of event properties
225+
// normalization of event properties because we don't need this.
226226
var addListener;
227227
if (isBrowser) {
228228
if (isHostMethod(document, "addEventListener")) {
@@ -1303,6 +1303,7 @@
13031303
var getDocumentOrFragmentContainer = createAncestorFinder( [9, 11] );
13041304
var getReadonlyAncestor = createAncestorFinder(readonlyNodeTypes);
13051305
var getDocTypeNotationEntityAncestor = createAncestorFinder( [6, 10, 12] );
1306+
var getElementAncestor = createAncestorFinder( [1] );
13061307

13071308
function assertNoDocTypeNotationEntityAncestor(node, allowSelf) {
13081309
if (getDocTypeNotationEntityAncestor(node, allowSelf)) {
@@ -1365,7 +1366,7 @@
13651366
var htmlParsingConforms = false;
13661367
try {
13671368
styleEl.innerHTML = "<b>x</b>";
1368-
htmlParsingConforms = (styleEl.firstChild.nodeType == 3); // Opera incorrectly creates an element node
1369+
htmlParsingConforms = (styleEl.firstChild.nodeType == 3); // Pre-Blink Opera incorrectly creates an element node
13691370
} catch (e) {
13701371
// IE 6 and 7 throw
13711372
}
@@ -1966,6 +1967,12 @@
19661967
break;
19671968
}
19681969

1970+
assertNoDocTypeNotationEntityAncestor(sc, true);
1971+
assertValidOffset(sc, so);
1972+
1973+
assertNoDocTypeNotationEntityAncestor(ec, true);
1974+
assertValidOffset(ec, eo);
1975+
19691976
boundaryUpdater(this, sc, so, ec, eo);
19701977
},
19711978

@@ -2128,6 +2135,12 @@
21282135
assertNoDocTypeNotationEntityAncestor(node, true);
21292136
assertValidOffset(node, offset);
21302137
this.setStartAndEnd(node, offset);
2138+
},
2139+
2140+
parentElement: function() {
2141+
assertRangeValid(this);
2142+
var parentNode = this.commonAncestorContainer;
2143+
return parentNode ? getElementAncestor(this.commonAncestorContainer, true) : null;
21312144
}
21322145
});
21332146

@@ -2149,17 +2162,11 @@
21492162
range.endContainer = endContainer;
21502163
range.endOffset = endOffset;
21512164
range.document = dom.getDocument(startContainer);
2152-
21532165
updateCollapsedAndCommonAncestor(range);
21542166
}
21552167

21562168
function Range(doc) {
2157-
this.startContainer = doc;
2158-
this.startOffset = 0;
2159-
this.endContainer = doc;
2160-
this.endOffset = 0;
2161-
this.document = doc;
2162-
updateCollapsedAndCommonAncestor(this);
2169+
updateBoundaries(this, doc, 0, doc, 0);
21632170
}
21642171

21652172
createPrototypeRange(Range, updateBoundaries);

lib/rangy-highlighter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
*
55
* Depends on Rangy core, ClassApplier and optionally TextRange modules.
66
*
7-
* Copyright 2015, Tim Down
7+
* Copyright 2019, Tim Down
88
* Licensed under the MIT license.
9-
* Version: 1.3.1-dev
10-
* Build date: 20 May 2015
9+
* Version: 1.3.2
10+
* Build date: 2 January 2019
1111
*/
1212
(function(factory, root) {
1313
if (typeof define == "function" && define.amd) {

lib/rangy-selectionsaverestore.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
*
88
* Depends on Rangy core.
99
*
10-
* Copyright 2015, Tim Down
10+
* Copyright 2019, Tim Down
1111
* Licensed under the MIT license.
12-
* Version: 1.3.1-dev
13-
* Build date: 20 May 2015
12+
* Version: 1.3.2
13+
* Build date: 2 January 2019
1414
*/
1515
(function(factory, root) {
1616
if (typeof define == "function" && define.amd) {
@@ -24,7 +24,7 @@
2424
factory(root.rangy);
2525
}
2626
})(function(rangy) {
27-
rangy.createModule("SaveRestore", ["WrappedRange"], function(api, module) {
27+
rangy.createModule("SaveRestore", ["WrappedSelection"], function(api, module) {
2828
var dom = api.dom;
2929
var removeNode = dom.removeNode;
3030
var isDirectionBackward = api.Selection.isDirectionBackward;

lib/rangy-serializer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
*
99
* Depends on Rangy core.
1010
*
11-
* Copyright 2015, Tim Down
11+
* Copyright 2019, Tim Down
1212
* Licensed under the MIT license.
13-
* Version: 1.3.1-dev
14-
* Build date: 20 May 2015
13+
* Version: 1.3.2
14+
* Build date: 2 January 2019
1515
*/
1616
(function(factory, root) {
1717
if (typeof define == "function" && define.amd) {

lib/rangy-textrange.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
*
2525
* Depends on Rangy core.
2626
*
27-
* Copyright 2015, Tim Down
27+
* Copyright 2019, Tim Down
2828
* Licensed under the MIT license.
29-
* Version: 1.3.1-dev
30-
* Build date: 20 May 2015
29+
* Version: 1.3.2
30+
* Build date: 2 January 2019
3131
*/
3232

3333
/**

0 commit comments

Comments
 (0)