-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78f1987
commit 8f92d73
Showing
17 changed files
with
221 additions
and
224 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
ratings: | ||
paths: | ||
- "src/**.js" | ||
- 'src/**.js' | ||
|
||
exclude_paths: | ||
- "route.js" | ||
- "route.esm.js" | ||
- "route.standalone.js" | ||
- "test/**" | ||
- "demos/**" | ||
- 'route.js' | ||
- 'route.esm.js' | ||
- 'route.standalone.js' | ||
- 'test/**' | ||
- 'demos/**' |
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,22 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>Riot.js history</title> | ||
<script src="https://unpkg.com/riot/riot.min.js"></script> | ||
<script src="../route.js"></script> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module"> | ||
import App from './components/app.js' | ||
import User from './components/user.js' | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<title>Riot.js history</title> | ||
<script src="https://unpkg.com/riot/riot.min.js"></script> | ||
<script src="../route.js"></script> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module"> | ||
import App from './components/app.js' | ||
import User from './components/user.js' | ||
|
||
riot.register('route', route.Route) | ||
riot.register('router', route.Router) | ||
riot.register('user', User) | ||
riot.component(App)(app) | ||
</script> | ||
</body> | ||
</html> | ||
riot.register('route', route.Route) | ||
riot.register('router', route.Router) | ||
riot.register('user', User) | ||
riot.component(App)(app) | ||
</script> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>Standalone Hash Demo</title> | ||
<script src="../route.standalone.js"></script> | ||
</head> | ||
<body> | ||
<nav> | ||
<a href="#/hello">Hello</a> | ||
<a href="#/user">User</a> | ||
<a href="#/user/gianluca">Username</a> | ||
<a href="#/goodbye">goodbye</a> | ||
</nav> | ||
<div id="root"> | ||
</div> | ||
<script type="module"> | ||
const { initDomListeners, setBase, router } = route | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<title>Standalone Hash Demo</title> | ||
<script src="../route.standalone.js"></script> | ||
</head> | ||
<body> | ||
<nav> | ||
<a href="#/hello">Hello</a> | ||
<a href="#/user">User</a> | ||
<a href="#/user/gianluca">Username</a> | ||
<a href="#/goodbye">goodbye</a> | ||
</nav> | ||
<div id="root"></div> | ||
<script type="module"> | ||
const { initDomListeners, setBase, router } = route | ||
|
||
setBase('#') | ||
setBase('#') | ||
|
||
const onRoute = (url) => root.innerHTML = `${url} and params=${JSON.stringify(url.params)}` | ||
const onRoute = (url) => | ||
(root.innerHTML = `${url} and params=${JSON.stringify(url.params)}`) | ||
|
||
route.route('/hello').on.value(onRoute) | ||
route.route('/user').on.value(onRoute) | ||
route.route('/user/:username').on.value(onRoute) | ||
route.route('/goodbye').on.value(onRoute) | ||
route.route('/hello').on.value(onRoute) | ||
route.route('/user').on.value(onRoute) | ||
route.route('/user/:username').on.value(onRoute) | ||
route.route('/goodbye').on.value(onRoute) | ||
|
||
router.push(window.location.hash.replace('#', '')) | ||
router.push(window.location.hash.replace('#', '')) | ||
|
||
initDomListeners() | ||
</script> | ||
</body> | ||
initDomListeners() | ||
</script> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>Standalone History Demo</title> | ||
<script src="../route.standalone.js"></script> | ||
</head> | ||
<body> | ||
<nav> | ||
<a href="/hello">Hello</a> | ||
<a href="/user">User</a> | ||
<a href="/user/gianluca">Username</a> | ||
<a href="/goodbye">goodbye</a> | ||
</nav> | ||
<div id="root"> | ||
</div> | ||
<script type="module"> | ||
const { initDomListeners, setBase, router } = route | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<title>Standalone History Demo</title> | ||
<script src="../route.standalone.js"></script> | ||
</head> | ||
<body> | ||
<nav> | ||
<a href="/hello">Hello</a> | ||
<a href="/user">User</a> | ||
<a href="/user/gianluca">Username</a> | ||
<a href="/goodbye">goodbye</a> | ||
</nav> | ||
<div id="root"></div> | ||
<script type="module"> | ||
const { initDomListeners, setBase, router } = route | ||
|
||
setBase('/') | ||
setBase('/') | ||
|
||
const onRoute = (url) => root.innerHTML = `${url} and params=${JSON.stringify(url.params)}` | ||
const onRoute = (url) => | ||
(root.innerHTML = `${url} and params=${JSON.stringify(url.params)}`) | ||
|
||
route.route('/hello').on.value(onRoute) | ||
route.route('/user').on.value(onRoute) | ||
route.route('/user/:username').on.value(onRoute) | ||
route.route('/goodbye').on.value(onRoute) | ||
route.route('/hello').on.value(onRoute) | ||
route.route('/user').on.value(onRoute) | ||
route.route('/user/:username').on.value(onRoute) | ||
route.route('/goodbye').on.value(onRoute) | ||
|
||
initDomListeners() | ||
</script> | ||
</body> | ||
initDomListeners() | ||
</script> | ||
</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
Oops, something went wrong.