Merge branch 'master' of https://github.com/tla/stemmaweb
Tara L Andrews [Wed, 15 Jan 2014 18:52:42 +0000 (18:52 +0000)]
Makefile.PL
lib/stemmaweb/Controller/Root.pm
lib/stemmaweb/Controller/Stexaminer.pm
root/js/relationship.js
root/src/relate.tt
stemmaweb.conf

index a87978f..6dd80af 100644 (file)
@@ -12,7 +12,7 @@ all_from 'lib/stemmaweb.pm';
 # Tradition libraries
 requires 'Text::Tradition' => '1.2';
 requires 'Text::Tradition::Directory';
-requires 'Text::Tradition::Analysis';
+requires 'Text::Tradition::Analysis' => '1.3';
 requires 'Text::Tradition::StemmaUtil';
 # Catalyst libraries
 requires 'Catalyst::Runtime' => '5.90002';
index 8fa2489..bc86c30 100644 (file)
@@ -396,21 +396,6 @@ sub stemma :Local :Args(2) {
        if( $c->req->method eq 'POST' ) {
                if( $ok eq 'full' ) {
                        my $dot = $c->request->body_params->{'dot'};
-                       # Graph::Reader::Dot does not handle bare unicode. We get around this
-                       # by wrapping all words in double quotes, as long as they aren't already
-                       # wrapped, and as long as they aren't the initial '(di)?graph .*'.
-                       # Horrible HACK.
-                       my @dlines = split( "\n", $dot );
-                       my $wdot = '';
-                       foreach( @dlines ) {
-                               unless( /^(di)?graph/ ) { # Skip the first line
-                                       s/(?<!")\b(\w+)\b(?!")/"$1"/g;
-                               }
-                               $wdot .= "$_\n";
-                       }
-                       # $dot =~ s/(?<!")\b(?!(?:digraph|stemma)\b)(\w+)\b(?!")/"$1"/g;
-                       $dot = $wdot;
-                       print STDERR "$dot\n";
                        try {
                                if( $stemmaid eq 'n' ) {
                                        # We are adding a new stemma.
index ac4e005..ff4f69b 100644 (file)
@@ -9,6 +9,17 @@ use Text::Tradition::Stemma;
 
 BEGIN { extends 'Catalyst::Controller' }
 
+has idp_solver_url => (
+       is => 'ro',
+       isa => 'Str',
+       predicate => 'has_idp_solver_url',
+       );
+
+has idp_calcdsn => (
+       is => 'ro',
+       isa => 'Str',
+       predicate => 'has_idp_calcdsn',
+       );
 
 =head1 NAME
 
@@ -72,8 +83,12 @@ sub index :Path :Args(2) {
                } elsif( $ignore_sort eq 'orthographic' ) {
                        $analysis_options{'merge_types'} = 'orthographic';
                }
+               if( $self->has_idp_solver_url ) {
+                       $analysis_options{'solver_url'} = $self->idp_solver_url;
+               } elsif( $self->has_idp_calcdsn ) {
+                       $analysis_options{'calcdsn'} = $self->idp_calcdsn;
+               }
 
-               # Do the deed
                my $t = run_analysis( $tradition, %analysis_options );
                # Stringify the reading groups
                foreach my $loc ( @{$t->{'variants'}} ) {
index c98077b..0f5ae09 100644 (file)
@@ -800,8 +800,8 @@ function merge_nodes( source_node_id, target_node_id, consequences ) {
                 parent_g = svg.group( $('#svgenlargement svg g') );
                 var ids_text = node_ids[0] + '-' + node_ids[1]; 
                 var merge_id = 'merge-' + ids_text;
-                svg.image( parent_g, xC, (yC-8), 16, 16, '/images/tick_circle_frame.png', { id: merge_id } );
-                svg.image( parent_g, (xC+20), (yC-8), 16, 16, '/images/no_entry.png', { id: 'no' + merge_id } );
+                svg.image( parent_g, xC, (yC-8), 16, 16, merge_button_yes, { id: merge_id } );
+                svg.image( parent_g, (xC+20), (yC-8), 16, 16, merge_button_no, { id: 'no' + merge_id } );
                 $( '#' + merge_id ).hover( function(){ $(this).addClass( 'draggable' ) }, function(){ $(this).removeClass( 'draggable' ) } );
                 $( '#no' + merge_id ).hover( function(){ $(this).addClass( 'draggable' ) }, function(){ $(this).removeClass( 'draggable' ) } );
                 $( '#' + merge_id ).click( function( evt ){ 
index 15ae28d..b01ab41 100644 (file)
@@ -9,6 +9,9 @@ var basepath = "[% c.uri_for( '/relation/' ) %]";
 var textid = "[% textid %]";
 var can_morphologize = "[% can_morphologize %]";
 var editable = "[% permission %]" === "full";
+// URLs for images referenced in Javascript
+var merge_button_yes = "[% c.uri_for( '/images/tick_circle_frame.png' ) %]";
+var merge_button_no = "[% c.uri_for( '/images/no_entry.png' ) %]";
 [% IF error -%]
 var relationship_types = [];
 var relationship_scopes = [];
index 14dc998..b856c61 100644 (file)
@@ -1,6 +1,9 @@
 # rename this file to stemmaweb.yml and put a ':' after 'name' if
 # you want to use YAML like in old versions of Catalyst
 name = stemmaweb
+<Component Controller::Stexaminer>
+    idp_solver_url http://perf.byzantini.st/cgi-bin/graphcalc.cgi
+</Controller>
 <Model Directory>
     dsn dbi:SQLite:dbname=db/traditions.db
 </Model>