make standalone svg rendering inside an HTML page
Tara L Andrews [Mon, 10 Oct 2011 14:01:43 +0000 (16:01 +0200)]
TreeOfTexts/lib/TreeOfTexts/Controller/Root.pm
TreeOfTexts/root/src/stemma_gadget.tt [new file with mode: 0644]

index e9deda3..82cc961 100644 (file)
@@ -62,8 +62,8 @@ sub view_svg :Local {
     my( $self, $c ) = @_;
     my $m = $c->model( 'Analysis' );
     my $t = $m->{'data'}->[ $c->request->params->{'textid'} ];
-    $c->stash->{result} = $t->{'svg'};
-    $c->forward( "View::SVG" );
+       $c->stash->{svg} = $t->{'svg'};
+    $c->stash->{template} = 'stemma_gadget.tt';
 }
 
 
diff --git a/TreeOfTexts/root/src/stemma_gadget.tt b/TreeOfTexts/root/src/stemma_gadget.tt
new file mode 100644 (file)
index 0000000..17160d5
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
+    <script type="text/javascript" src="js/jquery-ui-1.8.10.custom.min.js"></script>
+    <script type="text/javascript" src="js/interaction.js"></script>
+    <link type="text/css" href="[% c.uri_for('css/cupertino/jquery-ui-1.8.13.custom.css') %]" rel="stylesheet" />
+    [% INCLUDE style.tt2 %]
+  </head>
+  <body>
+    <div id="svg_graph">
+      [% svg %]
+    </div>
+  </body>
+</html>