added web interface (WIP)

This commit is contained in:
2015-10-01 00:27:15 +02:00
parent cde2a37afe
commit fe563e32ee
35 changed files with 1660 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<script src="../bower_components/page/page.js"></script>
<script>
window.addEventListener('WebComponentsReady', function() {
// We use Page.js for routing. This is a Micro
// client-side router inspired by the Express router
// More info: https://visionmedia.github.io/page.js/
// Middleware
function scrollToTop(ctx, next) {
app.scrollPageToTop();
next();
}
// Routes
page('/', scrollToTop, function() {
app.route = 'home';
});
page('/users', scrollToTop, function() {
app.route = 'users';
});
page('/users/:name', scrollToTop, function(data) {
app.route = 'user-info';
app.params = data.params;
});
page('/contact', scrollToTop, function() {
app.route = 'contact';
});
// add #! before urls
page({
hashbang: true
});
});
</script>