summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMalgorzata Janczarska2011-05-26 08:32:09 (EDT)
committer Malgorzata Janczarska2011-05-26 08:32:09 (EDT)
commit445a83189f54f33f85f971b90a389dbc2ba35edb (patch)
tree7d7375d1803c24c40a4ed9a41f50b0a71cff59de
parenta7cc4b8d086ebec153fcdb377bc148007d72c469 (diff)
downloadorg.eclipse.orion.client-445a83189f54f33f85f971b90a389dbc2ba35edb.zip
org.eclipse.orion.client-445a83189f54f33f85f971b90a389dbc2ba35edb.tar.gz
org.eclipse.orion.client-445a83189f54f33f85f971b90a389dbc2ba35edb.tar.bz2
Bug 346975 - [client] Use dojo dialogs instead prompts
-rw-r--r--bundles/org.eclipse.orion.client.git/static/git-log.html1
-rw-r--r--bundles/org.eclipse.orion.client.git/static/js/git-commit-details.js2
-rw-r--r--bundles/org.eclipse.orion.client.git/static/js/git-commit-navigator.js3
-rw-r--r--bundles/org.eclipse.orion.client.git/static/js/gitCommands.js37
4 files changed, 28 insertions, 15 deletions
diff --git a/bundles/org.eclipse.orion.client.git/static/git-log.html b/bundles/org.eclipse.orion.client.git/static/git-log.html
index 3772e52..349391a 100644
--- a/bundles/org.eclipse.orion.client.git/static/git-log.html
+++ b/bundles/org.eclipse.orion.client.git/static/git-log.html
@@ -27,6 +27,7 @@
dojo.require("dijit.form.CheckBox");
dojo.require("widgets.OpenResourceDialog");
dojo.require("widgets.eWebBorderContainer");
+ dojo.require("widgets.NewItemDialog");
</script>
<script type="text/javascript" src="/openajax/release/all/OpenAjaxManagedHub-all.js"></script>
diff --git a/bundles/org.eclipse.orion.client.git/static/js/git-commit-details.js b/bundles/org.eclipse.orion.client.git/static/js/git-commit-details.js
index 0f2fc8f..037be9a 100644
--- a/bundles/org.eclipse.orion.client.git/static/js/git-commit-details.js
+++ b/bundles/org.eclipse.orion.client.git/static/js/git-commit-details.js
@@ -39,7 +39,7 @@ eclipse.CommitDetails = (function() {
image: "images/compare-sbs.gif",
id: "eclipse.showDiff",
hrefCallback: function(item) {
- return "/compare/compare.html?readonly#" + item.object.DiffLocation;
+ return "/compare/compare.html?readonly#" + item.DiffLocation;
},
visibleWhen: function(item) {
return item.dom == "commitDiffsTable";
diff --git a/bundles/org.eclipse.orion.client.git/static/js/git-commit-navigator.js b/bundles/org.eclipse.orion.client.git/static/js/git-commit-navigator.js
index a0fee22..4cc4a82 100644
--- a/bundles/org.eclipse.orion.client.git/static/js/git-commit-navigator.js
+++ b/bundles/org.eclipse.orion.client.git/static/js/git-commit-navigator.js
@@ -169,7 +169,8 @@ eclipse.GitCommitRenderer = (function() {
return dojo.create("td", {style: "padding-left: 5px; padding-right: 5px", innerHTML: dojo.date.locale.format(new Date(item.Time), {formatLength: "short"})});
break;
case 3:
- var actionsColumn = this.getActionsColumn({dom: "explorer-tree", object: item}, tableRow);
+ item.dom = "explorer-tree";
+ var actionsColumn = this.getActionsColumn(item, tableRow);
dojo.style(actionsColumn, "padding-left", "5px");
dojo.style(actionsColumn, "padding-right", "5px");
return actionsColumn;
diff --git a/bundles/org.eclipse.orion.client.git/static/js/gitCommands.js b/bundles/org.eclipse.orion.client.git/static/js/gitCommands.js
index bd5e418..360f188 100644
--- a/bundles/org.eclipse.orion.client.git/static/js/gitCommands.js
+++ b/bundles/org.eclipse.orion.client.git/static/js/gitCommands.js
@@ -392,7 +392,7 @@ dojo.require("widgets.GitCredentialsDialog");
image : "/images/compare-sbs.gif",
id : "eclipse.compareWithWorkingTree",
hrefCallback : function(item) {
- return "/compare/compare.html#" + item.object.DiffLocation;
+ return "/compare/compare.html#" + item.DiffLocation;
},
visibleWhen : function(item) {
// show only for commits in the git log list
@@ -407,11 +407,11 @@ dojo.require("widgets.GitCredentialsDialog");
image : "/images/find.gif",
id : "eclipse.openGitCommit",
hrefCallback: function(item) {
- return "/edit/edit.html#" + item.object.ContentLocation;
+ return "/edit/edit.html#" + item.ContentLocation;
},
visibleWhen : function(item) {
// show only for commits in the git log list
- return item.dom === "explorer-tree" && item.object.ContentLocation != null && !explorer.isDirectory;
+ return item.dom === "explorer-tree" && item.ContentLocation != null && !explorer.isDirectory;
}
});
@@ -566,17 +566,28 @@ dojo.require("widgets.GitCredentialsDialog");
id : "eclipse.orion.git.addTag",
callback : function(item) {
var clientDeferred = new dojo.Deferred();
- var tagName = prompt("Enter tage name");
- serviceRegistry.getService("orion.git.provider").then(
- function(service) {
- service.doAddTag(item.object.Location, tagName,
- function(jsonData, secondArg) {
- var trId = jsonData.Location.replace(/[^\.\:\-\_0-9A-Za-z]/g, "");
- var tr = dojo.byId(trId);
- dojo.place(document.createTextNode(tagName), dojo.create("p", {style: "margin: 5px"}, tr.children[2] /* tags column */, "last"), "only");
+
+ var dialog = new widgets.NewItemDialog({
+ title: "Tag",
+ label: "Tag name:",
+ func: function(tagName){
+ serviceRegistry.getService("orion.git.provider").then(
+ function(service) {
+ service.doAddTag(item.Location, tagName,
+ function(jsonData, secondArg) {
+ var trId = jsonData.Location.replace(/[^\.\:\-\_0-9A-Za-z]/g, "");
+ var tr = dojo.byId(trId);
+ dojo.place(document.createTextNode(tagName), dojo.create("p", {style: "margin: 5px"}, tr.children[5] /* tags column */, "last"), "only");
+ });
});
- });
- return clientDeferred;
+ return clientDeferred;
+ },
+ advanced: false
+ });
+ dialog.startup();
+ dialog.show();
+
+
},
visibleWhen : function(item) {
// show only for commits in the git log list