From d7fe16c2eafc9907f28e9dcc4f15ef6c9cdd959b Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sun, 1 Feb 2015 13:07:41 +0000 Subject: [PATCH] switched the diff view to the same style as the full diff view --- codepot/src/codepot/views/code_diff.php | 49 +++++++++++++++++-------- codepot/src/css/code.css | 7 +++- 2 files changed, 40 insertions(+), 16 deletions(-) diff --git a/codepot/src/codepot/views/code_diff.php b/codepot/src/codepot/views/code_diff.php index 6d6e74e9..98a17dc0 100644 --- a/codepot/src/codepot/views/code_diff.php +++ b/codepot/src/codepot/views/code_diff.php @@ -179,7 +179,8 @@ function format_diff ($a, $b, $css_class) return $cc; } -if (!$fullview) +//if (!$fullview) +if (FALSE) // don't want to delete code for the original diff view. { print ''; /* @@ -338,15 +339,24 @@ else foreach ($file['content'] as $x) { - $diffclass = array_key_exists('rev1diffclass', $x)? $x['rev1diffclass']: 'diff'; - print ""; + if (array_key_exists('rev2line', $x)) + { + $diffclass = array_key_exists('rev1diffclass', $x)? $x['rev1diffclass']: 'diff'; + print ""; - if ($diffclass == 'diffchanged') - print format_diff ($x['rev1line'], $x['rev2line'], 'diffchangedold'); - else - print htmlspecialchars($x['rev1line']); + if ($diffclass == 'diffchanged') + print format_diff ($x['rev1line'], $x['rev2line'], 'diffchangedold'); + else + print htmlspecialchars($x['rev1line']); - print "\n"; + print "\n"; + } + else + { + print " "; + print $x['rev1lineno']; + print " \n"; + } } printf (""); print ''; @@ -375,16 +385,25 @@ else print "
";
 		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 "";
+				print "";
 
-			if ($diffclass == 'diffchanged')
-				print format_diff ($x['rev2line'], $x['rev1line'], 'diffchangednew');
-			else 
-				print htmlspecialchars($x['rev2line']);
+				if ($diffclass == 'diffchanged')
+					print format_diff ($x['rev2line'], $x['rev1line'], 'diffchangednew');
+				else 
+					print htmlspecialchars($x['rev2line']);
 
-			print "\n";
+				print "\n";
+			}
+			else
+			{
+				print " ";
+				print $x['rev2lineno'];
+				print " \n";
+			}
 		}
 
 		print '
'; diff --git a/codepot/src/css/code.css b/codepot/src/css/code.css index be1d934a..4d15a211 100644 --- a/codepot/src/css/code.css +++ b/codepot/src/css/code.css @@ -410,4 +410,9 @@ 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; +}