2015-01-21 14:22:34 +00:00
|
|
|
/*global define*/
|
|
|
|
define([
|
|
|
|
'jquery',
|
|
|
|
'backbone',
|
|
|
|
'app/collections/group-repos',
|
|
|
|
'app/views/group'
|
|
|
|
], function($, Backbone, Repos, GroupView) {
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
var GroupRouter = Backbone.Router.extend({
|
|
|
|
routes: {
|
|
|
|
'libs/:id(/*path)': 'showDirents',
|
|
|
|
|
2015-01-29 06:45:26 +00:00
|
|
|
'recent-changes': 'showRecentChanges',
|
|
|
|
|
2015-01-21 14:22:34 +00:00
|
|
|
// Default
|
|
|
|
'*actions': 'defaultAction'
|
|
|
|
},
|
|
|
|
|
2015-01-29 06:45:26 +00:00
|
|
|
initialize: function() {
|
|
|
|
this.groupView = new GroupView();
|
|
|
|
},
|
|
|
|
|
2015-01-21 14:22:34 +00:00
|
|
|
showDirents: function(id, path){
|
|
|
|
console.log("Repo route has been called.." + "id:" + id + " path:" + path);
|
2015-01-27 09:32:31 +00:00
|
|
|
// new GroupView().showDirentList(id, path);
|
2015-01-21 14:22:34 +00:00
|
|
|
},
|
|
|
|
|
2015-01-29 06:45:26 +00:00
|
|
|
showRecentChanges: function() {
|
|
|
|
console.log('recent changes');
|
|
|
|
this.groupView.showChanges();
|
|
|
|
},
|
|
|
|
|
2015-01-21 14:22:34 +00:00
|
|
|
defaultAction: function(actions){
|
|
|
|
// We have no matching route, lets just log what the URL was
|
|
|
|
console.log('No route:', actions);
|
2015-01-29 06:45:26 +00:00
|
|
|
this.groupView.showRepoList();
|
2015-01-21 14:22:34 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return GroupRouter;
|
|
|
|
});
|