-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from buildrs/click-nav
MERGE ME
- Loading branch information
Showing
15 changed files
with
1,782 additions
and
508 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<html><head><meta http-equiv="refresh" content="0; URL=/Share/"></head><body></body></html> | ||
<html><head><meta http-equiv="refresh" content="0; URL=/"></head><body></body></html> |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<html><head><meta http-equiv="refresh" content="0; URL=/Share/"></head><body></body></html> | ||
<html><head><meta http-equiv="refresh" content="0; URL=/"></head><body></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,38 @@ | ||
/** | ||
* Visits an element tree and sets parent links for each element. | ||
*/ | ||
function setupParentLinks(elt) { | ||
function visitTree(elt, observeCb) { | ||
if (elt && elt.children) { | ||
for (const child of elt.children) { | ||
child.parent = elt; | ||
setupParentLinks(child); | ||
observeCb(child, elt); | ||
visitTree(child, observeCb); | ||
} | ||
} | ||
} | ||
|
||
|
||
/** | ||
* Visits an element tree and sets parent links for each element. | ||
*/ | ||
function setupLookupAndParentLinks(rootElt, elementsById) { | ||
if (elementsById === undefined || elementsById == null) { | ||
throw new Error('Illegal argument: elementsById undefined'); | ||
} | ||
visitTree(rootElt, (elt, parent) => { | ||
elementsById[parent.expressID] = parent; | ||
elementsById[elt.expressID] = elt; | ||
elt.parent = parent; | ||
}); | ||
} | ||
|
||
|
||
function computeElementPath(elt, getNameCb) { | ||
if (getNameCb === undefined || getNameCb == null) { | ||
throw new Error('Illegal argument: getNameCb undefined'); | ||
} | ||
return (elt.parent ? computeElementPath(elt.parent, getNameCb) : '' ) + '/' + getNameCb(elt); | ||
} | ||
|
||
|
||
export { | ||
computeElementPath, | ||
setupParentLinks | ||
setupLookupAndParentLinks, | ||
visitTree | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters