Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 370168
Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.client.git/web/git/git-commit.css (+2 lines)
Lines 110-113 Link Here
110
    background-color: #fdfdfd;
110
    background-color: #fdfdfd;
111
    border: 1px solid #ebebeb;
111
    border: 1px solid #ebebeb;
112
    font-family: Courier,"Courier New";
112
    font-family: Courier,"Courier New";
113
    white-space: pre-wrap;
114
    width: 60%
113
}
115
}
(-)a/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommitExplorer.js (-14 / +30 lines)
Lines 162-190 Link Here
162
			
162
			
163
		    var extensionListItem = dojo.create( "div", { "class":"git-list-item" }, list );
163
		    var extensionListItem = dojo.create( "div", { "class":"git-list-item" }, list );
164
			var horizontalBox = dojo.create( "div", null, extensionListItem );
164
			var horizontalBox = dojo.create( "div", null, extensionListItem );
165
			var detailsView = dojo.create( "div", { "class":"stretch"}, horizontalBox );
165
			var detailsView = dojo.create( "div", null, horizontalBox );
166
			
166
			
167
			var cut = false;
167
			var commitMessages = this._splitCommitMessage(commit.Message);
168
			var commitMessage0 = commit.Message.split(/(\r?\n|$)/)[0];
169
			if (commitMessage0.length > 80){
170
				cut = true;
171
				commitMessage0 = commitMessage0.substring(0, 80);
172
			};
173
			
168
			
174
			var div = dojo.create( "div", null, detailsView );
169
			var div = dojo.create( "div", null, detailsView );
175
			dojo.create( "span", { "class":"gitMainDescription", innerHTML: commitMessage0 + (cut ? "..." : "") }, div );
170
			dojo.create( "span", { "class":"gitMainDescription", innerHTML: commitMessages[0] }, div );
176
			
171
			
177
			dojo.create( "div", {"style":"padding-top:15px"}, detailsView );
172
			dojo.create( "div", {"style":"padding-top:15px"}, detailsView );
178
			
173
			
179
			var commitMessage1 = commit.Message.substring(commitMessage0.length, commit.Message.length);
174
			if (commitMessages[1] !== null){
180
			
181
			if (commitMessage1.trim().length > 0){
182
				div = dojo.create( "pre", null, detailsView );
175
				div = dojo.create( "pre", null, detailsView );
183
				dojo.place(document.createTextNode(cut ? "..." + commitMessage1 : commitMessage1.trim()), div);
176
				dojo.place(document.createTextNode(commitMessages[1]), div);
184
				dojo.create( "div", {"style":"padding-top:15px"}, detailsView );
177
				dojo.create( "div", {"style":"padding-top:15px"}, detailsView );
185
			}
178
			}
186
						
179
						
187
			dojo.create( "span", { "class":"gitSecondaryDescription", innerHTML: " commit: " + commit.Name}, detailsView );
180
			dojo.create( "span", { "class":"gitSecondaryDescription", innerHTML: "commit: " + commit.Name}, detailsView );
188
			
181
			
189
			if (commit.Parents && commit.Parents.length > 0){
182
			if (commit.Parents && commit.Parents.length > 0){
190
				dojo.create( "div", null, detailsView );
183
				dojo.create( "div", null, detailsView );
Lines 209-215 Link Here
209
			}
202
			}
210
			
203
			
211
			dojo.create( "span", { "class":"gitSecondaryDescription", 
204
			dojo.create( "span", { "class":"gitSecondaryDescription", 
212
				innerHTML: " authored by " + commit.AuthorName + " (" + commit.AuthorEmail
205
				innerHTML: "authored by " + commit.AuthorName + " (" + commit.AuthorEmail
213
				+ ") on " + dojo.date.locale.format(new Date(commit.Time), {formatLength: "short"})}, detailsView );
206
				+ ") on " + dojo.date.locale.format(new Date(commit.Time), {formatLength: "short"})}, detailsView );
214
			
207
			
215
			dojo.create( "div", null, detailsView );
208
			dojo.create( "div", null, detailsView );
Lines 217-222 Link Here
217
				innerHTML: "committed by " + commit.CommitterName  + " (" + commit.CommitterEmail + ")"}, detailsView );
210
				innerHTML: "committed by " + commit.CommitterName  + " (" + commit.CommitterEmail + ")"}, detailsView );
218
		};
211
		};
219
		
212
		
213
		GitCommitExplorer.prototype._splitCommitMessage = function(commitMessage){
214
			var cut = false;
215
			var mainMessageMaxLength = 100;
216
			
217
			var commitMessage0 = commitMessage.split(/(\r?\n|$)/)[0].trim();
218
			if (commitMessage0.length > mainMessageMaxLength){
219
				var cutPoint = commitMessage0.indexOf(" ", mainMessageMaxLength - 10);
220
				commitMessage0 = commitMessage0.substring(0, (cutPoint !== -1 ? cutPoint : mainMessageMaxLength));
221
				cut = true;
222
			};
223
			
224
			var commitMessage1 = commitMessage.substring(commitMessage0.length + 1, commitMessage.length).trim();
225
			if (commitMessage1.length > 0){
226
				commitMessage1 = (cut ? "..." + commitMessage1 : commitMessage1);
227
			} else {
228
				commitMessage1 = null;
229
			}
230
			
231
			commitMessage0 += (cut ? "..." : "");
232
			
233
			return [commitMessage0, commitMessage1];
234
		};
235
		
220
		// Git diffs
236
		// Git diffs
221
		
237
		
222
		GitCommitExplorer.prototype.displayDiffs = function(commit){
238
		GitCommitExplorer.prototype.displayDiffs = function(commit){

Return to bug 370168