1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-25 06:33:48 +00:00

delete unused myhome.js, group.js, organization.js, redirect home/my/ to /

This commit is contained in:
Daniel Pan
2015-04-14 15:08:19 +08:00
parent f8750ecfae
commit 177d962f84
9 changed files with 1 additions and 229 deletions

View File

@@ -1,6 +0,0 @@
define([
'app/routers/group'
], function(Router){
app.router = new Router();
Backbone.history.start();
});

View File

@@ -1,6 +0,0 @@
define([
'app/routers/myhome'
], function(Router){
app.router = new Router();
Backbone.history.start();
});

View File

@@ -1,6 +0,0 @@
define([
'app/routers/organization'
], function(Router){
app.router = new Router();
Backbone.history.start();
});

View File

@@ -1,46 +0,0 @@
/*global define*/
define([
'jquery',
'backbone',
'app/collections/group-repos',
'app/views/group'
], function($, Backbone, Repos, GroupView) {
"use strict";
var GroupRouter = Backbone.Router.extend({
routes: {
'lib/:repo_id(/*path)': 'showDir',
'recent-changes': 'showRecentChanges',
// Default
'*actions': 'defaultAction'
},
initialize: function() {
this.groupView = new GroupView();
},
showDir: function(repo_id, path) {
if (path) {
path = '/' + path;
} else {
path = '/';
}
this.groupView.showDir(repo_id, path);
},
showRecentChanges: function() {
console.log('recent changes');
this.groupView.showChanges();
},
defaultAction: function(actions){
// We have no matching route, lets just log what the URL was
console.log('No route:', actions);
this.groupView.showRepoList();
}
});
return GroupRouter;
});

View File

@@ -1,77 +0,0 @@
/*global define*/
define([
'jquery',
'backbone',
'app/collections/repos',
'app/views/myhome'
], function($, Backbone, Repos, MyHomeView) {
"use strict";
var MyHomeRouter = Backbone.Router.extend({
routes: {
'my-libs': 'showMyRepos',
'my-libs/lib/:repo_id(/*path)': 'showMyRepoDir',
'my-sub-libs': 'showMySubRepos',
'my-sub-libs/lib/:repo_id(/*path)': 'showMySubRepoDir',
'shared-libs': 'showSharedRepos',
'shared-libs/lib/:repo_id(/*path)': 'showSharedRepoDir',
// Default
'*actions': 'defaultAction'
},
initialize: function() {
this.myHomeView = new MyHomeView();
},
showMyRepos: function() {
this.myHomeView.showMyRepos();
},
showMySubRepos: function() {
console.log("show My Sub Repos");
this.myHomeView.showMySubRepos();
},
showSharedRepos: function() {
console.log("show shared repos");
this.myHomeView.showSharedRepos();
},
showMyRepoDir: function(repo_id, path) {
if (path) {
path = '/' + path;
} else {
path = '/';
}
this.myHomeView.showDir('my-libs', repo_id, path);
},
showMySubRepoDir: function(repo_id, path) {
if (path) {
path = '/' + path;
} else {
path = '/';
}
this.myHomeView.showDir('my-sub-libs', repo_id, path);
},
showSharedRepoDir: function(repo_id, path) {
if (path) {
path = '/' + path;
} else {
path = '/';
}
this.myHomeView.showDir('shared-libs', repo_id, path);
},
defaultAction: function(actions) {
// We have no matching route, lets just log what the URL was
console.log('No route:', actions);
this.myHomeView.showMyRepos();
}
});
return MyHomeRouter;
});

View File

@@ -1,35 +0,0 @@
/*global define*/
define([
'jquery',
'backbone',
'app/views/organization'
], function($, Backbone, OrganizationView) {
"use strict";
var OrganizationRouter = Backbone.Router.extend({
routes: {
'lib/:repo_id(/*path)': 'showDir',
// Default
'*actions': 'defaultAction'
},
initialize: function() {
this.orgView = new OrganizationView();
},
showDir: function(repo_id, path) {
if (path) {
path = '/' + path;
} else {
path = '/';
}
this.orgView.showDir(repo_id, path);
},
defaultAction: function(){
this.orgView.showPublicRepos();
}
});
return OrganizationRouter;
});

View File

@@ -1,34 +0,0 @@
/*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;
});