remove variant graph from front page, fix stemma scaling
[scpubgit/stemmaweb.git] / root / js / componentload.js
1 function loadTradition( textid, textname ) {
2     // First insert the placeholder image
3     var basepath = window.location.pathname
4     if( basepath.lastIndexOf('/') == basepath.length - 1 ) { 
5         basepath = basepath.slice( 0, basepath.length - 1) 
6     };
7     var imghtml = '<img src="' + basepath + '/images/ajax-loader.gif" alt="Loading SVG..."/>'
8     $('#stemma_graph').empty();
9     $('#stemma_graph').append( imghtml );
10     // Then get and load the actual content.
11     // TODO: scale #stemma_grpah both horizontally and vertically
12     // TODO: load svgs from SVG.Jquery (to make scaling react in Safari)
13         $('#stemma_graph').load( basepath + "/stemma/" + textid );
14         
15         // Then populate the various elements with the right text name/ID.
16         // Stemma and variant graph titles
17         $('.texttitle').empty();
18         $('.texttitle').append( textname );
19         // Stexaminer submit action
20         $('#run_stexaminer').attr( 'action', basepath + "/stexaminer/" + textid );
21         // Relationship mapper submit action
22         $('#run_relater').attr( 'action', basepath + "/relation/" + textid );
23 }