diff options
-rw-r--r-- | inc/DifferenceEngine.php | 10 | ||||
-rw-r--r-- | inc/html.php | 4 | ||||
-rw-r--r-- | lib/tpl/default/design.css | 12 | ||||
-rw-r--r-- | lib/tpl/dokuwiki/css/_diff.css | 12 |
4 files changed, 29 insertions, 9 deletions
diff --git a/inc/DifferenceEngine.php b/inc/DifferenceEngine.php index 1099f40eb..2125ad879 100644 --- a/inc/DifferenceEngine.php +++ b/inc/DifferenceEngine.php @@ -1151,7 +1151,7 @@ class InlineDiffFormatter extends DiffFormatter { $xbeg .= "," . $xlen; if ($ylen != 1) $ybeg .= "," . $ylen; - $r = '<tr><td colspan="'.$this->colspan.'" '.HTMLDiff::css('diff-blockheader').'>@@ '.$lang['line']." -$xbeg +$ybeg @@"; + $r = '<tr><td colspan="2" '.HTMLDiff::css('diff-blockheader').'>@@ '.$lang['line']." -$xbeg +$ybeg @@"; $r .= ' <span '.HTMLDiff::css('diff-deletedline').'><del>'.$lang['deleted'].'</del></span>'; $r .= ' <span '.HTMLDiff::css('diff-addedline').'>'.$lang['created'].'</span>'; $r .= "</td></tr>\n"; @@ -1170,19 +1170,19 @@ class InlineDiffFormatter extends DiffFormatter { function _added($lines) { foreach ($lines as $line) { - print('<tr><td '.HTMLDiff::css('diff-lineheader').'>+</td><td colspan="'.($this->colspan-1).'" '.HTMLDiff::css('diff-addedline').'>'. $line . "</td></tr>\n"); + print('<tr><td '.HTMLDiff::css('diff-lineheader').'>+</td><td '.HTMLDiff::css('diff-addedline').'>'. $line . "</td></tr>\n"); } } function _deleted($lines) { foreach ($lines as $line) { - print('<tr><td '.HTMLDiff::css('diff-lineheader').'>-</td><td colspan="'.($this->colspan-1).'" '.HTMLDiff::css('diff-deletedline').'><del>' . $line . "</del></td></tr>\n"); + print('<tr><td '.HTMLDiff::css('diff-lineheader').'>-</td><td '.HTMLDiff::css('diff-deletedline').'><del>' . $line . "</del></td></tr>\n"); } } function _context($lines) { foreach ($lines as $line) { - print('<tr><td '.HTMLDiff::css('diff-lineheader').'> </td><td colspan="'.($this->colspan-1).'" '.HTMLDiff::css('diff-context').'>'.$line."</td></tr>\n"); + print('<tr><td '.HTMLDiff::css('diff-lineheader').'> </td><td '.HTMLDiff::css('diff-context').'>'.$line."</td></tr>\n"); } } @@ -1191,7 +1191,7 @@ class InlineDiffFormatter extends DiffFormatter { $add = $diff->inline(); foreach ($add as $line) - print('<tr><td '.HTMLDiff::css('diff-lineheader').'>!</td><td colspan="'.($this->colspan-1).'">'.$line."</td></tr>\n"); + print('<tr><td '.HTMLDiff::css('diff-lineheader').'>!</td><td>'.$line."</td></tr>\n"); } } diff --git a/inc/html.php b/inc/html.php index 420efd633..e657d2c78 100644 --- a/inc/html.php +++ b/inc/html.php @@ -1209,12 +1209,12 @@ function html_diff($text='',$intro=true,$type=null){ <table class="diff diff_<?php echo $type?>"> <?php if ($type == 'inline') { ?> <tr> - <td>---</td><th <?php echo $l_minor?>> + <th class="diff-lineheader">-</th><th <?php echo $l_minor?>> <?php echo $l_head?> </th> </tr> <tr> - <td>+++</td><th <?php echo $r_minor?>> + <th class="diff-lineheader">+</th><th <?php echo $r_minor?>> <?php echo $r_head?> </th> </tr> diff --git a/lib/tpl/default/design.css b/lib/tpl/default/design.css index 3405ec258..4772fd2a5 100644 --- a/lib/tpl/default/design.css +++ b/lib/tpl/default/design.css @@ -632,7 +632,6 @@ div.dokuwiki td.diff-blockheader { div.dokuwiki table.diff th { border-bottom: 1px solid __border__; font-size: 110%; - width: 50%; font-weight: normal; text-align: left; } @@ -650,6 +649,17 @@ div.dokuwiki table.diff th span.sum { div.dokuwiki table.diff th.minor { font-style: italic; } +.dokuwiki table.diff_sidebyside th { + width: 50%; +} +.dokuwiki table.diff .diff-lineheader { + width: .7em; + text-align: right; +} +[dir=rtl] .dokuwiki table.diff .diff-lineheader { + text-align: left; +} +.dokuwiki table.diff .diff-lineheader, div.dokuwiki table.diff td { font-family: monospace; font-size: 100%; diff --git a/lib/tpl/dokuwiki/css/_diff.css b/lib/tpl/dokuwiki/css/_diff.css index 62f831213..58c24b5c7 100644 --- a/lib/tpl/dokuwiki/css/_diff.css +++ b/lib/tpl/dokuwiki/css/_diff.css @@ -21,7 +21,6 @@ .dokuwiki table.diff th { border-bottom: 1px solid __border__; font-size: 110%; - width: 50%; font-weight: normal; } .dokuwiki table.diff th a { @@ -37,8 +36,19 @@ .dokuwiki table.diff th.minor { color: #999; } +.dokuwiki table.diff_sidebyside th { + width: 50%; +} /* table body */ +.dokuwiki table.diff .diff-lineheader { + width: .7em; + text-align: right; +} +[dir=rtl] .dokuwiki table.diff .diff-lineheader { + text-align: left; +} +.dokuwiki table.diff .diff-lineheader, .dokuwiki table.diff td { font-family: Consolas, "Andale Mono WT", "Andale Mono", "Bitstream Vera Sans Mono", "Nimbus Mono L", Monaco, "Courier New", monospace; } |