velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r629293 - in /velocity/tools/trunk/examples/showcase: demo.vm fullDemo.vm
Date Wed, 20 Feb 2008 01:00:39 GMT
Author: nbubna
Date: Tue Feb 19 17:00:33 2008
New Revision: 629293

URL: http://svn.apache.org/viewvc?rev=629293&view=rev
Log:
break 'fullDemo' section out so it can be used for tools who only need that for their demo
page

Added:
    velocity/tools/trunk/examples/showcase/fullDemo.vm   (with props)
Modified:
    velocity/tools/trunk/examples/showcase/demo.vm

Modified: velocity/tools/trunk/examples/showcase/demo.vm
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/examples/showcase/demo.vm?rev=629293&r1=629292&r2=629293&view=diff
==============================================================================
--- velocity/tools/trunk/examples/showcase/demo.vm (original)
+++ velocity/tools/trunk/examples/showcase/demo.vm Tue Feb 19 17:00:33 2008
@@ -166,44 +166,4 @@
 </tr>
 </table>
 
-## look for a full demo in the params
-#set( $fullDemo = $params.fullDemo )
-#if( !$fullDemo )
-  ## see if one was set in the parent template
-  #if( $toolDemo )
-    #set( $fullDemo = $toolDemo )
-  #else
-    ## ok, try looking for one in the resources
-    #set( $fullDemo = $text.get("${toolname}.fullDemo") )
-    #if( !$fullDemo.exists )
-      ## give up and hide the full demo
-      #set( $fullDemo = false )
-    #end
-  #end
-#end
-#if( $fullDemo )
-  #set( $dims = $display.measure($fullDemo) )
-  <div align="center">
-    <a name="fullDemo"><h3>$demo.mainExampleHeader</h3></a>
-    <form method="post" action="$link.self.anchor('fullDemo')">
-      <textarea name="fullDemo" rows="$dims.height" cols="$dims.width">$!fullDemo</textarea>
-      <br>
-      <input type="submit" value="$demo.try">
-      ## maintain params for all the other demos
-      #foreach( $param in $params.all.keySet() )
-        #if( $param != 'fullDemo' )
-          #foreach( $value in $params.getStrings($param) )
-            <input type="hidden" name="$param" value="$esc.html($value)">
-          #end
-        #end
-      #end
-    </form>
-    ## evaluate and display results if they hit submit
-    #if( $params.fullDemo )
-      $demo.mainResultsIntro:
-      <pre>
-        $render.eval($params.fullDemo)
-      </pre>
-    #end
-  </div>
-#end
\ No newline at end of file
+#parse( 'fullDemo.vm' )

Added: velocity/tools/trunk/examples/showcase/fullDemo.vm
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/examples/showcase/fullDemo.vm?rev=629293&view=auto
==============================================================================
--- velocity/tools/trunk/examples/showcase/fullDemo.vm (added)
+++ velocity/tools/trunk/examples/showcase/fullDemo.vm Tue Feb 19 17:00:33 2008
@@ -0,0 +1,47 @@
+## make sure we have access to demo resources
+#if( !$demo )
+  #set( $demo = $text.demo )
+#end
+
+## look for a full demo in the params
+#set( $fullDemo = $params.fullDemo )
+#if( !$fullDemo )
+  ## see if one was set in the parent template
+  #if( $toolDemo )
+    #set( $fullDemo = $toolDemo )
+  #else
+    ## ok, try looking for one in the resources
+    #set( $fullDemo = $text.get("${toolname}.fullDemo") )
+    #if( !$fullDemo.exists )
+      ## give up and hide the full demo
+      #set( $fullDemo = false )
+    #end
+  #end
+#end
+
+#if( $fullDemo )
+  #set( $dims = $display.measure($fullDemo) )
+  <div align="center">
+    <a name="fullDemo"><h3>$demo.mainExampleHeader</h3></a>
+    <form method="post" action="$link.self.anchor('fullDemo')">
+      <textarea name="fullDemo" rows="$dims.height" cols="$dims.width">$!fullDemo</textarea>
+      <br>
+      <input type="submit" value="$demo.try">
+      ## maintain params for all the other demos
+      #foreach( $param in $params.all.keySet() )
+        #if( $param != 'fullDemo' )
+          #foreach( $value in $params.getStrings($param) )
+            <input type="hidden" name="$param" value="$esc.html($value)">
+          #end
+        #end
+      #end
+    </form>
+    ## evaluate and display results if they hit submit
+    #if( $params.fullDemo )
+      $demo.mainResultsIntro:
+      <pre>
+        $render.eval($params.fullDemo)
+      </pre>
+    #end
+  </div>
+#end

Propchange: velocity/tools/trunk/examples/showcase/fullDemo.vm
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message