From: Tara L Andrews Date: Wed, 5 Sep 2012 09:53:35 +0000 (+0200) Subject: add index page link to stexaminer and relmapper X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5d9fd8da27f68c0b403533cbd81f5ab141c13f12;p=scpubgit%2Fstemmatology.git add index page link to stexaminer and relmapper --- diff --git a/stemmaweb/lib/stemmaweb/Controller/Root.pm b/stemmaweb/lib/stemmaweb/Controller/Root.pm index d4184aa..c3812e7 100644 --- a/stemmaweb/lib/stemmaweb/Controller/Root.pm +++ b/stemmaweb/lib/stemmaweb/Controller/Root.pm @@ -33,6 +33,10 @@ components will be loaded. sub index :Path :Args(0) { my ( $self, $c ) = @_; + # Are we being asked to load a text immediately? If so + if( $c->req->param('withtradition') ) { + $c->stash->{'withtradition'} = $c->req->param('withtradition'); + } $c->stash->{template} = 'index.tt'; } diff --git a/stemmaweb/lib/stemmaweb/Controller/Stexaminer.pm b/stemmaweb/lib/stemmaweb/Controller/Stexaminer.pm index 80d8827..37c2dea 100644 --- a/stemmaweb/lib/stemmaweb/Controller/Stexaminer.pm +++ b/stemmaweb/lib/stemmaweb/Controller/Stexaminer.pm @@ -40,6 +40,7 @@ sub index :Path :Args(2) { my $stemma = $tradition->stemma( $stemid ); $c->stash->{svg} = $stemma->as_svg( { size => [ 600, 350 ] } ); $c->stash->{graphdot} = $stemma->editable({ linesep => ' ' }); + $c->stash->{text_id} = $textid; $c->stash->{text_title} = $tradition->name; $c->stash->{template} = 'stexaminer.tt'; diff --git a/stemmaweb/root/src/directory.tt b/stemmaweb/root/src/directory.tt index d7d6266..dbe1547 100644 --- a/stemmaweb/root/src/directory.tt +++ b/stemmaweb/root/src/directory.tt @@ -5,7 +5,7 @@ @@ -18,7 +18,7 @@ diff --git a/stemmaweb/root/src/index.tt b/stemmaweb/root/src/index.tt index e2e8192..53bf324 100644 --- a/stemmaweb/root/src/index.tt +++ b/stemmaweb/root/src/index.tt @@ -7,6 +7,7 @@ var basepath = window.location.pathname if( basepath.lastIndexOf('/') == basepath.length - 1 ) { basepath = basepath.slice( 0, basepath.length - 1) }; +var textOnLoad = "[% withtradition %]"; var selectedTextID; var selectedTextInfo; var selectedStemmaID = -1; @@ -20,6 +21,13 @@ function refreshDirectory () { if (status == "error") { var msg = "An error occurred: "; $("#directory").html(msg + xhr.status + " " + xhr.statusText); + } else { + if( textOnLoad != "" ) { + // Call the click callback for the relevant text, if it is + // in the page. + $('#'+textOnLoad).click(); + textOnLoad = ""; + } } } ); @@ -232,7 +240,7 @@ $(document).ready( function() {

Stemmaweb - a collection of tools for analysis of collated texts

- [% IF c.user_exists %]Hello! [% c.user.get_object.email %] Sign out | [% ELSE %]Login | Register | [% END %]About + [% IF c.user_exists %]Hello! [% c.user.get_object.email %] Sign out | [% ELSE %]Login | [% END %]About

Text directory

diff --git a/stemmaweb/root/src/relate.tt b/stemmaweb/root/src/relate.tt index f71282d..95af6d6 100644 --- a/stemmaweb/root/src/relate.tt +++ b/stemmaweb/root/src/relate.tt @@ -13,7 +13,7 @@ $(document).ready(function () {

Relationship mapper

[% text_title %]

diff --git a/stemmaweb/root/src/stexaminer.tt b/stemmaweb/root/src/stexaminer.tt index 379e9f9..2f1a117 100644 --- a/stemmaweb/root/src/stexaminer.tt +++ b/stemmaweb/root/src/stexaminer.tt @@ -10,7 +10,7 @@ var graphdot = '[% graphdot %]'; [% END -%]

Stexaminer

[% text_title %]