Modify styles of split diff.

This commit is contained in:
Shintaro Murakami
2014-09-23 00:07:00 +09:00
parent e16d3c823b
commit f93b535f70
3 changed files with 16 additions and 7 deletions

View File

@@ -41,7 +41,7 @@
<a name="diff-@i"></a> <a name="diff-@i"></a>
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<th style="font-weight: normal;" class="box-header"> <th style="font-weight: normal; line-height: 27px;" class="box-header">
@if(diff.changeType == ChangeType.COPY || diff.changeType == ChangeType.RENAME){ @if(diff.changeType == ChangeType.COPY || diff.changeType == ChangeType.RENAME){
@diff.oldPath -> @diff.newPath @diff.oldPath -> @diff.newPath
@if(newCommitId.isDefined){ @if(newCommitId.isDefined){
@@ -69,7 +69,7 @@
</th> </th>
</tr> </tr>
<tr> <tr>
<td> <td style="padding: 0;">
@if(diff.newContent != None || diff.oldContent != None){ @if(diff.newContent != None || diff.oldContent != None){
<div id="diffText-@i"></div> <div id="diffText-@i"></div>
<textarea id="newText-@i" style="display: none;">@diff.newContent.getOrElse("")</textarea> <textarea id="newText-@i" style="display: none;">@diff.newContent.getOrElse("")</textarea>

View File

@@ -847,20 +847,24 @@ div.author-info div.committer {
/****************************************************************************/ /****************************************************************************/
/* Diff */ /* Diff */
/****************************************************************************/ /****************************************************************************/
table.inlinediff { table.diff {
font-size: 12px; font-size: 12px;
font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
width: 100%; width: 100%;
} }
table.inlinediff thead { table.diff thead {
display: none; display: none;
} }
td.insert, td.equal, td.delete { table.inlinediff td.insert, table.inlinediff td.equal, table.inlinediff td.delete {
width: 100%; width: 100%;
} }
td.insert, td.equal, td.delete {
width: 50%;
}
/****************************************************************************/ /****************************************************************************/
/* Repository Settings */ /* Repository Settings */
/****************************************************************************/ /****************************************************************************/

View File

@@ -173,8 +173,13 @@ diffview = {
addCellsInline(node, b++, n++, baseTextLines, change); addCellsInline(node, b++, n++, baseTextLines, change);
} }
} else { } else {
b = addCells(node, b, be, baseTextLines, change); var changeBase = change, changeNew = change;
n = addCells(node, n, ne, newTextLines, change); if (change === "replace") {
if (b < be) changeBase = "delete";
if (n < ne) changeNew = "insert";
}
b = addCells(node, b, be, baseTextLines, changeBase);
n = addCells(node, n, ne, newTextLines, changeNew);
} }
} }