No changes, just syncing.
[scpubgit/stemmatology.git] / TreeOfTexts / root / js / interaction.js
1 var colors = ['#ffeeaa','#afc6e9','#d5fff6','#e5d5ff','#ffaaaa','#e5ff80','#ffccaa','#ffd5e5'];
2 var row_triggered = false;
3 $(document).ready(function() {
4   $('.rowid').click( function() {
5     row_triggered = true;
6     $('ellipse').attr( {stroke:'black', fill:'#fff'} );
7     $(this).parent().nextAll('.clickable').children('span').click();
8     row_triggered = false;
9   });
10 })
11 function color_nodes( column_index, arr_node_ids, arr_greynode_ids ) {
12   if( !row_triggered ) { 
13     $('ellipse').attr( {stroke:'black', fill:'#eee'} ) 
14   }; 
15   jQuery.each( arr_greynode_ids, function(index,value) {
16     $('.node').children('title').filter( function(index) {
17       return $(this).text() == value;
18     }).siblings('ellipse').each( function( index ) {
19         $(this).attr( {stroke:'black', fill:'#eee'} );
20       });
21   });
22   jQuery.each( arr_node_ids, function(index,value) {
23     $('.node').children('title').filter( function(index) {
24       return $(this).text() == value;
25     }).siblings('ellipse').each( function( index ) {
26         $(this).attr( {stroke:'black', fill:colors[column_index-1]} );
27       });
28   });
29 }
30
31 // 8 columns tied to colors, based on td position I guess
32 // click on row id: all colors on, remaining (unused) nodes greyed
33 // click on cell: those colors on, unused nodes greyed
34 // c
35
36 //