summaryrefslogtreecommitdiff
path: root/public/assets/js/view/router.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/js/view/router.js')
-rw-r--r--public/assets/js/view/router.js67
1 files changed, 0 insertions, 67 deletions
diff --git a/public/assets/js/view/router.js b/public/assets/js/view/router.js
deleted file mode 100644
index 36f86b5..0000000
--- a/public/assets/js/view/router.js
+++ /dev/null
@@ -1,67 +0,0 @@
-var Router = View.extend({
-
- go: function(url){
- this.parseRoute(url)
- },
-
- route: function(){
- this.originalPath = window.location.pathname
- this.parseRoute(window.location.pathname)
- },
-
- parseRoute: function(pathname){
-
- var routes = is_mobile ? this.mobileRoutes : this.routes,
- path = pathname.split("/");
-
- for (var i = 0; i < path.length; i++) {
- if (! path[i].length) {
- path[i] = null
- }
- }
-
- if (pathname in routes) {
- this[this.routes[pathname]]()
- return
- }
-
- if (path[path.length-1] == null) {
- path.pop()
- }
-
- for (var route in routes) {
- var routePath = route.split("/")
- if (routePath[1] == path[1]) {
- if (routePath[2] && routePath[2].indexOf(":") !== -1 && path[2] && (path[3] === routePath[3]) ) {
- this[this.routes[route]](path[2])
- return
- }
- else if (routePath[2] == path[2]) {
- if (routePath[3] && path[3]) {
- if (routePath[3].indexOf(":") !== -1) {
- this[this.routes[route]](path[3])
- return
- }
- else if (routePath[3] == path[3]) {
- this[this.routes[route]]()
- return
- }
- }
- else if (! routePath[3] && ! path[3]) {
- this[this.routes[route]]()
- return
- }
- }
- else if (! routePath[2] && (! path[2].length || ! path[2])) {
- this[this.routes[route]]()
- return
- }
- }
- }
-
- if (is_mobile) {
- window.location.href = "/"
- }
- }
-
-})