X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=root%2Fjs%2Frelationship.js;h=c98077b7963aa88b9d2bc9e6dc8d1133ce3e60ff;hb=161434162a8c2c998c9b98095969696e5798dd18;hp=3c271c466060ad0bfd3fb2658381aba6be8db5af;hpb=f2fb96fc32004e84c19df3cbf3d5eb00b99c11c7;p=scpubgit%2Fstemmaweb.git diff --git a/root/js/relationship.js b/root/js/relationship.js index 3c271c4..c98077b 100644 --- a/root/js/relationship.js +++ b/root/js/relationship.js @@ -5,36 +5,29 @@ var start_element_height = 0; var reltypes = {}; var readingdata = {}; -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; -} +jQuery.removeFromArray = function(value, arr) { + return jQuery.grep(arr, function(elem, index) { + return elem !== value; + }); +}; -function getRelativePath() { - var path_parts = getTextPath(); - return path_parts[0]; -} +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( $('