mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-27 23:56:18 +00:00
Split js from django template, move js to scripts , add requirejs support, and i18n for js
This commit is contained in:
34
media/scripts/app/routers/router.js
Normal file
34
media/scripts/app/routers/router.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/*global define*/
|
||||
define([
|
||||
'jquery',
|
||||
'backbone'
|
||||
], function($, Backbone) {
|
||||
"use strict";
|
||||
|
||||
var MyHomeRouter = Backbone.Router.extend({
|
||||
routes: {
|
||||
'libs/:id(/*path)': 'showDirents',
|
||||
|
||||
// Default
|
||||
'*actions': 'defaultAction'
|
||||
},
|
||||
|
||||
showDirents: function(id, path){
|
||||
console.log("Repo route has been called.." + "id:" + id + " path:" + path);
|
||||
// if (!app.myHomePage) // XXX: is it good ?
|
||||
// app.myHomePage = new app.MyHomePage();
|
||||
|
||||
// app.myHomePage.trigger('showDirents', id, path);
|
||||
},
|
||||
|
||||
defaultAction: function(actions){
|
||||
// We have no matching route, lets just log what the URL was
|
||||
console.log('No route:', actions);
|
||||
// app.myHomePage = new app.MyHomePage();
|
||||
// app.myHomePage.showRepoList();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return MyHomeRouter;
|
||||
});
|
Reference in New Issue
Block a user