Commit | Line | Data |
57acbbe2 |
1 | function loadTradition( textid, textname ) { |
56455620 |
2 | // First insert the placeholder image |
abc6a992 |
3 | var basepath = window.location.pathname |
3e420a82 |
4 | if( basepath.lastIndexOf('/') == basepath.length - 1 ) { |
5 | basepath = basepath.slice( 0, basepath.length - 1) |
6 | }; |
abc6a992 |
7 | var imghtml = '<img src="' + basepath + '/images/ajax-loader.gif" alt="Loading SVG..."/>' |
56455620 |
8 | $('#stemma_graph').empty(); |
56455620 |
9 | $('#stemma_graph').append( imghtml ); |
56455620 |
10 | // Then get and load the actual content. |
e2f647b9 |
11 | // TODO: scale #stemma_grpah both horizontally and vertically |
12 | // TODO: load svgs from SVG.Jquery (to make scaling react in Safari) |
5a7e26a9 |
13 | $('#stemma_graph').load( basepath + "/stemma/" + textid ); |
57acbbe2 |
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 ); |
a88e75b1 |
23 | } |