From: tla Date: Sun, 27 Oct 2013 13:33:19 +0000 (+0100) Subject: initial attempt at providing stemma title/label X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ec2f89ffc68331cd280429698e318f9a07e940cb;p=scpubgit%2Fstemmaweb.git initial attempt at providing stemma title/label --- diff --git a/.gitignore b/.gitignore index 19e0180..2879777 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ db/ +.DS_Store diff --git a/lib/stemmaweb/Controller/Root.pm b/lib/stemmaweb/Controller/Root.pm index f66dcd5..e62c924 100644 --- a/lib/stemmaweb/Controller/Root.pm +++ b/lib/stemmaweb/Controller/Root.pm @@ -322,7 +322,8 @@ sub textinfo :Local :Args(1) { if( $tradition->can('language') ) { $textinfo->{'language'} = $tradition->language; } - my @stemmasvg = map { $_->as_svg() } $tradition->stemmata; + my @stemmasvg = map { { name => $_->identifier, svg => $_->as_svg() } } + $tradition->stemmata; map { $_ =~ s/\n/ /mg } @stemmasvg; $textinfo->{stemmata} = \@stemmasvg; $c->stash->{'result'} = $textinfo; diff --git a/root/css/style.css b/root/css/style.css index 912400c..f20d337 100644 --- a/root/css/style.css +++ b/root/css/style.css @@ -172,6 +172,14 @@ div.pager_left_button.greyed_out, div.pager_left_button.greyed_out:hover { } #stemma_graph svg { } +#stemma_graph_title { + bottom: 0px; +} +#stemma_identifier { + color: #488dd2; + font-size: 12px; + font-weight: bold; +} #textinfo_container_buttons { z-index: 100; width: 224px; @@ -211,6 +219,10 @@ div.pager_left_button.greyed_out, div.pager_left_button.greyed_out:hover { font-weight: bold; color: #ff3333; } +.notification { + font-weight: bold; + color: #33ff33; +} #new_file { position: absolute; top: -50px; diff --git a/root/js/componentload.js b/root/js/componentload.js index 9c10c96..2a26927 100644 --- a/root/js/componentload.js +++ b/root/js/componentload.js @@ -134,7 +134,10 @@ function load_stemma( idx ) { selectedStemmaID = idx; show_stemmapager(); if( idx > -1 ) { - loadSVG( stemmata[idx] ); + // Load the SVG and identifier of the stemma + var stemmadata = stemmata[idx]; + loadSVG( stemmadata['svg'] ); + $('#stemma_identifier').empty().text( stemmadata['name'] ); // Stexaminer submit action var stexpath = _get_url([ "stexaminer", selectedTextID, idx ]); $('#run_stexaminer').attr( 'action', stexpath ); diff --git a/root/src/index.tt b/root/src/index.tt index 41bd149..6dc7ad2 100644 --- a/root/src/index.tt +++ b/root/src/index.tt @@ -83,6 +83,7 @@ var textOnLoad = "[% withtradition %]";
+
diff --git a/t/data/florilegium.dot b/t/data/florilegium.dot index f41b8d6..e5c10a0 100644 --- a/t/data/florilegium.dot +++ b/t/data/florilegium.dot @@ -1,4 +1,4 @@ -digraph Stemma { +digraph "stemma of Tomas" { "α" [ class=hypothetical ]; "γ" [ class=hypothetical ]; "δ" [ class=hypothetical ];