Skip to content

Commit f0b1b74

Browse files
committed
some history view improvements.
1 parent b689ac6 commit f0b1b74

File tree

4 files changed

+26
-52
lines changed

4 files changed

+26
-52
lines changed

PBWebHistoryController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ - (void)commitDetailsLoaded:(NSNotification *)notification
114114
NSString *d=[repository outputInWorkdirForArguments:[NSArray arrayWithObjects:@"diff-tree", @"--cc", @"-C90%", @"-M90%", [currentSha string], nil]];
115115
NSString *diffs=[GLFileView parseDiff:d];
116116

117-
NSString *html=[NSString stringWithFormat:@"%@%@%@",header,fileList,diffs];
117+
NSString *html=[NSString stringWithFormat:@"%@%@<div id='diffs'>%@</div>",header,fileList,diffs];
118118

119-
[[view windowScriptObject] callWebScriptMethod:@"showDiff" withArguments:[NSArray arrayWithObject:html]];
119+
[[view windowScriptObject] callWebScriptMethod:@"showCommit" withArguments:[NSArray arrayWithObject:html]];
120120

121121
#if 1
122122
NSString *dom=[[[[view mainFrame] DOMDocument] documentElement] outerHTML];

html/views/history/history.css

Lines changed: 21 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
/* close commented backslash hack */
2525

2626
body {
27+
background-color: #f2f2f2;
2728
font-family: 'Lucida Grande';
2829
margin: 0px;
2930
padding: 0px;
@@ -188,6 +189,14 @@ a.showdiff {
188189

189190
#filelist {
190191
font-size: 13px;
192+
white-space: nowrap;
193+
width: 100%;
194+
padding: 10px 20px;
195+
border-collapse: collapse;
196+
}
197+
198+
#filelist tr td {
199+
border-bottom: 1px solid #ccc;
191200
}
192201

193202
#filelist a {
@@ -216,10 +225,6 @@ a.showdiff {
216225
background: url(../../images/renamed.png) no-repeat 0 center;
217226
}
218227

219-
#filelist{
220-
white-space: nowrap;
221-
width: 100%;
222-
}
223228
#filelist span.add,#filelist span.rem {
224229
display: block;
225230
height: 10px;
@@ -229,7 +234,7 @@ a.showdiff {
229234
clear: both;
230235
}
231236

232-
#filelist span.add{
237+
#filelist span.add {
233238
background-color: green;
234239
}
235240

@@ -300,47 +305,16 @@ a.showdiff {
300305
padding-bottom: 5px;
301306
}
302307

303-
/*
304-
div.button
305-
{
306-
color: #666666;
307-
308-
font-size: 60%;
309-
text-align: center;
310-
311-
width: 70px;
312-
313-
margin-right: 10px;
314-
315-
padding: 2px;
316-
317-
float: left;
318-
clear: both;
319-
320-
border: 1px solid;
321-
-webkit-border-radius: 3px;
322-
}
323-
324-
div.created
325-
{
326-
background-color: #ccffcc;
327-
border-color: #66ff66;
328-
}
329-
330-
div.changed
331-
{
332-
background-color: #ffcc99;
333-
border-color: #ff9933;
334-
}
335-
336-
div.deleted
337-
{
338-
background-color: #ffcccc;
339-
border-color: #ff6666;
308+
#diffs {
309+
-webkit-box-shadow: inset 0px 5px 5px #ccc;
310+
width: 100%;
311+
display: block;
312+
padding-top: 20px;
313+
overflow: auto;
340314
}
341315

342-
div.renamed
343-
{
344-
// No colour needed right now.
345-
}
346-
*/
316+
#diffs table.diff {
317+
-webkit-box-shadow: 5px 5px 5px #ccc;
318+
width: 98%;
319+
margin: auto auto 20px 1%;
320+
}

html/views/history/history.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var showImage = function(element, filename)
88
return false;
99
}
1010

11-
var showDiff = function(data){
12-
$("diff").innerHTML=data;
11+
var showCommit = function(data){
12+
$("commit").innerHTML=data;
1313
}
1414

html/views/history/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
</head>
1414

1515
<body>
16-
<div id="diff"></div>
16+
<div id="commit"></div>
1717
</body>
1818
</html>

0 commit comments

Comments
 (0)