Commit f62b26fc authored by danielgrippi's avatar danielgrippi Committed by Dennis Collinson

put the frontend into its own folder; only use one routes file

parent 1ecfa92c
......@@ -15,13 +15,11 @@ javascripts:
- public/javascripts/vendor/underscore.js
- public/javascripts/vendor/backbone.js
- public/javascripts/app.js
- public/javascripts/models/*
- public/javascripts/collections/*
- public/javascripts/views/*
- public/javascripts/routers/*
- public/javascripts/routers/stream/*
- public/javascripts/app/app.js
- public/javascripts/app/router.js
- public/javascripts/app/models/*
- public/javascripts/app/collections/*
- public/javascripts/app/views/*
- public/javascripts/rails.validations.js
- public/javascripts/rails.js
......
var App = {
Collections: {},
Models: {},
routers: {},
Routers: {},
Views: {},
user: function(user) {
......@@ -12,9 +10,7 @@ var App = {
},
initialize: function() {
_.each(App.Routers, function(Router, name) {
App.routers[name] = new Router;
});
App.router = new App.Router;
Backbone.history.start({pushState: true});
}
......
App.Routers.Stream = Backbone.Router.extend({
App.Router = Backbone.Router.extend({
routes: {
"stream": "stream"
"stream": "stream",
"comment_stream": "stream",
"mentions": "stream",
"people/:id": "stream",
"tag_followings": "stream",
"tags/:name": "stream"
},
stream: function() {
......
App.Routers.Comments = App.Routers.Stream.extend({
routes: {
"comment_stream": "stream"
}
});
App.Routers.Mentions = App.Routers.Stream.extend({
routes: {
"mentions": "stream"
}
});
App.Routers.People = App.Routers.Stream.extend({
routes: {
"people/:id": "stream"
}
});
App.Routers.TagFollowings = App.Routers.Stream.extend({
routes: {
"tag_followings": "stream"
}
});
App.Routers.Tags = App.Routers.Stream.extend({
routes: {
"tags/:id": "stream"
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment