aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Dröscher <dhn2@users.sourceforge.net>2007-01-28 16:46:26 +0000
committerDominik Dröscher <dhn2@users.sourceforge.net>2007-01-28 16:46:26 +0000
commitf0cc1229487adb1f4dccfdc26efdbfd7f4db199e (patch)
tree59819f9ec8c1ead091a195a031d1c0145a1bbc8e
parent46bf79ec78906e2f36a8408a1edaf139ef6dd5b0 (diff)
downloadforums-f0cc1229487adb1f4dccfdc26efdbfd7f4db199e.tar
forums-f0cc1229487adb1f4dccfdc26efdbfd7f4db199e.tar.gz
forums-f0cc1229487adb1f4dccfdc26efdbfd7f4db199e.tar.bz2
forums-f0cc1229487adb1f4dccfdc26efdbfd7f4db199e.tar.xz
forums-f0cc1229487adb1f4dccfdc26efdbfd7f4db199e.zip
First bunch of changes for #5712
git-svn-id: file:///svn/phpbb/trunk@6947 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/adm/style/install_update_diff.html71
-rw-r--r--phpBB/includes/diff/renderer.php24
-rw-r--r--phpBB/install/install_update.php1
3 files changed, 80 insertions, 16 deletions
diff --git a/phpBB/adm/style/install_update_diff.html b/phpBB/adm/style/install_update_diff.html
index 9856f60f2c..55f3d1cc49 100644
--- a/phpBB/adm/style/install_update_diff.html
+++ b/phpBB/adm/style/install_update_diff.html
@@ -11,6 +11,26 @@
<link href="../adm/style/admin.css" rel="stylesheet" type="text/css" media="screen" />
+<script type="text/javascript">
+<!--
+function resize_panel()
+{
+ var block = document.getElementById('codepanel');
+ var height;
+
+ if (window.innerHeight)
+ {
+ height = window.innerHeight - 150;
+ block.style.height = height + 'px';
+ }
+ else
+ {
+ //whatever IE needs to do this
+ }
+}
+-->
+</script>
+
<style type="text/css">
<!--
@@ -22,13 +42,23 @@
width: 99%;
}
-<!-- IF not S_DIFF_NEW_FILE -->
+<!-- IF DIFF_MODE neq 'side_by_side' -->
+div#codepanel {
+ overflow: auto;
+ width: 100%;
+ height: 350px;
+}
+<!-- ELSE -->
+div#codepanel {
+ background-color: #eee;
+}
+<!-- ENDIF -->
+<!-- IF not IS_DIFF_NEW_FILE -->
/**
* Unified Diff
*/
.file {
- border: 1px solid #eee;
line-height: .7em;
}
@@ -69,8 +99,11 @@
* Column Diff
*/
table.hrdiff {
- width: 99%;
margin: 0 0 8px 5px;
+ width: 100%;
+ overflow: hidden;
+ border-bottom: 1px solid #999;
+ table-layout: fixed;
}
table.hrdiff th {
@@ -89,9 +122,30 @@ table.hrdiff thead th {
padding: 2px;
}
+table.hrdiff tr:first-child th {
+ border-top: none;
+}
+
table.hrdiff tbody th {
padding: 2em 1px 1px 1px;
font-size: 80%;
+ border-top: 1px solid #999;
+}
+
+table.hrdiff tbody td.old {
+ border-left: 1px solid #999;
+ border-right: 1px solid #999;
+}
+table.hrdiff tbody td.new {
+ border-right: 1px solid #999;
+}
+
+table.hrdiff td pre {
+ overflow: auto;
+ display: block;
+ width: 100%;
+ overflow: auto;
+ display: block;
}
table.hrdiff .unmodified {
@@ -144,11 +198,17 @@ table.hrdiff caption span {
</head>
+
+<!-- IF DIFF_MODE neq 'side_by_side' -->
+<body onresize="resize_panel();" onload="resize_panel();">
+<!-- ELSE -->
<body>
+<!-- ENDIF -->
<div id="wrap">
<div id="page-header">
<!-- IF S_DIFF_NEW_FILE -->
+
<h1>{L_VIEWING_FILE_CONTENTS}</h1>
<!-- ELSE -->
<h1>{L_VIEWING_FILE_DIFF}</h1>
@@ -158,16 +218,18 @@ table.hrdiff caption span {
<form method="post">
<label for="diff_mode">{L_SELECT_DIFF_MODE}:</label>
<select name="diff_mode" id="diff_mode">{S_DIFF_MODE_OPTIONS}</select>
+
<input class="button1" type="submit" id="submit" name="submit" value="{L_CHANGE}" />
</form>
<!-- ENDIF -->
</div>
<div id="page-body">
- <div class="panel">
+ <div class="panel" id="codepanel">
<span class="corners-top"><span></span></span>
<div id="content">
<div id="main">
+
<!-- IF S_DIFF_CONFLICT_FILE -->
<div style="float: right;"><strong>{L_NUM_CONFLICTS}: {NUM_CONFLICTS}</strong></div>
<!-- ENDIF -->
@@ -178,4 +240,5 @@ table.hrdiff caption span {
</div>
</div>
+
<!-- INCLUDE simple_footer.html --> \ No newline at end of file
diff --git a/phpBB/includes/diff/renderer.php b/phpBB/includes/diff/renderer.php
index 490450dd7b..ce9e8955aa 100644
--- a/phpBB/includes/diff/renderer.php
+++ b/phpBB/includes/diff/renderer.php
@@ -298,17 +298,17 @@ class diff_renderer_unified extends diff_renderer
function _context($lines)
{
- return '<pre class="diff context">' . htmlspecialchars($this->_lines($lines, ' ')) . '</pre>';
+ return '<pre class="diff context">' . htmlspecialchars($this->_lines($lines, ' ')) . '<br /></pre>';
}
function _added($lines)
{
- return '<pre class="diff added">' . htmlspecialchars($this->_lines($lines, '+')) . '</pre>';
+ return '<pre class="diff added">' . htmlspecialchars($this->_lines($lines, '+')) . '<br /></pre>';
}
function _deleted($lines)
{
- return '<pre class="diff removed">' . htmlspecialchars($this->_lines($lines, '-')) . '</pre>';
+ return '<pre class="diff removed">' . htmlspecialchars($this->_lines($lines, '-')) . '<br /></pre>';
}
function _changed($orig, $final)
@@ -365,7 +365,7 @@ class diff_renderer_inline extends diff_renderer
*/
function get_diff_content($diff)
{
- return '<pre>' . nl2br($this->render($diff)) . '</pre>';
+ return '<pre>' . nl2br($this->render($diff)) . '<br /></pre>';
}
function _start_diff()
@@ -614,8 +614,8 @@ class diff_renderer_side_by_side extends diff_renderer
$line = $current_context;
$current_context = '';
- $output .= '<tr class="unmodified"><td><pre>' . ((strlen($line)) ? $line : '&nbsp;') . '</pre></td>
- <td><pre>' . ((strlen($line)) ? $line : '&nbsp;') . '</pre></td></tr>';
+ $output .= '<tr class="unmodified"><td><pre>' . ((strlen($line)) ? $line : '&nbsp;') . '<br /></pre></td>
+ <td><pre>' . ((strlen($line)) ? $line : '&nbsp;') . '<br /></pre></td></tr>';
}
switch ($change['type'])
@@ -628,7 +628,7 @@ class diff_renderer_side_by_side extends diff_renderer
$line .= htmlspecialchars($_line) . '<br />';
}
- $output .= '<tr><td class="added_empty">&nbsp;</td><td class="added"><pre>' . ((strlen($line)) ? $line : '&nbsp;') . '</pre></td></tr>';
+ $output .= '<tr><td class="added_empty">&nbsp;</td><td class="added"><pre>' . ((strlen($line)) ? $line : '&nbsp;') . '<br /></pre></td></tr>';
break;
case 'remove':
@@ -639,7 +639,7 @@ class diff_renderer_side_by_side extends diff_renderer
$line .= htmlspecialchars($_line) . '<br />';
}
- $output .= '<tr><td class="removed"><pre>' . ((strlen($line)) ? $line : '&nbsp;') . '</pre></td><td class="removed_empty">&nbsp;</td></tr>';
+ $output .= '<tr><td class="removed"><pre>' . ((strlen($line)) ? $line : '&nbsp;') . '<br /></pre></td><td class="removed_empty">&nbsp;</td></tr>';
break;
case 'empty':
@@ -664,7 +664,7 @@ class diff_renderer_side_by_side extends diff_renderer
if (!empty($left))
{
- $output .= '<td class="modified"><pre>' . $left . '</pre></td>';
+ $output .= '<td class="modified"><pre>' . $left . '<br /></pre></td>';
}
else if ($row < $oldsize)
{
@@ -677,7 +677,7 @@ class diff_renderer_side_by_side extends diff_renderer
if (!empty($right))
{
- $output .= '<td class="modified"><pre>' . $right . '</pre></td>';
+ $output .= '<td class="modified"><pre>' . $right . '<br /></pre></td>';
}
else if ($row < $newsize)
{
@@ -698,8 +698,8 @@ class diff_renderer_side_by_side extends diff_renderer
$line = $current_context;
$current_context = '';
- $output .= '<tr class="unmodified"><td><pre>' . ((strlen($line)) ? $line : '&nbsp;') . '</pre></td>';
- $output .= '<td><pre>' . ((strlen($line)) ? $line : '&nbsp;') . '</pre></td></tr>';
+ $output .= '<tr class="unmodified"><td><pre>' . ((strlen($line)) ? $line : '&nbsp;') . '<br /></pre></td>';
+ $output .= '<td><pre>' . ((strlen($line)) ? $line : '&nbsp;') . '<br /></pre></td></tr>';
}
}
}
diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php
index 9913482f84..3e24cc71ed 100644
--- a/phpBB/install/install_update.php
+++ b/phpBB/install/install_update.php
@@ -897,6 +897,7 @@ class install_update extends module
$template->assign_vars(array(
'DIFF_CONTENT' => $renderer->get_diff_content($diff),
+ 'DIFF_MODE' => $diff_mode,
'S_DIFF_MODE_OPTIONS' => $diff_mode_options,
'S_SHOW_DIFF' => true,
));