distinguish between user, admin, and public traditions; add preliminary app test
[scpubgit/stemmaweb.git] / root / js / componentload.js
CommitLineData
f007ac1e 1function loadTradition( textid, textname ) {
62723740 2 // First insert the placeholder image
538715bd 3 var basepath = window.location.pathname
a86eba5d 4 if( basepath.lastIndexOf('/') == basepath.length - 1 ) {
5 basepath = basepath.slice( 0, basepath.length - 1)
6 };
538715bd 7 var imghtml = '<img src="' + basepath + '/images/ajax-loader.gif" alt="Loading SVG..."/>'
62723740 8 $('#stemma_graph').empty();
62723740 9 $('#stemma_graph').append( imghtml );
62723740 10 // Then get and load the actual content.
f6a8db89 11 // TODO: scale #stemma_grpah both horizontally and vertically
12 // TODO: load svgs from SVG.Jquery (to make scaling react in Safari)
1e629119 13 $('#stemma_graph').load( basepath + "/stemma/" + textid );
f007ac1e 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 );
5ba6c2b4 23}