Changes for page Creating a Tree View

Last modified by Ecaterina Moraru (Valica) on 2017/09/06

From version 1.2
edited by Marius Dumitru Florea
on 2015/07/28
Change comment: There is no comment for this version
To version 2.1
edited by Marius Dumitru Florea
on 2015/07/28
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,3 +1,5 @@
1 +{{template name="diff_macros.vm"/}}
2 +
1 1  {{velocity output="false"}}
2 2  #macro (unifiedDocContentDiff $alice $bob)
3 3   #set ($previous = $xwiki.getDocument($alice).content)
... ... @@ -6,51 +6,6 @@
6 6   #unifiedDiff($previous $next)
7 7   {{/html}}
8 8  #end
9 -
10 -#macro (unifiedDiff $previous $next)
11 - #set ($discard = $xwiki.ssfx.use('uicomponents/viewers/diff.css', true))
12 - <div class="diff-container">
13 - <table>
14 - #foreach ($block in $services.diff.display.unified($previous, $next))
15 - <tr>
16 - <td class="diff-line-number">...</td>
17 - <td class="diff-line-number">...</td>
18 - <td class="diff-line diff-line-meta">@@ -$mathtool.add($block.previousStart, 1),$block.previousSize +$mathtool.add($block.nextStart, 1),$block.nextSize @@</td>
19 - </tr>
20 - #foreach ($line in $block)
21 - <tr>
22 - #set ($lineNumber = $line.index + 1)
23 - <td class="diff-line-number">#if (!$line.added)$lineNumber#end</td>
24 - <td class="diff-line-number">#if (!$line.deleted)$lineNumber#end</td>
25 - <td class="diff-line diff-line-$line.type.toString().toLowerCase()">#unifiedDiffLine($line)</td>
26 - </tr>
27 - #end
28 - #end
29 - </table>
30 - </div>
31 -#end
32 -
33 -#macro (unifiedDiffLine $line)
34 -${line.type.symbol}##
35 -#if ($line.chunks)##
36 -#inlineDiffLine($line.chunks)##
37 -#else##
38 -$escapetool.xml($line.value)##
39 -#end
40 -#end
41 -
42 -#macro (inlineDiffLine $chunks)
43 -#foreach ($chunk in $chunks)
44 -#set ($escapedChunk = $escapetool.xml($chunk))
45 -#if ($chunk.added)##
46 -<ins>$escapedChunk</ins>##
47 -#elseif ($chunk.deleted)##
48 -<del>$escapedChunk</del>##
49 -#else##
50 -$escapedChunk##
51 -#end
52 -#end
53 -#end
54 54  {{/velocity}}
55 55  
56 56  == Agenda ==

Get Connected