summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorGabriel Luong2013-06-11 00:43:15 (EDT)
committer Mark Macdonald2013-06-12 17:22:27 (EDT)
commitde02e6e47a3ca91d57d8b3ed7db55ab92d8d1f5d (patch)
treece3d1770d68a939d250eb23438a2ab0a21d948c4
parent987078de6aabc6aeb17d8ba53ccc85fb892b779c (diff)
downloadorg.eclipse.orion.client-de02e6e47a3ca91d57d8b3ed7db55ab92d8d1f5d.zip
org.eclipse.orion.client-de02e6e47a3ca91d57d8b3ed7db55ab92d8d1f5d.tar.gz
org.eclipse.orion.client-de02e6e47a3ca91d57d8b3ed7db55ab92d8d1f5d.tar.bz2
Refactor commit tooltip dialogv20130612-2122
-rw-r--r--bundles/org.eclipse.orion.client.git/web/orion/git/widgets/CommitTooltipDialog.js107
-rw-r--r--bundles/org.eclipse.orion.client.git/web/orion/git/widgets/OpenCommitDialog.js65
2 files changed, 64 insertions, 108 deletions
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/CommitTooltipDialog.js b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/CommitTooltipDialog.js
index e8b3d7a..45e4ab1 100644
--- a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/CommitTooltipDialog.js
+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/CommitTooltipDialog.js
@@ -20,13 +20,13 @@ define([ 'i18n!git/nls/gitmessages', 'require', 'orion/webui/littlelib', 'orion/
CommitTooltipDialog.prototype = new popupdialog.PopupDialog();
- CommitTooltipDialog.prototype.TEMPLATE = '<div id="parentPane" style="padding:10px; width:520px"></div>';
+ CommitTooltipDialog.prototype.TEMPLATE = '<div id="parentPane" style="padding:10px; width:520px"></div>'; //$NON-NLS-0$
CommitTooltipDialog.prototype._init = function(options) {
this.commit = options.commit;
// Start the dialog initialization.
- this._initialize(options.triggerNode, null, null, "mouseover", 1000);
+ this._initialize(options.triggerNode, null, null, "mouseover", 1000); //$NON-NLS-0$
};
CommitTooltipDialog.prototype._bindToDom = function(parent) {
@@ -37,64 +37,45 @@ define([ 'i18n!git/nls/gitmessages', 'require', 'orion/webui/littlelib', 'orion/
var tableNode = this.$parentPane;
var commitMessage0 = commit.Message.split(/(\r?\n|$)/)[0];
- var link = document.createElement("a");
- link.className = "navlinkonpage";
- link.href = require.toUrl("git/git-commit.html#") + commit.Location + "?page=1&pageSize=1";
+ var link = document.createElement("a"); //$NON-NLS-0$
+ link.className = "navlinkonpage"; //$NON-NLS-0$
+ link.href = require.toUrl("git/git-commit.html#") + commit.Location + "?page=1&pageSize=1"; //$NON-NLS-1$ //$NON-NLS-0$
link.textContent = commitMessage0;
tableNode.appendChild(link);
- var div = document.createElement("div");
- div.style.paddingTop = "15px";
- tableNode.appendChild(div);
-
- var imageDiv = document.createElement("div");
- tableNode.appendChild(imageDiv);
-
- var textDiv = document.createElement("div");
+ var textDiv = document.createElement("div"); //$NON-NLS-0$
+ textDiv.style.paddingTop = "15px"; //$NON-NLS-0$
tableNode.appendChild(textDiv);
-
+
if (commit.AuthorImage) {
- var authorImage = document.createElement("div");
- authorImage.style['float'] = "left";
var image = new Image();
image.src = commit.AuthorImage;
image.name = commit.AuthorName;
- image.className = "git-author-icon";
- authorImage.appendChild(image);
- imageDiv.appendChild(authorImage);
+ image.className = "git-author-icon"; //$NON-NLS-0$
+ textDiv.appendChild(image);
}
-
- var authoredBySpan = document.createElement("span");
- authoredBySpan.textContent = i18nUtil.formatMessage(messages[" authored by ${0} {${1}) on ${2}"], //$NON-NLS-0$
- commit.AuthorName, commit.AuthorEmail, new Date(commit.Time).toLocaleString());
- textDiv.appendChild(authoredBySpan);
-
- var div = document.createElement("div");
- textDiv.appendChild(div);
- var committedBySpan = document.createElement("span");
- committedBySpan.textContent = i18nUtil.formatMessage(messages['committed by 0 (1)'], commit.CommitterName, commit.CommitterEmail);
- textDiv.appendChild(committedBySpan);
-
- var div = document.createElement("div");
- div.style.paddingTop = "15px";
- textDiv.appendChild(div);
+ var authoredByDiv = document.createElement("div"); //$NON-NLS-0$
+ authoredByDiv.textContent = i18nUtil.formatMessage(messages[" authored by ${0} {${1}) on ${2}"], //$NON-NLS-0$
+ commit.AuthorName, commit.AuthorEmail, new Date(commit.Time).toLocaleString());
+ textDiv.appendChild(authoredByDiv);
- var commitNameSpan = document.createElement("span");
- commitNameSpan.textContent = messages["commit:"] + commit.Name;
- textDiv.appendChild(commitNameSpan);
+ var committedByDiv = document.createElement("div"); //$NON-NLS-0$
+ committedByDiv.textContent = i18nUtil.formatMessage(messages['committed by 0 (1)'], commit.CommitterName, commit.CommitterEmail); //$NON-NLS-0$
+ textDiv.appendChild(committedByDiv);
+ var commitNameDiv = document.createElement("div"); //$NON-NLS-0$
+ commitNameDiv.style.paddingTop = "15px"; //$NON-NLS-0$
+ commitNameDiv.textContent = messages["commit:"] + commit.Name; //$NON-NLS-0$
+ textDiv.appendChild(commitNameDiv);
if (commit.Parents && commit.Parents.length > 0) {
- var div = document.createElement("div");
- textDiv.appendChild(div);
-
- var parentNode = document.createElement("span");
- parentNode.textContent = messages["parent:"];
+ var parentNode = document.createElement("div"); //$NON-NLS-0$
+ parentNode.textContent = messages["parent:"]; //$NON-NLS-0$
var parentLink = document.createElement("a");
- parentLink.className = "navlinkonpage";
- parentLink.href = require.toUrl("git/git-commit.html#") + commit.Parents[0].Location + "?page=1&pageSize=1";
+ parentLink.className = "navlinkonpage"; //$NON-NLS-0$
+ parentLink.href = require.toUrl("git/git-commit.html#") + commit.Parents[0].Location + "?page=1&pageSize=1"; //$NON-NLS-1$ //$NON-NLS-0$
parentLink.textContent = commit.Parents[0].Name;
parentNode.appendChild(parentLink);
@@ -105,46 +86,40 @@ define([ 'i18n!git/nls/gitmessages', 'require', 'orion/webui/littlelib', 'orion/
var displayTags = commit.Tags && commit.Tags.length > 0;
if (displayBranches) {
- var div = document.createElement("div");
- div.style.paddingTop = "15px";
- textDiv.appendChild(div);
-
- var branchesSection = document.createElement("section");
+ var branchesSection = document.createElement("section"); //$NON-NLS-0$
+ branchesSection.style.paddingTop = "15px"; //$NON-NLS-0$
+ branchesSection.textContent = messages["branches: "]; //$NON-NLS-0$
textDiv.appendChild(branchesSection);
- var branchesNode = document.createElement("span");
- branchesNode.textContent = messages["branches: "];
- branchesSection.appendChild(branchesNode);
-
- var branchesList = document.createElement("div");
+ var branchesList = document.createElement("div"); //$NON-NLS-0$
branchesSection.appendChild(branchesList);
- for ( var i = 0; i < commit.Branches.length; ++i) {
- var branchNameSpan = document.createElement("span");
- branchNameSpan.style.paddingLeft = "10px";
+ for (var i = 0; i < commit.Branches.length; ++i) {
+ var branchNameSpan = document.createElement("span"); //$NON-NLS-0$
+ branchNameSpan.style.paddingLeft = "10px"; //$NON-NLS-0$
branchNameSpan.textContent = commit.Branches[i].FullName;
branchesList.appendChild(branchNameSpan);
}
}
if (displayTags) {
- var div = document.createElement("div");
- div.style.paddingTop = "15px";
+ var div = document.createElement("div"); //$NON-NLS-0$
+ div.style.paddingTop = "15px"; //$NON-NLS-0$
textDiv.appendChild(div);
- var tagsSection = document.createElement("section");
+ var tagsSection = document.createElement("section"); //$NON-NLS-0$
textDiv.appendChild(tagsSection);
- var tagsNode = document.createElement("span");
- tagsNode.textContent = messages["tags: "];
+ var tagsNode = document.createElement("span"); //$NON-NLS-0$
+ tagsNode.textContent = messages["tags: "]; //$NON-NLS-0$
tagsSection.appendChild(tagsNode);
- var tagsList = document.createElement("div");
+ var tagsList = document.createElement("div"); //$NON-NLS-0$
tagsSection.appendChild(tagsList);
- for ( var i = 0; i < commit.Tags.length; ++i) {
- var tagNameSpan = document.createElement("span");
- tagNameSpan.style.paddingLeft = "10px";
+ for (var i = 0; i < commit.Tags.length; ++i) {
+ var tagNameSpan = document.createElement("span"); //$NON-NLS-0$
+ tagNameSpan.style.paddingLeft = "10px"; //$NON-NLS-0$
tagNameSpan.textContent = commit.Tags[i].Name;
tagsList.appendChild(tagNameSpan);
}
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/OpenCommitDialog.js b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/OpenCommitDialog.js
index fcaa916..45aed68 100644
--- a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/OpenCommitDialog.js
+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/OpenCommitDialog.js
@@ -159,15 +159,15 @@ define(['require', 'i18n!git/nls/gitmessages', 'orion/i18nUtil', 'orion/Deferred
var that = this;
var tableNode = document.createElement("div"); //$NON-NLS-0$
- tableNode.style.padding = "10px";
- tableNode.style.maxWidth = "480px";
+ tableNode.style.padding = "10px"; //$NON-NLS-0$
+ tableNode.style.maxWidth = "480px"; //$NON-NLS-0$
lib.empty(parentNode);
parentNode.appendChild(tableNode);
var commitMessage0 = commit.Message.split(/(\r?\n|$)/)[0];
var link = document.createElement("a");
- link.className = "navlinkonpage";
- link.href = require.toUrl("git/git-commit.html#") + commit.Location + "?page=1&pageSize=1";
+ link.className = "navlinkonpage"; //$NON-NLS-0$
+ link.href = require.toUrl("git/git-commit.html#") + commit.Location + "?page=1&pageSize=1"; //$NON-NLS-1$ //$NON-NLS-0$
link.textContent = commitMessage0;
tableNode.appendChild(link);
@@ -183,57 +183,38 @@ define(['require', 'i18n!git/nls/gitmessages', 'orion/i18nUtil', 'orion/Deferred
}
}, false);
- var div = document.createElement("div");
- div.style.paddingTop = "15px";
- tableNode.appendChild(div);
-
- var imageDiv = document.createElement("div");
- tableNode.appendChild(imageDiv);
-
- var textDiv = document.createElement("div");
+ var textDiv = document.createElement("div"); //$NON-NLS-0$
+ textDiv.style.paddingTop = "15px"; //$NON-NLS-0$
tableNode.appendChild(textDiv);
-
+
if (commit.AuthorImage) {
- var authorImage = document.createElement("div");
- authorImage.style['float'] = "left";
var image = new Image();
image.src = commit.AuthorImage;
image.name = commit.AuthorName;
- image.className = "git-author-icon";
- authorImage.appendChild(image);
- imageDiv.appendChild(authorImage);
+ image.className = "git-author-icon"; //$NON-NLS-0$
+ textDiv.appendChild(image);
}
-
- var authoredBySpan = document.createElement("span");
- authoredBySpan.textContent = i18nUtil.formatMessage(messages[" authored by ${0} {${1}) on ${2}"], //$NON-NLS-0$
- commit.AuthorName, commit.AuthorEmail, new Date(commit.Time).toLocaleString());
- textDiv.appendChild(authoredBySpan);
- var div = document.createElement("div");
- textDiv.appendChild(div);
-
- var committedBySpan = document.createElement("span");
- committedBySpan.textContent = i18nUtil.formatMessage(messages['committed by 0 (1)'], commit.CommitterName, commit.CommitterEmail);
- textDiv.appendChild(committedBySpan);
-
- var div = document.createElement("div");
- div.style.paddingTop = "15px";
- textDiv.appendChild(div);
+ var authoredByDiv = document.createElement("div"); //$NON-NLS-0$
+ authoredByDiv.textContent = i18nUtil.formatMessage(messages[" authored by ${0} {${1}) on ${2}"], //$NON-NLS-0$
+ commit.AuthorName, commit.AuthorEmail, new Date(commit.Time).toLocaleString());
+ textDiv.appendChild(authoredByDiv);
- var commitNameSpan = document.createElement("span");
- commitNameSpan.textContent = messages["commit:"] + commit.Name;
- textDiv.appendChild(commitNameSpan);
+ var committedByDiv = document.createElement("div"); //$NON-NLS-0$
+ committedByDiv.textContent = i18nUtil.formatMessage(messages['committed by 0 (1)'], commit.CommitterName, commit.CommitterEmail); //$NON-NLS-0$
+ textDiv.appendChild(committedByDiv);
+ var commitNameDiv = document.createElement("div"); //$NON-NLS-0$
+ commitNameDiv.style.paddingTop = "15px"; //$NON-NLS-0$
+ commitNameDiv.textContent = messages["commit:"] + commit.Name; //$NON-NLS-0$
+ textDiv.appendChild(commitNameDiv);
if (commit.Parents && commit.Parents.length > 0) {
- var div = document.createElement("div");
- textDiv.appendChild(div);
-
- var parentNode = document.createElement("span");
- parentNode.textContent = messages["parent:"];
+ var parentNode = document.createElement("div"); //$NON-NLS-0$
+ parentNode.textContent = messages["parent:"]; //$NON-NLS-0$
var parentLink = document.createElement("a");
- parentLink.className = "navlinkonpage";
+ parentLink.className = "navlinkonpage"; //$NON-NLS-0$
parentLink.href = require.toUrl("git/git-commit.html#") + commit.Parents[0].Location + "?page=1&pageSize=1";
parentLink.textContent = commit.Parents[0].Name;
parentNode.appendChild(parentLink);