From: Tara L Andrews Date: Mon, 20 Jan 2014 22:44:38 +0000 (+0100) Subject: allow relationship colors in SVG download; work around inability to close Download... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2Fstemmaweb.git;a=commitdiff_plain;h=8e26de0f2079f2b952536a2be1af1ba159eba5c5 allow relationship colors in SVG download; work around inability to close Download dialog. Addresses #34 --- diff --git a/lib/stemmaweb/Controller/Root.pm b/lib/stemmaweb/Controller/Root.pm index 29e1414..c772122 100644 --- a/lib/stemmaweb/Controller/Root.pm +++ b/lib/stemmaweb/Controller/Root.pm @@ -532,8 +532,16 @@ sub download :Local :Args(2) { my $view = "View::$format"; $c->stash->{'name'} = $tradition->name(); $c->stash->{'download'} = 1; + my @outputargs; + if( $format eq 'SVG' ) { + # Send the list of colors through to the backend. + # TODO Think of some way not to hard-code this. + push( @outputargs, { 'show_relations' => 'all', + 'graphcolors' => [ "#5CCCCC", "#67E667", "#F9FE72", "#6B90D4", + "#FF7673", "#E467B3", "#AA67D5", "#8370D8", "#FFC173" ] } ); + } try { - $c->stash->{'result'} = $tradition->collation->$outmethod(); + $c->stash->{'result'} = $tradition->collation->$outmethod( @outputargs ); } catch( Text::Tradition::Error $e ) { return _json_error( $c, 500, $e->message ); } diff --git a/root/js/componentload.js b/root/js/componentload.js index cd9307f..888bf69 100644 --- a/root/js/componentload.js +++ b/root/js/componentload.js @@ -646,9 +646,8 @@ $(document).ready( function() { Download: function (evt) { var dlurl = _get_url([ "download", $('#download_tradition').val(), $('#download_format').val() ]); window.location = dlurl; - $('download-dialog').dialog('close'); }, - Cancel: function() { + Done: function() { $('#download-dialog').dialog('close'); } },