From 9654ba6a50748a5f8db6b837ba66a7116e76c7ee Mon Sep 17 00:00:00 2001 From: devfake Date: Mon, 22 Jun 2015 18:12:34 +0200 Subject: [PATCH 1/2] add routing --- site/client/app/components/deckBuilder.js | 5 +++ site/client/app/components/inner.js | 3 +- site/client/app/components/lobby.js | 2 +- site/client/app/components/navigation.js | 4 --- site/client/app/routes.js | 37 +++++++++-------------- site/client/app/views/inner.html | 13 +++++++- site/client/app/views/navigation.html | 4 +-- site/client/assets/sass/_modal.scss | 13 ++++---- 8 files changed, 44 insertions(+), 37 deletions(-) create mode 100644 site/client/app/components/deckBuilder.js diff --git a/site/client/app/components/deckBuilder.js b/site/client/app/components/deckBuilder.js new file mode 100644 index 0000000..48912bc --- /dev/null +++ b/site/client/app/components/deckBuilder.js @@ -0,0 +1,5 @@ +module.exports = { + + template: "

deckbuilder hier

" + +}; \ No newline at end of file diff --git a/site/client/app/components/inner.js b/site/client/app/components/inner.js index deea695..381f2f7 100644 --- a/site/client/app/components/inner.js +++ b/site/client/app/components/inner.js @@ -13,7 +13,8 @@ module.exports = { navigation: require('./navigation'), chat: require('./chat'), - lobby: require('./lobby') + lobby: require('./lobby'), + deckBuilder: require('./deckBuilder') } }; \ No newline at end of file diff --git a/site/client/app/components/lobby.js b/site/client/app/components/lobby.js index 1e87a1d..dce420d 100644 --- a/site/client/app/components/lobby.js +++ b/site/client/app/components/lobby.js @@ -1,5 +1,5 @@ module.exports = { - template: require('../views/lobby.html'), + template: "

lobby hier

" }; \ No newline at end of file diff --git a/site/client/app/components/navigation.js b/site/client/app/components/navigation.js index 9a0a48d..9d9f695 100644 --- a/site/client/app/components/navigation.js +++ b/site/client/app/components/navigation.js @@ -7,10 +7,6 @@ module.exports = { inherit: true, methods: { - changeView: function(view) { - router.changeRoute(view); - }, - searchMatch: function() { this.modal = true; // trigger match functions diff --git a/site/client/app/routes.js b/site/client/app/routes.js index 6d6646e..4661adc 100644 --- a/site/client/app/routes.js +++ b/site/client/app/routes.js @@ -1,26 +1,19 @@ -var routes = { - '/lobby': function() { - alert('lobby'); - }, - - '/deck-builder': function() { - alert('deck-builder'); - }, - - '/highscore': function() { - alert('highscore'); - } -}; - -var options = { - html5history: true -} - -var Router = require('director').Router; -var router = new Router(routes).configure(options).init(); +require('../../../public/Config.js'); module.exports = { - changeRoute: function(route) { - router.setRoute(route); + + maps: { + '/lobby': { + component: 'lobby' + }, + + '/deck-builder': { + component: 'deckBuilder' + } + }, + + options: { + history: true, + root: window.Config.Site.base } } \ No newline at end of file diff --git a/site/client/app/views/inner.html b/site/client/app/views/inner.html index fcf4779..397f9bc 100644 --- a/site/client/app/views/inner.html +++ b/site/client/app/views/inner.html @@ -4,10 +4,21 @@
+ +
- + + +
diff --git a/site/client/app/views/navigation.html b/site/client/app/views/navigation.html index e0346d1..209ff88 100644 --- a/site/client/app/views/navigation.html +++ b/site/client/app/views/navigation.html @@ -1,7 +1,7 @@