[DEPOT] ~gitignore : exclusion d'IMG
[ptitvelo/web/www.git] / www / plugins-dist / compresseur / lib / csstidy / testing / unit-tests / class.Text_Diff_Renderer_parallel.php
1 <?php
2
3 /**
4 * Parallel diff renderer for HTML tables with original text on left,
5 * new text on right, and changed text highlighted with appropriate classes.
6 */
7 class Text_Diff_Renderer_parallel extends Text_Diff_Renderer
8 {
9 /** String header for left column */
10 var $original = 'Original';
11 /** String header for right column */
12 var $final = 'Final';
13 var $_leading_context_lines = 10000; // these are big to ensure entire string is output
14 var $_trailing_context_lines = 10000;
15 function _blockHeader() {}
16 function _startDiff() {
17 return '<table class="diff"><thead><tr><th>'. $this->original .'</th><th>'. $this->final .'</th></tr></thead><tbody>';
18 }
19 function _endDiff() {
20 return '</tbody></table>';
21 }
22 function _context($lines) {
23 return '<tr><td><pre>'. htmlspecialchars(implode("\n", $lines)) .'</pre></td>
24 <td><pre>'. htmlspecialchars(implode("\n", $lines)) .'</pre></td></tr>';
25 }
26 function _added($lines) {
27 return '<tr><td>&nbsp;</td><td class="added"><pre>'. htmlspecialchars(implode("\n", $lines)) .'</pre></td></tr>';
28 }
29 function _deleted($lines) {
30 return '<tr><td class="deleted"><pre>'. htmlspecialchars(implode("\n", $lines)) .'</pre></td><td>&nbsp;</td></tr>';
31 }
32 function _changed($orig, $final) {
33 return '<tr class="changed"><td><pre>'. htmlspecialchars(implode("\n", $orig)) .'</pre></td>
34 <td><pre>'. htmlspecialchars(implode("\n", $final)) .'</pre></td></tr>';
35 }
36 }