aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaciej Bendkowski2012-09-12 04:17:24 (EDT)
committersfranklin2012-09-20 14:07:08 (EDT)
commitf6a5eb8a54ab019f6fc4f3cbda892a937d2b0ce6 (patch)
tree500a336a61f7ffbf70f8f52cbabe8b35c272f18c
parent1d6b7b754a218764526dc5283ddd1d3965439606 (diff)
downloadorg.eclipse.orion.client-f6a5eb8a54ab019f6fc4f3cbda892a937d2b0ce6.zip
org.eclipse.orion.client-f6a5eb8a54ab019f6fc4f3cbda892a937d2b0ce6.tar.gz
org.eclipse.orion.client-f6a5eb8a54ab019f6fc4f3cbda892a937d2b0ce6.tar.bz2
Bug 389083 - Repository page URI template for cloning no longer working (again)
-rw-r--r--bundles/org.eclipse.orion.client.git/web/git/git-repository.js28
-rw-r--r--bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js26
2 files changed, 41 insertions, 13 deletions
diff --git a/bundles/org.eclipse.orion.client.git/web/git/git-repository.js b/bundles/org.eclipse.orion.client.git/web/git/git-repository.js
index ac48f6e..a22e3dc 100644
--- a/bundles/org.eclipse.orion.client.git/web/git/git-repository.js
+++ b/bundles/org.eclipse.orion.client.git/web/git/git-repository.js
@@ -113,14 +113,28 @@ mBootstrap.startup().then(function(core) {
}
);
+ // previously saved resource value
+ var previousResourceValue = "";
+
//every time the user manually changes the hash, we need to load the workspace with that name
- dojo.subscribe("/dojo/hashchange", explorer, function() { //$NON-NLS-0$
- fileClient.loadWorkspace().then(
- function(workspace){
- explorer.setDefaultPath(workspace.Location);
- explorer.redisplay();
- }
- );
+ dojo.subscribe("/dojo/hashchange", explorer, function(changedHash) { //$NON-NLS-0$
+
+ // make sure to close all parameter collectors
+ commandService.closeParameterCollector();
+
+ var resource = PageUtil.matchResourceParameters().resource;
+
+ // do not redisplay if not necessary
+ if(previousResourceValue !== resource){
+ previousResourceValue = resource;
+
+ fileClient.loadWorkspace().then(
+ function(workspace){
+ explorer.setDefaultPath(workspace.Location);
+ explorer.redisplay();
+ }
+ );
+ }
});
});
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js b/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js
index bed3d4c..08eea65 100644
--- a/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js
+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js
@@ -63,10 +63,16 @@ exports.GitRepositoryExplorer = (function() {
};
GitRepositoryExplorer.prototype.changedItem = function(parent, children) {
- this.redisplay();
+ // An item changed so we do not need to process any URLs
+ this.redisplay(false);
};
- GitRepositoryExplorer.prototype.redisplay = function(){
+ GitRepositoryExplorer.prototype.redisplay = function(processURLs){
+ // make sure to have this flag
+ if(processURLs === undefined){
+ processURLs = true;
+ }
+
var pageParams = PageUtil.matchResourceParameters();
if (pageParams.resource) {
this.displayRepository(pageParams.resource);
@@ -78,13 +84,21 @@ exports.GitRepositoryExplorer = (function() {
var gitapiCloneUrl = require.toUrl("gitapi/clone._"); //$NON-NLS-0$
gitapiCloneUrl = gitapiCloneUrl.substring(0, gitapiCloneUrl.length-2);
- this.displayRepositories2(relativePath[0] === "/" ? gitapiCloneUrl + relativePath : gitapiCloneUrl + "/" + relativePath); //$NON-NLS-1$ //$NON-NLS-0$
+ this.displayRepositories2(relativePath[0] === "/" ? gitapiCloneUrl + relativePath : gitapiCloneUrl + "/" + relativePath, processURLs); //$NON-NLS-1$ //$NON-NLS-0$
};
};
- GitRepositoryExplorer.prototype.displayRepositories2 = function(location){
+ GitRepositoryExplorer.prototype.displayRepositories2 = function(location, processURLs){
var that = this;
this.loadingDeferred = new dojo.Deferred();
+ console.log(processURLs);
+
+ if(processURLs){
+ this.loadingDeferred.then(function(){
+ that.commandService.processURL(window.location.href);
+ });
+ }
+
var progressService = this.registry.getService("orion.page.message"); //$NON-NLS-0$
progressService.showWhile(this.loadingDeferred, "Loading..."); //$NON-NLS-0$
this.registry.getService("orion.git.provider").getGitClone(location).then( //$NON-NLS-0$
@@ -99,7 +113,7 @@ exports.GitRepositoryExplorer = (function() {
that.displayRepositories(repositories, "full", true); //$NON-NLS-0$
}
- that.commandService.processURL(window.location.href);
+ //that.commandService.processURL(window.location.href);
}, function(error){
dojo.hitch(that, that.handleError)(error);
}
@@ -185,7 +199,7 @@ exports.GitRepositoryExplorer = (function() {
}
);
}
- that.commandService.processURL(window.location.href);
+ //that.commandService.processURL(window.location.href);
progressService.setProgressMessage("");
}, function(error){
dojo.hitch(that, that.handleError)(error);