summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/_router.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-06-21 00:50:15 +0200
committerJules Laplace <julescarbon@gmail.com>2017-06-21 00:50:15 +0200
commit0b854ecccfe7832ba9a837605822a103fd9d8bc0 (patch)
treed4a11b5677ff96618d29b114e43d25a334f66412 /public/assets/js/lib/_router.js
parentfbbb3a348018081bb2a89439eb3275153105d2e0 (diff)
clearing out old code
Diffstat (limited to 'public/assets/js/lib/_router.js')
-rw-r--r--public/assets/js/lib/_router.js83
1 files changed, 0 insertions, 83 deletions
diff --git a/public/assets/js/lib/_router.js b/public/assets/js/lib/_router.js
deleted file mode 100644
index 8d27b9c..0000000
--- a/public/assets/js/lib/_router.js
+++ /dev/null
@@ -1,83 +0,0 @@
-var SiteRouter = Router.extend({
-
- el: 'body',
- routeByHash: false,
-
- routes: {
- '/': 'home',
- '/page/:id': 'pageById',
- '/painting/:id': 'paintingById',
- '/picture/:id': 'paintingById',
- '/paintings': 'list',
- '/pictures': 'list',
- },
-
- initialize: function(){
- var fn
- for (var route in this.routes) {
- fn = this.routes[route]
- if (! this[fn]) {
- this[fn] = this.default_view(fn)
- }
- }
- },
-
- initial_route: null,
- launch: function(){
- if (this.initial_route) {
- this.parseRoute( this.initial_route )
- }
- else {
- this.route()
- }
- this.initial_route = null
- },
-
- go: function(url){
- if (app.view && app.view.hide) {
- app.view.hide()
- }
- this.pushState(url)
- this.parseRoute(url)
- },
-
- default_view: function(name){
- var fn = function(){
- if (app.view != app.login && app.view != app.signin) {
- app.last_view = app.view
- }
- if (app.view && app.view.hide) {
- app.view.hide()
- }
- if (name.match(/\./)) {
- var n = name.split(".")
- app.view = app.views[n[0]][n[1]]
- }
- else {
- app.view = app.views[name]
- }
- app.view.show()
- }.bind(this)
- return fn
- },
-
- paintingById: function(id){
- if (app.view && app.view.hide) {
- app.view.hide()
- }
- app.view = app.views.painting
- app.views.painting.show()
- app.views.painting.load(id)
- },
-
- pageById: function(id){
- if (app.view && app.view.hide) {
- app.view.hide()
- }
- app.view = app.views.page
- app.views.page.show()
- app.views.page.load(id)
- }
-
-})
-