Show diff type in gutter

This commit is contained in:
Jesse van den Kieboom 2014-01-02 13:59:20 +01:00
parent 21909908d1
commit d4d1d45952
3 changed files with 15 additions and 4 deletions

View file

@ -21,6 +21,7 @@ function diff_file(file, lnstate, data)
file_body += '<tr class="context">\
<td class="gutter old">' + lnstate.gutterdots + '</td>\
<td class="gutter new">' + lnstate.gutterdots + '</td>\
<td class="gutter type">&nbsp;</td>\
<td></td>\
</tr>';
continue;
@ -36,6 +37,7 @@ function diff_file(file, lnstate, data)
file_body += '<tr class="hunk_header">\
<td class="gutter old">' + lnstate.gutterdots + '</td> \
<td class="gutter new">' + lnstate.gutterdots + '</td> \
<td class="gutter type">&nbsp;</td> \
<td class="hunk_header">' + hunk_header + '</td> \
</tr>';
@ -78,13 +80,20 @@ function diff_file(file, lnstate, data)
row += 'context"> \
<td class="gutter old"></td> \
<td class="gutter new"></td>';
l.content = l.content.substr(1, l.content.length);
l.content = l.content.substr(1, l.content.length);
break;
default:
o = ' ';
row += '">';
break;
}
if (o == ' ')
{
o = '&nbsp;';
}
row += '<td class="gutter type">' + o + '</td>';
row += '<td class="code">' + html_escape(l.content).replace(/\t/g, tabrepl) + '</td>';
row += '</tr>';

View file

@ -188,11 +188,12 @@ div#diff div.file table td {
vertical-align: top;
}
div#diff div.file table td.gutter.new {
div#diff div.file table td.gutter.type {
border-right: 3px solid #d3d7cf;
padding: 0px 3px 0px 3px;
}
div#diff div.file table tr.hunk_header td.gutter.new {
div#diff div.file table tr.hunk_header td.gutter.type {
border: 0;
}

View file

@ -23,13 +23,14 @@
<div class="file ${FILE_CLASSES}" data-filename="${FILE_FILENAME}">
<table class="file">
<colgroup>
<col width="0">
<col width="0">
<col width="0">
<col width="100%">
</colgroup>
<tbody>
<tr class="file_header">
<td colspan="3">
<td colspan="4">
<span class="expander">-</span>
<!-- ${FILE_STATS} -->
<span class="file_path"><!-- ${FILE_PATH} --></span>