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">';
/* /*
@ -337,6 +338,8 @@ else
print "<pre class='prettyprint lang-{$fileext}' style='width: 100%' id='code_diff_mainarea_result_fulldiffold'>"; print "<pre class='prettyprint lang-{$fileext}' style='width: 100%' id='code_diff_mainarea_result_fulldiffold'>";
foreach ($file['content'] as $x) foreach ($file['content'] as $x)
{
if (array_key_exists('rev2line', $x))
{ {
$diffclass = array_key_exists('rev1diffclass', $x)? $x['rev1diffclass']: 'diff'; $diffclass = array_key_exists('rev1diffclass', $x)? $x['rev1diffclass']: 'diff';
print "<span class='{$diffclass}'>"; print "<span class='{$diffclass}'>";
@ -348,6 +351,13 @@ else
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>';
@ -374,6 +384,8 @@ 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)
{
if (array_key_exists('rev2line', $x))
{ {
$diffclass = array_key_exists('rev2diffclass', $x)? $x['rev2diffclass']: 'diff'; $diffclass = array_key_exists('rev2diffclass', $x)? $x['rev2diffclass']: 'diff';
@ -386,6 +398,13 @@ else
print "</span>\n"; print "</span>\n";
} }
else
{
print "<span class='diffrow'> ";
print $x['rev2lineno'];
print " </span>\n";
}
}
print '</pre>'; print '</pre>';
printf ("</div>"); printf ("</div>");

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;
}