switched the diff view to the same style as the full diff view

This commit is contained in:
hyung-hwan 2015-02-01 13:07:41 +00:00
parent 9ff52ef0fa
commit d7fe16c2ea
2 changed files with 40 additions and 16 deletions

View File

@ -179,7 +179,8 @@ function format_diff ($a, $b, $css_class)
return $cc; return $cc;
} }
if (!$fullview) //if (!$fullview)
if (FALSE) // don't want to delete code for the original diff view.
{ {
print '<table id="code_diff_mainarea_result_table">'; print '<table id="code_diff_mainarea_result_table">';
/* /*
@ -338,15 +339,24 @@ else
foreach ($file['content'] as $x) foreach ($file['content'] as $x)
{ {
$diffclass = array_key_exists('rev1diffclass', $x)? $x['rev1diffclass']: 'diff'; if (array_key_exists('rev2line', $x))
print "<span class='{$diffclass}'>"; {
$diffclass = array_key_exists('rev1diffclass', $x)? $x['rev1diffclass']: 'diff';
print "<span class='{$diffclass}'>";
if ($diffclass == 'diffchanged') if ($diffclass == 'diffchanged')
print format_diff ($x['rev1line'], $x['rev2line'], 'diffchangedold'); print format_diff ($x['rev1line'], $x['rev2line'], 'diffchangedold');
else else
print htmlspecialchars($x['rev1line']); print htmlspecialchars($x['rev1line']);
print "</span>\n"; print "</span>\n";
}
else
{
print "<span class='diffrow'> ";
print $x['rev1lineno'];
print " </span>\n";
}
} }
printf ("</div>"); printf ("</div>");
print '</pre>'; print '</pre>';
@ -375,16 +385,25 @@ else
print "<pre class='prettyprint lang-{$fileext}' style='width: 100%' id='code_diff_mainarea_result_fulldiffnew'>"; print "<pre class='prettyprint lang-{$fileext}' style='width: 100%' id='code_diff_mainarea_result_fulldiffnew'>";
foreach ($file['content'] as $x) foreach ($file['content'] as $x)
{ {
$diffclass = array_key_exists('rev2diffclass', $x)? $x['rev2diffclass']: 'diff'; if (array_key_exists('rev2line', $x))
{
$diffclass = array_key_exists('rev2diffclass', $x)? $x['rev2diffclass']: 'diff';
print "<span class='{$diffclass}'>"; print "<span class='{$diffclass}'>";
if ($diffclass == 'diffchanged') if ($diffclass == 'diffchanged')
print format_diff ($x['rev2line'], $x['rev1line'], 'diffchangednew'); print format_diff ($x['rev2line'], $x['rev1line'], 'diffchangednew');
else else
print htmlspecialchars($x['rev2line']); print htmlspecialchars($x['rev2line']);
print "</span>\n"; print "</span>\n";
}
else
{
print "<span class='diffrow'> ";
print $x['rev2lineno'];
print " </span>\n";
}
} }
print '</pre>'; print '</pre>';

View File

@ -410,4 +410,9 @@
text-decoration: underline; text-decoration: underline;
} }
#code_diff_mainarea_result_fullview .diffrow {
font-size: 1.2em;
padding: 0.2em 0.2em 0.2em 0.2em;
font-weight: bold;
background-color: black;
}