Permalink
Browse files

Show refs in HTML view

  • Loading branch information...
1 parent f48d002 commit 58f0a383b292980ea1c65c46863c05f881381a8c @pieter committed Sep 19, 2008
Showing with 43 additions and 0 deletions.
  1. +9 −0 PBGitRef.m
  2. +4 −0 html/commit.html
  3. +10 −0 html/commit.js
  4. +20 −0 html/commits.css
View
@@ -41,4 +41,13 @@ - (PBGitRef*) initWithString: (NSString*) s
return self;
}
++ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector
+{
+ return NO;
+}
+
++ (BOOL)isKeyExcludedFromWebScript:(const char *)name {
+ return NO;
+}
+
@end
View
@@ -27,6 +27,10 @@
<td class="property_name">Subject:</td>
<td id="subjectID" style="font-weight:bold">Pieter de Bie</td>
</tr>
+ <tr style="display:none">
+ <td class="property_name">Refs:</td>
+ <td id="refs"></td>
+ </tr>
</table>
<hr>
<div id="message"></div>
View
@@ -2,6 +2,7 @@ var commit;
var Commit = Class.create({
initialize: function(obj) {
this.raw = obj.details;
+ this.refs = obj.refs;
var diffStart = this.raw.indexOf("\ndiff ");
var messageStart = this.raw.indexOf("\n\n") + 2;
@@ -67,6 +68,15 @@ var loadCommit = function() {
new_row.innerHTML = "<td class='property_name'>Parent:</td><td><a href='' onclick=\"selectCommit(this.innerHTML); return false;\">" + parent + "</a></td>";
});
+ if (commit.refs){
+ $('refs').parentNode.style.display = "";
+ $('refs').innerHTML = "";
+ $A(commit.refs).each(function(ref) {
+ $('refs').innerHTML += '<span class="refs ' + ref.type() + '">' + ref.shortName() + '</span>';
+ });
+ } else
+ $('refs').parentNode.style.display = "none";
+
$("message").innerHTML = commit.message.replace(/\n/g,"<br>");
if (commit.diff.length < 10000) {
View
@@ -36,4 +36,24 @@ a.showdiff {
font-size: 1.3em;
}
+.refs {
+ font-size: 9px;
+ font-family: Helvetica;
+ border: 1px solid black;
+ margin-right: 5px;
+ padding: 1px 3px 1px 3px;
+ -webkit-border-radius: 2px;
+}
+
+.refs.head {
+ background-color: #aaf254;
+}
+
+.refs.remote {
+ background-color: #b2dfff;
+}
+
+.refs.tag {
+ background-color: #fced4f;
+}

0 comments on commit 58f0a38

Please sign in to comment.