use Moose;
use Moose::Util::TypeConstraints;
-enum 'RelationshipType' => qw( spelling orthographic grammatical meaning lexical
+enum 'RelationshipType' => qw( spelling orthographic grammatical lexical
collated repetition transposition );
enum 'RelationshipScope' => qw( local document global );
=over 4
-=item * type - Can be one of spelling, orthographic, grammatical, meaning, lexical, collated, repetition, transposition. All but the last two are only valid relationships between readings that occur at the same point in the text.
+=item * type - Can be one of spelling, orthographic, grammatical, lexical,
+collated, repetition, transposition. All but the last two are only valid
+relationships between readings that occur at the same point in the text.
+The 'collated' relationship should only be used by parsers to align readings
+in the graph when the input information would otherwise be lost, e.g. from
+an alignment table.
-=item * displayform - (Optional) The reading that should be displayed if the related nodes are treated as one.
+=item * displayform - (Optional) The reading that should be displayed if the
+related nodes are treated as one.
-=item * scope - (Optional) A meta-attribute. Can be one of 'local', 'document', or 'global'. Denotes whether the relationship between the two readings holds always, independent of context, either within this tradition or across all traditions.
+=item * scope - (Optional) A meta-attribute. Can be one of 'local',
+'document', or 'global'. Denotes whether the relationship between the two
+readings holds always, independent of context, either within this tradition
+or across all traditions.
-=item * anotation - (Optional) A freeform note to attach to the relationship.
+=item * annotation - (Optional) A freeform note to attach to the relationship.
-=item * non_correctable - (Optional) True if the reading would not have been corrected independently.
+=item * non_correctable - (Optional) True if the reading would not have been
+corrected independently.
-=item * non_independent - (Optional) True if the variant is unlikely to have occurred independently in unrelated witnesses.
+=item * non_independent - (Optional) True if the variant is unlikely to have
+occurred independently in unrelated witnesses.
=back
this.set_draggable = function( draggable ) {
if( draggable ) {
- self.ellipse.attr( {stroke:'black', fill:'#fff'} );
- self.ellipse.mousedown( this.mousedown_listener );
- self.ellipse.hover( this.enter_node, this.leave_node );
+ $(self.ellipse).attr( {stroke:'black', fill:'#fff'} );
+ $(self.ellipse).parent().mousedown( this.mousedown_listener );
+ $(self.ellipse).parent().hover( this.enter_node, this.leave_node );
+ self.ellipse.siblings('text').attr('class', 'noselect draggable');
} else {
- self.ellipse.unbind('mouseenter').unbind('mouseleave').unbind('mousedown');
- self.ellipse.attr( {stroke:'green', fill:'#b3f36d'} );
+ self.ellipse.siblings('text').attr('class', '');
+ $(self.ellipse).parent().unbind('mouseenter').unbind('mouseleave').unbind('mousedown');
+ $(self.ellipse).attr( {stroke:'green', fill:'#b3f36d'} );
}
}
self.y = evt.clientY;
$('body').mousemove( self.mousemove_listener );
$('body').mouseup( self.mouseup_listener );
- self.ellipse.unbind('mouseenter').unbind('mouseleave')
+ $(self.ellipse).parent().unbind('mouseenter').unbind('mouseleave')
self.ellipse.attr( 'fill', '#ff66ff' );
first_node_g_element = $("#svgenlargement g .node" ).filter( ":first" );
if( first_node_g_element.attr('id') !== self.get_g().attr('id') ) { self.get_g().insertBefore( first_node_g_element ) };
self.dx = (evt.clientX - self.x) / mouse_scale;
self.dy = (evt.clientY - self.y) / mouse_scale;
self.move_elements();
+ evt.returnValue = false;
+ evt.preventDefault();
+ return false;
}
this.mouseup_listener = function(evt) {
if( $('ellipse[fill="#ffccff"]').size() > 0 ) {
var source_node_id = self.ellipse.siblings('title').text();
+ var source_node_text = self.ellipse.siblings('text').text();
var target_node_id = $('ellipse[fill="#ffccff"]').siblings("title").text();
+ var target_node_text = $('ellipse[fill="#ffccff"]').siblings("text").text();
$('#source_node_id').val( source_node_id );
+ $('#source_node_text').val( source_node_text );
$('#target_node_id').val( target_node_id );
+ $('#target_node_text').val( target_node_text );
$('#dialog-form').dialog( 'open' );
};
$('body').unbind('mousemove');
$('body').unbind('mouseup');
self.ellipse.attr( 'fill', '#fff' );
- self.ellipse.hover( self.enter_node, self.leave_node );
+ $(self.ellipse).parent().hover( self.enter_node, self.leave_node );
self.reset_elements();
}
if( this.svg_element.parent(filter).size() != 0 ) {
this.svg_element.attr('stroke', '#e5e5e5');
this.svg_element.siblings('text').attr('fill', '#e5e5e5');
+ this.svg_element.siblings('text').attr('class', 'noselect');
}
}
this.un_grey_out = function(filter) {
if( this.svg_element.parent(filter).size() != 0 ) {
this.svg_element.attr('stroke', '#000000');
this.svg_element.siblings('text').attr('fill', '#000000');
+ this.svg_element.siblings('text').attr('class', '');
}
}
}