diff options
author | Bogdan Gheorghe <gheorghe@ca.ibm.com> | 2014-06-16 13:00:20 -0400 |
---|---|---|
committer | Bogdan Gheorghe <gheorghe@ca.ibm.com> | 2014-06-16 13:00:20 -0400 |
commit | 02ed5a2111d3b693084790e6d975a2a354794fd5 (patch) | |
tree | 6264886923638eb427acf6a18d1e6a95fd856c99 | |
parent | ffffc4a9cee9979648db617b69ae2a3e7666677e (diff) | |
download | org.eclipse.orion.client-origin/gheorghe/gitRepository2.zip org.eclipse.orion.client-origin/gheorghe/gitRepository2.tar.gz org.eclipse.orion.client-origin/gheorghe/gitRepository2.tar.bz2 |
Initial changes for new repo pageorigin/gheorghe/gitRepository2
9 files changed, 113 insertions, 73 deletions
diff --git a/bundles/org.eclipse.orion.client.git/web/git/css/git.css b/bundles/org.eclipse.orion.client.git/web/git/css/git.css index 4b0be47..adc4e72 100644 --- a/bundles/org.eclipse.orion.client.git/web/git/css/git.css +++ b/bundles/org.eclipse.orion.client.git/web/git/css/git.css @@ -18,6 +18,18 @@ background-position: left top; } +.sectionWrapper { + margin-left: 10px; + margin-right: 10px; + background-color: #ccc; +} + + +.sectionTable { + margin-left: 10px; + margin-right: 10px; +} + .gitCommitMessage .orionButton { margin: 15px; padding: 15px; @@ -101,7 +113,7 @@ } .gitCommitListSection { - background-color: #eee; + background-color: #ddd; } .gitCommitListSectionTitle { diff --git a/bundles/org.eclipse.orion.client.git/web/git/git-repository.html b/bundles/org.eclipse.orion.client.git/web/git/git-repository.html index ef97fad..8e51baf 100644 --- a/bundles/org.eclipse.orion.client.git/web/git/git-repository.html +++ b/bundles/org.eclipse.orion.client.git/web/git/git-repository.html @@ -30,10 +30,21 @@ <div id="sideMenu" class="sideMenu"></div> <div id="pageContent" class="content-fixedHeight"> <div id="sideMenuToggle" class="sideMenuToggle"></div> - <div class="fixedToolbarHolder mainpane mainPanelLayout"> - <div class="mainToolbar toolComposite" id="pageToolbar"></div> - <div id="mainNode" class="toolbarTarget pageLayoutTarget"> - <div id="table" class="gitPanel displayTable" style="padding-bottom: 20px;"> + <div id="pageToolbar" class="mainToolbar toolComposite toolbarLayout"></div> + <div id="innerPanels" class="innerPanels"> + <div class="auxpane sidePanelLayout hasSplit"> + <div id="outlineContainer" class="searchOutlineContainer"> + <div id="searchBuilder" class="sidePanelMargins"></div> + <div class="sidePanelMargins" id="searchProgress"></div> + </div> + </div> + <div class="split splitLayout" style="left:33%;"></div> + <div class="mainpane mainPanelLayout hasSplit"> + <div class="fixedToolbarHolder"> + <div id="mainNode" class="workingTarget"> + <div id="table" class="gitPanel displayTable" style="padding-bottom: 20px;"> + </div> + </div> </div> </div> </div> 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 52cfed5..2122331 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 @@ -75,7 +75,7 @@ mBootstrap.startup().then(function(core) { // object contributions commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.openCloneContent", 100); //$NON-NLS-1$ //$NON-NLS-0$ - commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.openGitLog", 100); //$NON-NLS-1$ //$NON-NLS-0$ +// commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.openGitLog", 100); //$NON-NLS-1$ //$NON-NLS-0$ commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.orion.git.pull", 200); //$NON-NLS-1$ //$NON-NLS-0$ commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.removeBranch", 1000); //$NON-NLS-1$ //$NON-NLS-0$ commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.checkoutTag", 0); //$NON-NLS-1$ //$NON-NLS-0$ @@ -84,10 +84,10 @@ mBootstrap.startup().then(function(core) { commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.orion.git.applyPatch", 300); //$NON-NLS-1$ //$NON-NLS-0$ commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.git.deleteClone", 1000); //$NON-NLS-1$ //$NON-NLS-0$ commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.orion.git.fetch", 500); //$NON-NLS-1$ //$NON-NLS-0$ - commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.orion.git.merge", 600); //$NON-NLS-1$ //$NON-NLS-0$ - commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.orion.git.mergeSquash", 700); //$NON-NLS-1$ //$NON-NLS-0$ - commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.orion.git.rebase", 700); //$NON-NLS-1$ //$NON-NLS-0$ - commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.orion.git.resetIndex", 800); //$NON-NLS-1$ //$NON-NLS-0$ +// commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.orion.git.merge", 600); //$NON-NLS-1$ //$NON-NLS-0$ +// commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.orion.git.mergeSquash", 700); //$NON-NLS-1$ //$NON-NLS-0$ +// commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.orion.git.rebase", 700); //$NON-NLS-1$ //$NON-NLS-0$ +// commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.orion.git.resetIndex", 800); //$NON-NLS-1$ //$NON-NLS-0$ commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.orion.git.undoCommit", 900); //$NON-NLS-1$ //$NON-NLS-0$ commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.removeRemote", 1000); //$NON-NLS-1$ //$NON-NLS-0$ commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.orion.git.deleteConfigEntryCommand", 1000); //$NON-NLS-1$ //$NON-NLS-0$ 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 985b5ea..0e235c0 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 @@ -16,7 +16,6 @@ define([ 'orion/git/widgets/gitCommitList', 'orion/git/widgets/gitBranchList', 'orion/git/widgets/gitConfigList', - 'orion/git/widgets/gitTagList', 'orion/git/widgets/gitRepoList', 'orion/section', 'orion/webui/littlelib', @@ -25,7 +24,7 @@ define([ 'orion/fileUtils', 'orion/globalCommands', 'orion/Deferred' -], function(require, messages, mGitChangeList, mGitCommitList, mGitBranchList, mGitConfigList, mGitTagList, mGitRepoList, mSection, lib, URITemplate, PageUtil, mFileUtils, mGlobalCommands, Deferred) { +], function(require, messages, mGitChangeList, mGitCommitList, mGitBranchList, mGitConfigList, mGitRepoList, mSection, lib, URITemplate, PageUtil, mFileUtils, mGlobalCommands, Deferred) { var exports = {}; var repoTemplate = new URITemplate("git/git-repository.html#{,resource,params*}"); //$NON-NLS-0$ @@ -167,10 +166,11 @@ exports.GitRepositoryExplorer = (function() { that.initTitleBar(repositories[0]); that.displayRepositories(repositories, "mini"); //$NON-NLS-0$ + that.displayBranches(repositories[0], "full"); //$NON-NLS-0$ that.statusDeferred = that.displayStatus(repositories[0]); that.displayCommits(repositories[0]); - that.displayBranches(repositories[0], "full"); //$NON-NLS-0$ that.displayConfig(repositories[0], "full"); //$NON-NLS-0$ + that.updateSelection(); } else if (resp.Children[0].Type === "Clone"){ //$NON-NLS-0$ repositories = resp.Children; @@ -275,7 +275,7 @@ exports.GitRepositoryExplorer = (function() { // Git repo GitRepositoryExplorer.prototype.displayRepositories = function(repositories, mode, links){ - var tableNode = lib.node( 'table' ); //$NON-NLS-0$ + var tableNode = lib.node( 'outlineContainer' ); //$NON-NLS-0$ lib.empty(tableNode); var contentParent = document.createElement("div"); tableNode.appendChild(contentParent); @@ -302,7 +302,7 @@ exports.GitRepositoryExplorer = (function() { GitRepositoryExplorer.prototype.displayBranches = function(repository, mode){ - var tableNode = lib.node( 'table' ); //$NON-NLS-0$ + var tableNode = lib.node( 'outlineContainer' ); //$NON-NLS-0$ var titleWrapper = new mSection.Section(tableNode, { id: "branchSection", //$NON-NLS-0$ @@ -368,7 +368,7 @@ exports.GitRepositoryExplorer = (function() { // Git commits GitRepositoryExplorer.prototype.displayCommits = function(repository){ - var tableNode = lib.node( 'table' ); //$NON-NLS-0$ + var tableNode = lib.node( 'outlineContainer' ); //$NON-NLS-0$ var titleWrapper = new mSection.Section(tableNode, { id: "commitSection", //$NON-NLS-0$ @@ -405,7 +405,7 @@ exports.GitRepositoryExplorer = (function() { GitRepositoryExplorer.prototype.displayConfig = function(repository, mode){ - var tableNode = lib.node( 'table' ); //$NON-NLS-0$ + var tableNode = lib.node( 'outlineContainer' ); //$NON-NLS-0$ var titleWrapper = new mSection.Section(tableNode, { id: "configSection", //$NON-NLS-0$ @@ -437,6 +437,10 @@ exports.GitRepositoryExplorer = (function() { }; + GitRepositoryExplorer.prototype.updateSelection = function() { + + }; + return GitRepositoryExplorer; }()); diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/util.js b/bundles/org.eclipse.orion.client.git/web/orion/git/util.js index 73b58a4..b55538b 100644 --- a/bundles/org.eclipse.orion.client.git/web/orion/git/util.js +++ b/bundles/org.eclipse.orion.client.git/web/orion/git/util.js @@ -103,7 +103,7 @@ define([ while(splitted.length > 0 && /^\s*$/.test(splitted[iterator])) { iterator++; } - var maxMessageLength = 100; + var maxMessageLength = 50; if (splitted[iterator].length > maxMessageLength) return splitted[iterator].substring(0,maxMessageLength)+'...'; //$NON-NLS-0$ return splitted[iterator]; } diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitBranchList.js b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitBranchList.js index b35e7c2..1c0fdc2 100644 --- a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitBranchList.js +++ b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitBranchList.js @@ -16,9 +16,10 @@ define([ 'orion/explorers/explorer',
'orion/URITemplate',
'orion/i18nUtil',
+ 'orion/selection',
'orion/Deferred',
'orion/objects'
-], function(messages, mExplorer, URITemplate, i18nUtil, Deferred, objects) {
+], function(messages, mExplorer, URITemplate, i18nUtil, Selection, Deferred, objects) {
var repoTemplate = new URITemplate("git/git-repository.html#{,resource,params*}"); //$NON-NLS-0$
@@ -45,7 +46,7 @@ define([ var repository = parentItem.repository || parentItem.parent.repository;
msg = i18nUtil.formatMessage(messages["Getting remote branches"], repository.Name);
progress.begin(msg);
- Deferred.when(repository.Branches || this.progressService.progress(this.gitClient.getGitBranch(repository.BranchLocation + (parentItem.mode === "full" ? "?commits=1" : "?commits=1&page=1&pageSize=5")), msg), function(resp) { //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ Deferred.when(repository.Branches || this.progressService.progress(this.gitClient.getGitBranch(repository.BranchLocation + (parentItem.mode === "full" ? "?commits=1&page=1&pageSize=5" : "?commits=1&page=1&pageSize=5")), msg), function(resp) { //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
progress.done();
onComplete(that.processChildren(parentItem, resp.Children || resp));
}, function(error){
@@ -103,8 +104,10 @@ define([ * @extends orion.explorers.Explorer
*/
function GitBranchListExplorer(options) {
- var renderer = new GitBranchListRenderer({registry: options.serviceRegistry, commandService: options.commandRegistry, actionScopeId: options.actionScopeId, cachePrefix: options.prefix + "Navigator", checkbox: false}, this); //$NON-NLS-0$
- mExplorer.Explorer.call(this, options.serviceRegistry, options.selection, renderer, options.commandRegistry);
+
+ this.selection = options.selection = new Selection.Selection(options.serviceRegistry, "branchesSelection"); //$NON-NLS-0$
+ var renderer = new GitBranchListRenderer({registry: options.serviceRegistry, selectionPolicy: null, singleSelection: true, commandService: options.commandRegistry, actionScopeId: options.actionScopeId, cachePrefix: options.prefix + "Navigator", checkbox: false}, this); //$NON-NLS-0$
+ mExplorer.Explorer.call(this, options.serviceRegistry, this.selection, renderer, options.commandRegistry);
this.checkbox = false;
this.parentId = options.parentId;
this.actionScopeId = options.actionScopeId;
@@ -121,7 +124,7 @@ define([ this.updateCommands();
},
isRowSelectable: function(modelItem) {
- return false;
+ return true;
},
// getItemCount: function() {
// return this.branches.length;
@@ -159,19 +162,21 @@ define([ var horizontalBox = document.createElement("div"); //$NON-NLS-0$
horizontalBox.style.overflow = "hidden"; //$NON-NLS-0$
div.appendChild(horizontalBox);
- var actionsID, title, description, titleClass = "";
+ var actionsID, title, description, description2, titleClass = "";
if (item.parent.Type === "LocalRoot") { //$NON-NLS-0$
var branch = item;
if (branch.Current){
- var span = document.createElement("span"); //$NON-NLS-0$
- span.className = "sectionIcon gitImageSprite git-sprite-branch-active"; //$NON-NLS-0$
- horizontalBox.appendChild(span);
+// var span = document.createElement("span"); //$NON-NLS-0$
+// span.className = "sectionIcon gitImageSprite git-sprite-branch-active"; //$NON-NLS-0$
+// horizontalBox.appendChild(span);
titleClass = "activeBranch"; //$NON-NLS-0$
+ title = item.Name + " (ACTIVE)";
}
var commit = branch.Commit.Children[0];
var tracksMessage = ((branch.RemoteLocation.length && branch.RemoteLocation.length === 1 && branch.RemoteLocation[0].Children.length && branch.RemoteLocation[0].Children.length === 1) ?
i18nUtil.formatMessage(messages["tracks ${0}, "], branch.RemoteLocation[0].Children[0].Name) : messages["tracks no branch, "]);
- description = tracksMessage + i18nUtil.formatMessage(messages["last modified ${0} by ${1}"], new Date(commit.Time).toLocaleString(), commit.AuthorName); //$NON-NLS-0$
+ description = tracksMessage;
+ description2 = i18nUtil.formatMessage(messages["last modified ${0} by ${1}"], new Date(commit.Time).toLocaleString(), commit.AuthorName); //$NON-NLS-0$
actionsID = "branchActionsArea"; //$NON-NLS-0$
} else if (item.parent.Type === "RemoteRoot") { //$NON-NLS-0$
var expandContainer = document.createElement("div"); //$NON-NLS-0$
@@ -201,6 +206,12 @@ define([ descriptionDiv.textContent = description;
}
detailsView.appendChild(descriptionDiv);
+
+ var descriptionDiv2 = document.createElement("div"); //$NON-NLS-0$
+ if (description2) {
+ descriptionDiv2.textContent = description2;
+ }
+ detailsView.appendChild(descriptionDiv2);
var actionsArea = document.createElement("div"); //$NON-NLS-0$
actionsArea.className = "sectionTableItemActions"; //$NON-NLS-0$
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitCommitList.js b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitCommitList.js index 9b0eefd..a9b2974 100644 --- a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitCommitList.js +++ b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitCommitList.js @@ -157,7 +157,7 @@ define([ Deferred.when(parentItem.repository || that._getRepository(), function(repository) {
var currentBranchMsg = i18nUtil.formatMessage(messages['GettingCurrentBranch'], repository.Name);
progress.worked(currentBranchMsg);
- Deferred.when(repository.Branches || that.progressService.progress(that.gitClient.getGitBranch(repository.BranchLocation + "?commits=1"), currentBranchMsg), function(resp) { //$NON-NLS-0$
+ Deferred.when(repository.Branches || that.progressService.progress(that.gitClient.getGitBranch(repository.BranchLocation + "?commits=1&page=1&pageSize=5"), currentBranchMsg), function(resp) { //$NON-NLS-0$
var currentBranch, branches = resp.Children || resp;
branches.some(function(branch) {
if (branch.Current) {
@@ -592,7 +592,7 @@ define([ detailsView.appendChild(d);
description = document.createElement("div"); //$NON-NLS-0$
- description.textContent = messages[" (SHA "] + commit.Name + messages[") by "] + commit.AuthorName + messages[" on "]
+ description.textContent = /*messages[" (SHA "] + commit.Name + messages[") by "] +*/ commit.AuthorName + messages[" on "]
+ new Date(commit.Time).toLocaleString();
detailsView.appendChild(description);
@@ -617,7 +617,7 @@ define([ else {
var tagsNone = document.createElement("span"); //$NON-NLS-0$
tagsNone.textContent = messages["None"];
- tags.className = "gitCommitListNoTag"; //$NON-NLS-0$
+ tagsNone.className = "gitCommitListNoTag"; //$NON-NLS-0$
tags.appendChild(tagsNone);
}
detailsView.appendChild(tags);
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitConfigList.js b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitConfigList.js index 2cf2452..12798f3 100644 --- a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitConfigList.js +++ b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitConfigList.js @@ -129,6 +129,8 @@ define([ div.style.overflow = "hidden"; //$NON-NLS-0$
// div.className = "sectionTableItem"; //$NON-NLS-0$
td.appendChild(div);
+ td.style.maxWidth = "150px";
+ td.style.wordWrap = "break-word";
switch (col_no) {
case 0:
var keySpan = document.createElement("span"); //$NON-NLS-0$
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitRepoList.js b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitRepoList.js index 415a830..82b04bb 100644 --- a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitRepoList.js +++ b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitRepoList.js @@ -235,48 +235,48 @@ define([ }
// Content area
- var repoSectionContent = document.createElement("div");
- repoSectionContent.className = "sectionTable sectionTableItem";
- lib.node("repositoryNode").appendChild(repoSectionContent);
-
- var detailsView = document.createElement("div");
- detailsView.className = "stretch";
- repoSectionContent.appendChild(detailsView);
-
- var div = document.createElement("div");
- detailsView.appendChild(div);
-
- var span = document.createElement("span");
- span.textContent = (repositories[i].GitUrl !== null ? messages["git url:"] + repositories[i].GitUrl : messages["(no remote)"]);
- detailsView.appendChild(span);
-
- div = document.createElement("div");
- detailsView.appendChild(div);
-
- span = document.createElement("span");
- span.id = "location"+i;
- detailsView.appendChild(span);
-
- if (mode === "full"){
- div = document.createElement("div");
- div.style.paddingTop = "10px";
- detailsView.appendChild(div);
-
- span = document.createElement("span");
- span.id = "repositoryState"+i;
- span.style.paddingLeft = "10px";
- detailsView.appendChild(span);
-
- span = document.createElement("span");
- span.id = "workspaceState"+i;
- span.style.paddingLeft = "10px";
- detailsView.appendChild(span);
-
- span = document.createElement("span");
- span.id = "commitsState"+i;
- span.style.paddingLeft = "10px";
- detailsView.appendChild(span);
- }
+// var repoSectionContent = document.createElement("div");
+// repoSectionContent.className = "sectionTable sectionTableItem";
+// lib.node("repositoryNode").appendChild(repoSectionContent);
+//
+// var detailsView = document.createElement("div");
+// detailsView.className = "stretch";
+// repoSectionContent.appendChild(detailsView);
+//
+// var div = document.createElement("div");
+// detailsView.appendChild(div);
+//
+// var span = document.createElement("span");
+// span.textContent = (repositories[i].GitUrl !== null ? messages["git url:"] + repositories[i].GitUrl : messages["(no remote)"]);
+// detailsView.appendChild(span);
+//
+// div = document.createElement("div");
+// detailsView.appendChild(div);
+//
+// span = document.createElement("span");
+// span.id = "location"+i;
+// detailsView.appendChild(span);
+//
+// if (mode === "full"){
+// div = document.createElement("div");
+// div.style.paddingTop = "10px";
+// detailsView.appendChild(div);
+//
+// span = document.createElement("span");
+// span.id = "repositoryState"+i;
+// span.style.paddingLeft = "10px";
+// detailsView.appendChild(span);
+//
+// span = document.createElement("span");
+// span.id = "workspaceState"+i;
+// span.style.paddingLeft = "10px";
+// detailsView.appendChild(span);
+//
+// span = document.createElement("span");
+// span.id = "commitsState"+i;
+// span.style.paddingLeft = "10px";
+// detailsView.appendChild(span);
+// }
},
renderAfterItemPopulation : function(i){
|