From: David ‘Bombe’ Roden Date: Fri, 1 Apr 2011 09:28:37 +0000 (+0200) Subject: Store original and parsed text in contenxt, compare to hide “toggle” link. X-Git-Tag: 0.6^2~32 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=9bb096a81834b63f5574c7f7231ad35271afc058 Store original and parsed text in contenxt, compare to hide “toggle” link. This also requires the latest snapshot of utils for the “text” parameter of the StoreFilter. --- diff --git a/pom.xml b/pom.xml index 0dfac6e..985ceb0 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ net.pterodactylus utils - 0.9.1 + 0.9.2-SNAPSHOT junit diff --git a/src/main/resources/templates/include/viewPost.html b/src/main/resources/templates/include/viewPost.html index 676fa6a..4600d45 100644 --- a/src/main/resources/templates/include/viewPost.html +++ b/src/main/resources/templates/include/viewPost.html @@ -16,8 +16,10 @@ <%/if> <%/if> -
<% post.text|html>
-
<% post.text|parse sone=post.sone>
+ <% post.text|html|store key=originalText text=true> + <% post.text|parse sone=post.sone|store key=parsedText text=true> +
<% originalText>
+
<% parsedText>
@@ -36,8 +38,10 @@
· - · - + <%if ! originalText|match key=parsedText> + · + + <%/if>
· ↑ diff --git a/src/main/resources/templates/include/viewReply.html b/src/main/resources/templates/include/viewReply.html index e179e01..5dc26fb 100644 --- a/src/main/resources/templates/include/viewReply.html +++ b/src/main/resources/templates/include/viewReply.html @@ -8,13 +8,17 @@
-
<% reply.text|html>
-
<% reply.text|parse sone=reply.sone>
+ <% reply.text|html|store key=originalText text=true> + <% reply.text|parse sone=reply.sone|store key=parsedText text=true> +
<% originalText>
+
<% parsedText>
<% reply.time|date format="MMM d, yyyy, HH:mm:ss">
- · - + <%if ! originalText|match key=parsedText> + · + + <%/if>
· ↑