hyperdrive-ui
Advanced tools
Comparing version 1.2.1 to 1.2.2
16
index.js
@@ -22,4 +22,5 @@ var path = require('path') | ||
function page (root) { | ||
yofs(fs, root, entries, clickEntry) | ||
function page (newRoot) { | ||
root = newRoot | ||
yofs(fs, newRoot, entries, clickEntry) | ||
} | ||
@@ -29,10 +30,7 @@ | ||
var parts = root.split('/') | ||
while (parts[parts.length - 1] === '') { | ||
parts.pop() | ||
} | ||
while (parts[parts.length - 1] === '') { parts.pop() } | ||
function back () { page(path.dirname(root)) } | ||
var crumbs | ||
if (parts.length) crumbs = yo`<button onclick=${function () { page('/')} }>back</button>` | ||
return yo`<div id="breadcrumbs"> | ||
${crumbs} | ||
</div>` | ||
if (parts.length) crumbs = yo`<button onclick=${back}>back</button>` | ||
return yo`<div id="breadcrumbs"> ${crumbs} </div>` | ||
} | ||
@@ -39,0 +37,0 @@ |
{ | ||
"name": "hyperdrive-ui", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Render a hyperdrive in the browser.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,17 +5,5 @@ # hyperdrive-ui | ||
Live demo: [http://karissa.github.io/hyperdrive-ui/](http://karissa.github.io/hyperdrive-ui/) | ||
## TODO | ||
- [ ] download button | ||
- [ ] design | ||
- [ ] render websites | ||
- [ ] allow #hash/path/to/data.txt to automatically display | ||
- [ ] selective file or folder download | ||
## Example | ||
``` | ||
npm install | ||
npm start | ||
``` | ||
Live demo: [http://karissa.github.io/hyperdrive-ui/](http://karissa.github.io/hyperdrive-ui/) | ||
@@ -32,1 +20,8 @@ | ||
See `app.js` for an example. | ||
## get started | ||
``` | ||
npm install | ||
npm start | ||
``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
10937
207
26