summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorEdyta Przymus2012-04-26 11:36:47 (EDT)
committer Szymon Brandys2012-04-27 03:23:14 (EDT)
commit6d177d3765ee320f250e67c875328d32a8252f79 (patch)
treeaf9a4b3e1e7cc887bef3fb01d23da1c22c568b09
parent56294c08b84f666dc9b2ff7a7702f2276bc9593e (diff)
downloadorg.eclipse.orion.client-6d177d3765ee320f250e67c875328d32a8252f79.zip
org.eclipse.orion.client-6d177d3765ee320f250e67c875328d32a8252f79.tar.gz
org.eclipse.orion.client-6d177d3765ee320f250e67c875328d32a8252f79.tar.bz2
bug 368848 - Accessing page sections using a sidebar (initial work)v20120427-0723
-rw-r--r--bundles/org.eclipse.orion.client.core/web/orion/section.js2
-rw-r--r--bundles/org.eclipse.orion.client.git/web/git/git-repository.js1
-rw-r--r--bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js26
-rw-r--r--bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js7
-rw-r--r--bundles/org.eclipse.orion.client.git/web/orion/git/widgets/ContentDialog.js51
-rw-r--r--bundles/org.eclipse.orion.client.git/web/orion/git/widgets/templates/ContentDialog.html23
6 files changed, 103 insertions, 7 deletions
diff --git a/bundles/org.eclipse.orion.client.core/web/orion/section.js b/bundles/org.eclipse.orion.client.core/web/orion/section.js
index 52a567d..78bd9c7 100644
--- a/bundles/org.eclipse.orion.client.core/web/orion/section.js
+++ b/bundles/org.eclipse.orion.client.core/web/orion/section.js
@@ -33,7 +33,7 @@ define(['dojo', 'orion/selection'], function(dojo, mSelection){
var icon = dojo.create( "span", { "class":"sectionIcon" }, this.domNode );
dojo.addClass(icon, options.iconClass);
}
- this.titleNode = dojo.create( "div", { id: options.id + "Title", "class":"layoutLeft", innerHTML: options.title }, this.domNode );
+ this.titleNode = dojo.create( "div", { id: options.id + "Title", "class":"sectionAnchor layoutLeft", innerHTML: options.title }, this.domNode );
this.progressNode = dojo.create( "div", { id: options.id + "Progress", "class": "sectionProgress layoutLeft", innerHTML: "..."}, this.domNode );
this.actionsNode = dojo.create( "div", { id: options.id + "ActionsArea", "class":"layoutRight sectionActions"}, this.domNode );
if(options.slideout){
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 5da8840..c3372cc 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
@@ -64,6 +64,7 @@ mBootstrap.startup().then(function(core) {
commandService.registerCommandContribution("itemLevelCommands", "eclipse.removeTag", 1000);
commandService.registerCommandContribution("itemLevelCommands", "eclipse.checkoutBranch", 200);
commandService.registerCommandContribution("itemLevelCommands", "eclipse.orion.git.applyPatch", 300);
+ commandService.registerCommandContribution("itemLevelCommands", "eclipse.orion.git.showContent", 300, null,true,new mCommands.CommandKeyBinding('e', true, true));
commandService.registerCommandContribution("itemLevelCommands", "eclipse.git.deleteClone", 1000);
commandService.registerCommandContribution("itemLevelCommands", "eclipse.orion.git.fetch", 500);
commandService.registerCommandContribution("itemLevelCommands", "eclipse.orion.git.merge", 600);
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js b/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js
index 22ba523..441b720 100644
--- a/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js
+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js
@@ -13,7 +13,7 @@
/*browser:true*/
define(['require', 'dojo', 'orion/commands', 'orion/util', 'orion/git/util', 'orion/git/widgets/CloneGitRepositoryDialog',
'orion/git/widgets/AddRemoteDialog', 'orion/git/widgets/GitCredentialsDialog', 'orion/widgets/NewItemDialog',
- 'orion/git/widgets/RemotePrompterDialog', 'orion/git/widgets/ApplyPatchDialog', 'orion/git/widgets/OpenCommitDialog'],
+ 'orion/git/widgets/RemotePrompterDialog', 'orion/git/widgets/ApplyPatchDialog', 'orion/git/widgets/OpenCommitDialog', 'orion/git/widgets/ContentDialog'],
function(require, dojo, mCommands, mUtil, mGitUtil) {
/**
@@ -2139,6 +2139,28 @@ var exports = {};
});
commandService.addCommand(applyPatchCommand);
+ var showContentCommand = new mCommands.Command({
+ name : "Show content",
+ tooltip: "Apply a patch on the selected repository",
+ id : "eclipse.orion.git.showContent",
+ imageClass: "git-sprite-apply_patch",
+ spriteClass: "gitCommandSprite",
+ callback: function(data) {
+ var item = forceSingleItem(data.items);
+ var dialog = new orion.git.widgets.ContentDialog({
+ title: "Content",
+ diffLocation: item.DiffLocation
+ });
+ dialog.startup();
+ dialog.show();
+
+ },
+ //visibleWhen : function(item) {
+ //return item.Type === "Clone" ;
+ //}
+ });
+ commandService.addCommand(showContentCommand);
+
var openCommitParameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("commitName", "text", "Commit name:")], {hasOptionalParameters: true});
var openCommitCommand = new mCommands.Command({
@@ -2433,4 +2455,4 @@ var exports = {};
}());
return exports;
-}); \ No newline at end of file
+});
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 080a63b..fca681a 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
@@ -371,7 +371,6 @@ exports.GitRepositoryExplorer = (function() {
var tableNode = dojo.byId( 'table' );
-
var titleWrapper = new mSection.Section(tableNode, {
explorer: this,
id: "workingDirectorySection",
@@ -452,7 +451,7 @@ exports.GitRepositoryExplorer = (function() {
slideout: true,
content: '<list id="branchNode" class="plugin-settings-list"></list>',
commandService: this.commandService
- });
+ });
var progress = titleWrapper.createProgressMonitor();
progress.begin("Getting branches");
@@ -924,7 +923,7 @@ exports.GitRepositoryExplorer = (function() {
slideout: true,
content: '<list id="remoteNode" class="plugin-settings-list"></list>',
commandService: this.commandService
- });
+ });
var progress = titleWrapper.createProgressMonitor();
progress.begin("Getting remotes");
@@ -987,7 +986,7 @@ exports.GitRepositoryExplorer = (function() {
slideout: true,
content: '<list id="configNode" class="plugin-settings-list"></list>',
commandService: this.commandService
- });
+ });
var progress = titleWrapper.createProgressMonitor();
progress.begin("Getting confituration");
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/ContentDialog.js b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/ContentDialog.js
new file mode 100644
index 0000000..d6acef3
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/ContentDialog.js
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * @license
+ * Copyright (c) 2011, 2012 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0
+ * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
+ * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+/*global dojo dijit dojox widgets*/
+/*jslint browser:true */
+
+define(['dojo', 'dijit', 'dojox', 'dijit/Dialog', 'dojo/data/ItemFileReadStore', 'dojox/form/Uploader', 'dojox/form/uploader/FileList', 'dojox/form/uploader/plugins/IFrame', 'dijit/form/Button','dijit/ProgressBar', 'orion/widgets/_OrionDialogMixin', 'text!orion/git/widgets/templates/ApplyPatchDialog.html'], function(dojo, dijit, dojox) {
+
+/**
+ */
+dojo.declare("orion.git.widgets.ContentDialog", [ dijit.Dialog, orion.widgets._OrionDialogMixin ], {
+ widgetsInTemplate : true,
+ templateString : dojo.cache('orion', 'git/widgets/templates/ContentDialog.html'),
+
+ constructor : function() {
+ this.inherited(arguments);
+ this.options = arguments[0] || {};
+ },
+ postMixInProperties : function() {
+ this.inherited(arguments);
+ this.title = "Content";
+ },
+
+ postCreate : function() {
+ var that = this;
+ this.inherited(arguments);
+ var sectionsDiv = dojo.byId("div1");
+ var sections = dojo.query(".sectionAnchor");
+ var currentSection;
+ for (var i=0;i<sections.length;i++){
+ currentSection = sections[i];
+ dojo.create("li", {id : currentSection.id + "Span" }, sectionsDiv);
+ var ahref = dojo.create("a", { href: window.location.href, title: "Go to " + currentSection.id + " section", innerHTML: currentSection.id + "\n"}, currentSection.id + "Span");
+ var onClickHandler = dojo.connect(ahref, 'onclick', function() {
+ currentSection.scrollIntoView(false);
+ that.hide();
+ return false;
+
+ });
+ }
+ }
+
+});
+}); \ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/templates/ContentDialog.html b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/templates/ContentDialog.html
new file mode 100644
index 0000000..f1b8e17
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/templates/ContentDialog.html
@@ -0,0 +1,23 @@
+<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">
+ <div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">
+ <span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>
+ <span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">
+ <span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>
+ </span>
+ </div>
+ <div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">
+ <!-- Actual content here -->
+
+ <form method="post" id="contenDialog.myForm"
+ enctype="multipart/form-data">
+ <fieldset>
+ <div style="display: table-row">
+ <div style="display: table-row">
+ <div style="display: table-cell; padding: 1px;" , id = "div1" >
+ </div>
+ </div>
+ </div>
+ </fieldset>
+ </form>
+ </div>
+</div> \ No newline at end of file