aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdyta Przymus2012-07-24 06:05:53 (EDT)
committerMalgorzata Janczarska2012-07-25 04:11:20 (EDT)
commit1b622f01d92ca04ca242bf7fe96a0d7b69899bfa (patch)
treef2767f0dc3039dca7d3d5bcfdaaa61aa9e9915c8
parent1a50fa49b7465604f656cda374400bf9b008940b (diff)
downloadorg.eclipse.orion.client-1b622f01d92ca04ca242bf7fe96a0d7b69899bfa.zip
org.eclipse.orion.client-1b622f01d92ca04ca242bf7fe96a0d7b69899bfa.tar.gz
org.eclipse.orion.client-1b622f01d92ca04ca242bf7fe96a0d7b69899bfa.tar.bz2
bug 383425 - Continuation of Bug 351458 - easy way to get commit from
GitHub
-rw-r--r--bundles/org.eclipse.orion.client.git/web/git/pullRequest.css61
-rw-r--r--bundles/org.eclipse.orion.client.git/web/git/pullRequest.html66
-rw-r--r--bundles/org.eclipse.orion.client.git/web/git/pullRequest.js69
-rw-r--r--bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js43
-rw-r--r--bundles/org.eclipse.orion.client.git/web/orion/git/gitPullRequestExplorer.js297
-rw-r--r--bundles/org.eclipse.orion.client.git/web/orion/git/widgets/CommitTooltipDialog.js2
6 files changed, 537 insertions, 1 deletions
diff --git a/bundles/org.eclipse.orion.client.git/web/git/pullRequest.css b/bundles/org.eclipse.orion.client.git/web/git/pullRequest.css
new file mode 100644
index 0000000..2ed1842
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.git/web/git/pullRequest.css
@@ -0,0 +1,61 @@
+@import "../org.dojotoolkit/dojo/resources/dojo.css";
+
+@import "../org.dojotoolkit/dijit/themes/claro/claro.css";
+
+@import "../org.dojotoolkit/dijit/themes/claro/layout/BorderContainer.css";
+
+@import "../org.dojotoolkit/dijit/themes/claro/form/Common.css";
+
+@import "../org.dojotoolkit/dijit/themes/claro/form/Button.css";
+
+@import "../org.dojotoolkit/dojox/layout/resources/ToggleSplitter.css";
+
+@import "../settings/settings.css";
+
+@import "../css/ide.css";
+
+@import "../css/breadcrumbs.css";
+
+@import "../css/commands.css";
+
+@import "../css/sections.css";
+
+@import "../orion/compare/compare-container.css";
+
+@import "css/git.css";
+
+.lightTreeTableRow {
+ border-bottom: 1px solid #e6e6e6;
+}
+
+.darkTreeTableRow {
+ border-bottom: 1px solid #e6e6e6;
+}
+
+.stretch {
+ float: left;
+ position: relative;
+ white-space:normal;
+ max-width:700px;
+}
+
+.plugin-settings {
+ overflow-x: hidden;
+ width: 100%;
+}
+
+.gitMainDescription{
+ padding-left:8px;
+}
+
+pre {
+ margin-left: 10px;
+ padding: 15px;
+ background-color: #fdfdfd;
+ border: 1px solid #ebebeb;
+ font-family: Courier,"Courier New";
+ white-space: pre-wrap;
+ width: 60%
+}
+
+
diff --git a/bundles/org.eclipse.orion.client.git/web/git/pullRequest.html b/bundles/org.eclipse.orion.client.git/web/git/pullRequest.html
new file mode 100644
index 0000000..e28f9b3
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.git/web/git/pullRequest.html
@@ -0,0 +1,66 @@
+<!doctype html>
+<html style="height: 100%" >
+<head>
+ <meta name="copyright" content="Copyright (c) IBM Corporation and others 2012." >
+ <meta http-equiv="Content-Language" content="en-us">
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <title>Git Pull Request</title>
+ <link rel="stylesheet" type="text/css" href="pullRequest.css" />
+ <link rel="shortcut icon" href="/commit.ico" />
+ <script type="text/javascript" src="../requirejs/require.js"></script>
+ <script type="text/javascript">
+ require({
+ baseUrl: '..',
+ // set the paths to our library packages
+ packages: [
+ {
+ name: 'dojo',
+ location: 'org.dojotoolkit/dojo',
+ main: 'lib/main-browser',
+ lib: '.'
+ },
+ {
+ name: 'dijit',
+ location: 'org.dojotoolkit/dijit',
+ main: 'lib/main',
+ lib: '.'
+ },
+ {
+ name: 'dojox',
+ location: 'org.dojotoolkit/dojox',
+ main: 'lib/main',
+ lib: '.'
+ }
+ ],
+ paths: {
+ text: 'requirejs/text',
+ i18n: 'requirejs/i18n',
+ domReady: 'requirejs/domReady'
+ }
+ });
+ require(["pullRequest.js"]);
+ </script>
+</head>
+<body style="height: 100%; visibility:hidden" class="claro" spellcheck="false">
+ <div id="orion.pullRequest" class="orionPage" dojoType="dijit.layout.BorderContainer" design="headline" gutters="false">
+ <div class="banner" id="banner" dojoType="dijit.layout.ContentPane" region="top">
+ </div>
+ <div id="centerPane" dojoType="dijit.layout.BorderContainer" region="center" design="headline" liveSplitters="false" gutters="false" splitter="false" role="main">
+ <div class="mainToolbar" id="pageToolbar" dojoType="dijit.layout.ContentPane" splitter="false" region="top">
+ </div>
+ <div class="mainpane" dojoType="dijit.layout.ContentPane" splitter="false"region="center">
+ <div id="mainNode" class="settings mainPadding">
+ <div id="openCommitSection" class="displayTable">
+ </div>
+ <div id="fetchDiv" class="displayTable">
+ </div>
+ <div id="table" class="displayTable">
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="footer" id="footer" dojoType="dijit.layout.ContentPane" region="bottom" splitter="false">
+ </div>
+ </div>
+</body>
+</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.git/web/git/pullRequest.js b/bundles/org.eclipse.orion.client.git/web/git/pullRequest.js
new file mode 100644
index 0000000..4c9678c
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.git/web/git/pullRequest.js
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * @license
+ * Copyright (c) 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
+ ******************************************************************************/
+
+var eclipse;
+/*global define document dojo dijit serviceRegistry:true */
+/*browser:true*/
+define(['i18n!git/nls/gitmessages', 'require', 'dojo', 'orion/bootstrap', 'orion/status', 'orion/progress', 'orion/commands', 'orion/dialogs', 'orion/selection',
+ 'orion/fileClient', 'orion/operationsClient', 'orion/searchClient', 'orion/globalCommands',
+ 'orion/git/gitPullRequestExplorer', 'orion/git/gitCommands', 'orion/git/gitClient', 'orion/ssh/sshTools', 'orion/links', 'orion/contentTypes',
+ 'dojo/parser', 'dojo/hash', 'dijit/layout/BorderContainer', 'dijit/layout/ContentPane', 'orion/widgets/eWebBorderContainer'],
+ function(messages, require, dojo, mBootstrap, mStatus, mProgress, mCommands, mDialogs, mSelection,
+ mFileClient, mOperationsClient, mSearchClient, mGlobalCommands,
+ mGitPullRequestExplorer, mGitCommands, mGitClient, mSshTools, mLinks, mContentTypes) {
+
+ mBootstrap.startup().then(function(core) {
+ var serviceRegistry = core.serviceRegistry;
+ var preferences = core.preferences;
+ document.body.style.visibility = "visible"; //$NON-NLS-0$
+ dojo.parser.parse();
+
+ new mDialogs.DialogService(serviceRegistry);
+ var selection = new mSelection.Selection(serviceRegistry);
+ new mSshTools.SshService(serviceRegistry);
+ var commandService = new mCommands.CommandService({serviceRegistry: serviceRegistry});
+ var operationsClient = new mOperationsClient.OperationsClient(serviceRegistry);
+ new mStatus.StatusReportingService(serviceRegistry, operationsClient, "statusPane", "notifications", "notificationArea"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ new mProgress.ProgressService(serviceRegistry, operationsClient);
+
+ // ...
+ var linkService = new mLinks.TextLinkService({serviceRegistry: serviceRegistry});
+ var gitClient = new mGitClient.GitService(serviceRegistry);
+ var fileClient = new mFileClient.FileClient(serviceRegistry);
+ var contentTypeService = new mContentTypes.ContentTypeService(serviceRegistry);
+ var searcher = new mSearchClient.Searcher({serviceRegistry: serviceRegistry, commandService: commandService, fileService: fileClient});
+
+ var explorer = new mGitPullRequestExplorer.GitPullRequestExplorer(fileClient, commandService, serviceRegistry, gitClient); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ mGlobalCommands.setPageCommandExclusions(["eclipse.git.status2", "eclipse.git.status"]); //$NON-NLS-1$ //$NON-NLS-0$
+ mGlobalCommands.generateBanner("banner", serviceRegistry, commandService, preferences, searcher, explorer); //$NON-NLS-0$
+
+ // define commands
+ mGitCommands.createFileCommands(serviceRegistry, commandService, explorer, "pageActions", "selectionTools"); //$NON-NLS-1$ //$NON-NLS-0$
+ mGitCommands.createGitClonesCommands(serviceRegistry, commandService, explorer, "pageActions", "selectionTools", fileClient); //$NON-NLS-1$ //$NON-NLS-0$
+
+ // page command contributions
+ commandService.addCommandGroup("pageActions", "eclipse.gitGroup", 100); //$NON-NLS-1$ //$NON-NLS-0$
+
+ commandService.registerCommandContribution("pageActions", "eclipse.orion.git.showContent", 300, null,true,new mCommands.CommandKeyBinding('e', true, true)); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+
+ commandService.registerCommandContribution("pageActions", "eclipse.orion.git.resetCommand", 100, "eclipse.gitGroup"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ commandService.registerCommandContribution("pageActions", "eclipse.orion.git.rebaseContinueCommand", 200, "eclipse.gitGroup"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ commandService.registerCommandContribution("pageActions", "eclipse.orion.git.rebaseSkipPatchCommand", 300, "eclipse.gitGroup"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ commandService.registerCommandContribution("pageActions", "eclipse.orion.git.rebaseAbortCommand", 400, "eclipse.gitGroup"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+
+ explorer.display(dojo.hash());
+
+ //every time the user manually changes the hash, we need to load the commit with that name
+ dojo.subscribe("/dojo/hashchange", explorer, function() { //$NON-NLS-0$
+ explorer.display(dojo.hash());
+ });
+ });
+}); //end of define
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 4fc1e0a..6732495 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
@@ -885,6 +885,8 @@ var exports = {};
var fetchForceCommand = new mCommands.Command({
name : messages["Force Fetch"],
+ imageClass: "git-sprite-fetch",
+ spriteClass: "gitCommandSprite",
tooltip: messages["Fetch from the remote branch into your remote tracking branch overriding its current content"],
id : "eclipse.orion.git.fetchForce", //$NON-NLS-0$
callback: function(data) {
@@ -1868,6 +1870,47 @@ var exports = {};
}
});
commandService.addCommand(cloneGitRepositoryCommand);
+
+ var cloneGitRepositoryCommandPullReq = new mCommands.Command({
+ name : messages["Clone Repository"],
+ tooltip : messages["Clone an existing Git repository to a folder"],
+ id : "eclipse.cloneGitRepositoryPullReq", //$NON-NLS-0$
+ //parameters: cloneParameters,
+ callback : function(data) {
+ var gitService = serviceRegistry.getService("orion.git.provider"); //$NON-NLS-0$
+ var cloneFunction = function(gitUrl, path, name) {
+ exports.getDefaultSshOptions(serviceRegistry).then(function(options) {
+ var func = arguments.callee;
+ serviceRegistry.getService("orion.page.message").createProgressMonitor(gitService.cloneGitRepository(name, gitUrl, path, explorer.defaultPath, options.gitSshUsername, options.gitSshPassword, options.knownHosts, //$NON-NLS-0$
+ options.gitPrivateKey, options.gitPassphrase),
+ messages["Cloning repository: "] + gitUrl).deferred.then(function(jsonData, secondArg) {
+ exports.handleProgressServiceResponse(jsonData, options, serviceRegistry, function(jsonData) {
+ if (explorer.changedItem) {
+ dojo.hitch(explorer, explorer.changedItem)();
+ }
+ }, func, messages['Clone Git Repository']);
+ }, function(jsonData, secondArg) {
+ exports.handleProgressServiceResponse(jsonData, options, serviceRegistry, function() {}, func, messages['Clone Git Repository']);
+ });
+ });
+ };
+ var dialog = new orion.git.widgets.CloneGitRepositoryDialog({
+ serviceRegistry: serviceRegistry,
+ fileClient: fileClient,
+ url: data.userData,
+ alwaysShowAdvanced: false,
+ func: cloneFunction
+ });
+
+ dialog.startup();
+ dialog.show();
+
+ },
+ visibleWhen : function(item) {
+ return true;
+ }
+ });
+ commandService.addCommand(cloneGitRepositoryCommandPullReq);
var initRepositoryParameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("folderName", "text", messages['New folder:'])], {hasOptionalParameters: true}); //$NON-NLS-1$ //$NON-NLS-0$
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/gitPullRequestExplorer.js b/bundles/org.eclipse.orion.client.git/web/orion/git/gitPullRequestExplorer.js
new file mode 100644
index 0000000..be89770
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/gitPullRequestExplorer.js
@@ -0,0 +1,297 @@
+/*******************************************************************************
+ * @license
+ * Copyright (c) 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 define console document orion Image*/
+/*global dojo eclipse:true widgets*/
+/*jslint regexp:false browser:true forin:true*/
+
+define(['i18n!git/nls/gitmessages', 'require', 'dojo','dijit', 'orion/section', 'orion/explorer', 'orion/i18nUtil', 'orion/globalCommands', 'orion/compare/diff-provider',
+ 'orion/compare/compare-container' ,'orion/git/gitCommands', 'orion/navigationUtils','dijit/TooltipDialog', 'orion/git/widgets/CommitTooltipDialog'],
+ function(messages, require, dojo, dijit ,mSection, mExplorer, i18nUtil, mGlobalCommands, mDiffProvider , mCompareContainer, mGitCommands, mNavUtils) {
+ var exports = {};
+
+ exports.GitPullRequestExplorer = (function() {
+
+ /**
+ * Creates a new Git Pull Request explorer.
+ * @class Git Pull Request explorer
+ */
+ function GitPullRequestExplorer(fileClient, commandService, serviceRegistry, gitClient){
+ this.fileClient = fileClient;
+ this.registry = serviceRegistry;
+ this.gitClient = gitClient;
+ this.commandService = commandService;
+ mExplorer.createExplorerCommands(commandService);
+ }
+
+ GitPullRequestExplorer.prototype.handleError = function(error) {
+ var display = {};
+ display.Severity = "Error"; //$NON-NLS-0$
+ display.HTML = false;
+ try {
+ var resp = JSON.parse(error.responseText);
+ display.Message = resp.DetailedMessage ? resp.DetailedMessage : resp.Message;
+ } catch (Exception) {
+ display.Message = error.message;
+ }
+ this.registry.getService("orion.page.message").setProgressResult(display); //$NON-NLS-0$
+
+ if (error.status === 404) {
+ this.initTitleBar();
+ this.displayCommit();
+ }
+ };
+ GitPullRequestExplorer.prototype.setDefaultPath = function(defaultPath){
+ this.defaultPath = defaultPath;
+ };
+
+ GitPullRequestExplorer.prototype.changedItem = function(parent, children) {
+ this.redisplay();
+ };
+
+ GitPullRequestExplorer.prototype.redisplay = function(){
+ this.display(dojo.hash());
+ };
+
+ GitPullRequestExplorer.prototype.display = function(remote_sha){
+ this.progressService = this.registry.getService("orion.page.message"); //$NON-NLS-0$
+ this.loadingDeferred = new dojo.Deferred();
+ var that = this;
+ var params = [];
+ var n = remote_sha.lastIndexOf("_");
+ params[0] = remote_sha.substring(0,n);
+ params[1] = remote_sha.substring(n+1);
+ var redundant = params[0].split(".");
+ var index = redundant.length - 1;
+ if(redundant[index] === "git"){
+ var m = params[0].lastIndexOf(".");
+ params[2] = params[0].substring(0,m);
+ }
+ else{
+ params[2] = params[0] + ".git";
+ }
+ this.url = params[2];
+ this.initTitleBar(params[1], params[0]);
+ dojo.empty(dojo.byId("table"));
+ dojo.empty(dojo.byId("openCommitSection"));
+ dojo.empty(dojo.byId("fetchDiv"));
+ this.fileClient.loadWorkspace().then(
+ function(workspace){
+ that.setDefaultPath(workspace.Location);
+ that.commandService.registerCommandContribution("fetch", "eclipse.orion.git.fetch", 200);
+ that.commandService.registerCommandContribution("fetch", "eclipse.orion.git.fetchForce", 250);
+ var tableNode = dojo.byId("table");
+ var titleWrapper1 = new mSection.Section(dojo.byId("openCommitSection"), {
+ id: "open commit from existing repository", //$NON-NLS-0$
+ title: "Commit not found", //$NON-NLS-0$
+ slideout: true,
+ canHide: true,
+ preferenceService: that.registry.getService("orion.core.preference"),
+ content: '<div id="openExistingNode" class="mainPadding"></list>' //$NON-NLS-0$
+ });
+ var titleWrapper2 = new mSection.Section(dojo.byId("fetchDiv"), {
+ id: "fetch section", //$NON-NLS-0$
+ title: "No repository to fetch from the remote", //$NON-NLS-0$
+ slideout: true,
+ canHide: true,
+ preferenceService: that.registry.getService("orion.core.preference"),
+ content: '<div id="fetchNode" class="mainPadding"></list>' //$NON-NLS-0$
+ });
+ var titleWrapper3 = new mSection.Section(tableNode, {
+ id: "create new clone", //$NON-NLS-0$
+ title: "Create new repository", //$NON-NLS-0$
+ content: '<div id="createNewNode" class="mainPadding"></list>' //$NON-NLS-0$
+ });
+
+ that.renderCloneSection(params);
+ that.renderSections(workspace.Children, params[0], params[2], params[1]);
+ },
+ function(){
+ }
+ );
+
+
+ };
+
+ GitPullRequestExplorer.prototype.renderCloneSection = function(params){
+ var that = this;
+ that.commandService.registerCommandContribution("clone", "eclipse.cloneGitRepositoryPullReq", 200);
+ that.commandService.renderCommands("clone", dojo.byId("createNewNode"), "clone", that, "button", params[0]);
+ dojo.create("span", { style: "padding: 0px; text-align: left; width: 20px class: gitMainDescription", innerHTML : " using " + params[0] }, dojo.byId("createNewNode"));
+ };
+
+ GitPullRequestExplorer.prototype.renderSections = function(repositories, url1, url2, sha){
+ var that = this;
+
+ var findCommitLocation = function (repositories, commitName, deferred, that) {
+ if (deferred === null)
+ deferred = new dojo.Deferred();
+ if (repositories.length > 0) {
+ that.registry.getService("orion.git.provider").doGitLog( //$NON-NLS-0$
+ "/gitapi/commit/" + sha + repositories[0].Location + "?page=1&pageSize=1", null, null, messages['Looking for the commit']).then( //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ function(resp){
+ that.currentCommit = resp;
+ deferred.callback(resp.Children[0].Location);
+ },
+ function(error) {
+ deferred.errback();
+ }
+ );
+ } else {
+ deferred.errback();
+ }
+
+ return deferred;
+ };
+
+
+ if (repositories.length > 0) {
+ repositories[0].Content = {};
+ var path = "root / "; //$NON-NLS-0$
+ if (repositories[0].Parents !== null && repositories[0].Parents !== undefined){
+ for (var i=repositories[0].Parents.length; i>0; i--){
+ path += repositories[0].Parents[i-1].Name + " / "; //$NON-NLS-0$
+ }
+ }
+ path += repositories[0].Name;
+ repositories[0].Content.Path = path;
+ that.registry.getService("orion.git.provider").getGitClone(repositories[0].Git.CloneLocation).then(
+ function(resp){
+ that.registry.getService("orion.git.provider").getGitRemote("/gitapi/remote" + repositories[0].Location).then(
+ function(remotes){
+ var found = false;
+ for(var i=0;i<remotes.Children.length;i++){
+ if(remotes.Children[i].GitUrl === url1 || remotes.Children[i].GitUrl === url2)
+ found = true;
+ }
+
+ if(found){
+ findCommitLocation(repositories, sha, null, that).then(
+ function(commitLocation){
+ var _timer;
+ var commitPageURL = "/git/git-commit.html#" + commitLocation + "?page=1&pageSize=1";
+ var repoURL = "/git/git-repository.html#" + resp.Children[0].Location;
+ dojo.create("div", {id : resp.Children[0].Name + "tableitem" , class: "sectionTableItem lightTreeTableRow" , style: "height: 20px"}, dojo.byId("openExistingNode"));
+ dojo.create("div", {id : resp.Children[0].Name + "div" , class: "stretch" , style: "width: 1000px"}, dojo.byId(resp.Children[0].Name + "tableitem"));
+ dojo.create("div", {id : resp.Children[0].Name + "divCommands" , class: "sectionTableItemActions" }, dojo.byId(resp.Children[0].Name + "tableitem"));
+ var link2 = dojo.create("a", {style: "padding: 0px; text-align: left; display: inline-block; width: 150px", innerHTML: repositories[0].Name , href: repoURL }, dojo.byId(resp.Children[0].Name + "div"));
+ dojo.create("span", {style: "class: gitSecondaryDescription", innerHTML: "location: " + repositories[0].Content.Path},dojo.byId(resp.Children[0].Name + "div"));
+ var link = dojo.create("a", {id : resp.Children[0].Name + "a", style: "padding: 0px; text-align: left; width: 50px", innerHTML: "Open Commit", href: commitPageURL }, dojo.byId(resp.Children[0].Name + "divCommands"));
+ dojo.byId("open commit from existing repositoryTitle").innerHTML = "Open Commit";
+ var tooltipDialog = new orion.git.widgets.CommitTooltipDialog({
+ commit: that.currentCommit.Children[0],
+ onMouseLeave: function(){
+ if(dijit.popup.hide)
+ dijit.popup.hide(tooltipDialog); //close doesn't work on FF
+ dijit.popup.close(tooltipDialog);
+ },
+ onMouseEnter: function(){
+ clearTimeout(_timer);
+ }
+ });
+ dojo.connect(link, "onmouseover", link2, function() { //$NON-NLS-0$
+ clearTimeout(_timer);
+
+ _timer = setTimeout(function(){
+ dijit.popup.open({
+ popup: tooltipDialog,
+ around: link,
+ position: "before",
+ orient: {'BL':'TL', 'TR':'BR'} //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ });
+ }, 600);
+ });
+
+ dojo.connect(link, "onmouseout", link, function() { //$NON-NLS-0$
+ clearTimeout(_timer);
+
+ _timer = setTimeout(function(){
+ if(dijit.popup.hide)
+ dijit.popup.hide(tooltipDialog); //close doesn't work on FF
+ dijit.popup.close(tooltipDialog);
+ }, 200);
+ });
+ },
+ function(){
+ var index;
+ for(var i=0;i<remotes.Children.length;i++){
+ if(remotes.Children[i].GitUrl === url1 || remotes.Children[i].GitUrl === url2){
+ index = i;
+ }
+ }
+ var repoURL = "/git/git-repository.html#" + resp.Children[0].Location;
+ dojo.create("div", {id : resp.Children[0].Name + "tableitem" , class: "sectionTableItem lightTreeTableRow" , style: "height: 20px"}, dojo.byId("fetchNode"));
+ dojo.create("div", {id : resp.Children[0].Name + "div" , class: "stretch" }, dojo.byId(resp.Children[0].Name + "tableitem"));
+ dojo.create("div", {id : resp.Children[0].Name + "divCommands" , class: "sectionTableItemActions" }, dojo.byId(resp.Children[0].Name + "tableitem"));
+ dojo.create("a", {id : resp.Children[0].Name, style: "padding: 0px; text-align: left; display: inline-block; width: 150px", innerHTML: resp.Children[0].Name + " " , href: repoURL }, dojo.byId(resp.Children[0].Name + "div"));
+ dojo.create("span", {style: "class: gitSecondaryDescription", innerHTML: "location: " + repositories[0].Content.Path},dojo.byId(resp.Children[0].Name + "div"));
+ that.commandService.renderCommands("fetch", dojo.byId(resp.Children[0].Name + "divCommands"), remotes.Children[index], that, "tool");
+ dojo.byId("fetch sectionTitle").innerHTML = "Fetch from repository with the remote attached";
+
+ }
+ );
+
+ }
+ that.renderSections(repositories.slice(1), url1, url2, sha);
+ }
+ );
+
+ },
+ function(error){
+ }
+
+ );
+
+ }
+ };
+
+ GitPullRequestExplorer.prototype.makeHref = function (fileClient, seg, location, isRemote) {
+ if (!location) {
+ return;
+ }
+
+ fileClient.read(location, true).then(dojo.hitch(this, function(metadata) {
+ if (isRemote) {
+ var gitService = this.registry.getService("orion.git.provider"); //$NON-NLS-0$
+ if (metadata.Git) {
+ gitService.getDefaultRemoteBranch(metadata.Git.RemoteLocation).then(function(defaultRemoteBranchJsonData, secondArg) {
+ seg.href = require.toUrl("git/git-log.html") + "#" + defaultRemoteBranchJsonData.Location + "?page=1"; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ });
+ }
+ } else {
+ if (metadata.Git) {
+ seg.href = require.toUrl("git/git-log.html") + "#" + metadata.Git.CommitLocation + "?page=1"; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ }
+ }
+ }), dojo.hitch(this, function(error) {
+ window.console.error("Error loading file metadata: " + error.message); //$NON-NLS-0$
+ }));
+ };
+
+ GitPullRequestExplorer.prototype.initTitleBar = function(commit, url){
+ var item = {};
+ item.Name = "Pull Request for " + commit + " on " + url;
+ var title = "Pull Request for " + commit + " on " + url;
+ var breadcrumbRootName = "Pull Request for " + commit + " on " + url;
+ mGlobalCommands.setPageTarget({task: "Pull Request", title: title, breadcrumbTarget: item,
+ breadcrumbRootName: breadcrumbRootName,
+ makeBreadcrumbLink: function(seg, location) {
+ this.makeHref(this.fileClient, seg, location, false);
+ },
+ serviceRegistry: this.registry, commandService: this.commandService});
+ };
+
+
+ return GitPullRequestExplorer;
+ }());
+
+ return exports;
+}); // end of define
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 1acfbc0..32f87d3 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
@@ -31,7 +31,7 @@ define(['i18n!git/nls/gitmessages', 'require', 'dojo', 'dijit', 'orion/util', 'd
var tableNode = dojo.create( "div", {"style":"padding:10px; max-width:480px"}, this.containerNode); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
var commitMessage0 = commit.Message.split(/(\r?\n|$)/)[0];
- link = dojo.create("a", {"class": "gitMainDescription", href: "/git/git-commit.html#" + commit.Location + "?page=1&pageSize=1"}, tableNode); //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
+ var link = dojo.create("a", {"class": "gitMainDescription", href: "/git/git-commit.html#" + commit.Location + "?page=1&pageSize=1"}, tableNode); //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
dojo.place(document.createTextNode(commitMessage0), link);
dojo.create( "div", {"style":"padding-top:15px"}, tableNode ); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$