| author | Maciej Bendkowski | 2012-09-12 04:17:24 (EDT) |
|---|---|---|
| committer | sfranklin | 2012-09-20 14:07:08 (EDT) |
| commit | 8e98231dff6e737585f7043c66bd22ea3a53f86e (patch) (side-by-side diff) | |
| tree | 500a336a61f7ffbf70f8f52cbabe8b35c272f18c | |
| parent | 6fe7f200e24aee954dbb66b340afdaaaac694ab0 (diff) | |
| download | org.eclipse.orion.client-8e98231dff6e737585f7043c66bd22ea3a53f86e.zip org.eclipse.orion.client-8e98231dff6e737585f7043c66bd22ea3a53f86e.tar.gz org.eclipse.orion.client-8e98231dff6e737585f7043c66bd22ea3a53f86e.tar.bz2 | |
Bug 389083 - Repository page URI template for cloning no longer working (again)v20120920-1807
| -rw-r--r-- | bundles/org.eclipse.orion.client.git/web/git/git-repository.js | 28 | ||||
| -rw-r--r-- | bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js | 26 |
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); |

