X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=root%2Fjs%2Frelationship.js;h=8eb8f80418317e9c9493e844a44fde43d0c71408;hb=51ca18ee409cde7cd9d70c147001294ec68006ca;hp=ed1b150f2998cfd7d16a7a5c45d7c05c3072f10c;hpb=05485bfd2130f51ff6625b247171891d085e7cc0;p=scpubgit%2Fstemmaweb.git diff --git a/root/js/relationship.js b/root/js/relationship.js index ed1b150..8eb8f80 100644 --- a/root/js/relationship.js +++ b/root/js/relationship.js @@ -1,30 +1,179 @@ -function getTextPath() { - var currpath = window.location.pathname - // Get rid of trailing slash - if( currpath.lastIndexOf('/') == currpath.length - 1 ) { - currpath = currpath.slice( 0, currpath.length - 1) - }; - // Get rid of query parameters - if( currpath.lastIndexOf('?') != -1 ) { - currpath = currpath.slice( 0, currpath.lastIndexOf('?') ); - }; - var path_elements = currpath.split('/'); - var textid = path_elements.pop(); - var basepath = path_elements.join( '/' ); - var path_parts = [ basepath, textid ]; - return path_parts; +var MARGIN=30; +var svg_root = null; +var svg_root_element = null; +var start_element_height = 0; +var reltypes = {}; +var readingdata = {}; + +jQuery.removeFromArray = function(value, arr) { + return jQuery.grep(arr, function(elem, index) { + return elem !== value; + }); +}; + +function arrayUnique(array) { + var a = array.concat(); + for(var i=0; i 9 ) { + nfboxsize = normal_form.length + 1; + } + $('#reading_normal_form').attr( 'size', nfboxsize ) + $('#reading_normal_form').val( normal_form ); + if( editable ) { + // Fill in the witnesses for the de-collation box. + $('#reading_decollate_witnesses').empty(); + $.each( reading_info['witnesses'], function( idx, wit ) { + $('#reading_decollate_witnesses').append( $('