From: Tara L Andrews Date: Thu, 2 Feb 2012 23:23:51 +0000 (+0100) Subject: use paths relative to our base X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=538715bda63c2c89e535baabbdf7d8910c64ac03;p=scpubgit%2Fstemmaweb.git use paths relative to our base --- diff --git a/root/js/componentload.js b/root/js/componentload.js index c9e3175..c233b15 100644 --- a/root/js/componentload.js +++ b/root/js/componentload.js @@ -1,6 +1,7 @@ function loadTradition( textid ) { // First insert the placeholder image - var imghtml = 'Loading SVG...' + var basepath = window.location.pathname + var imghtml = 'Loading SVG...' $('#stemma_graph').empty(); $('#variant_graph').empty(); $('#stemma_graph').append( imghtml ); @@ -8,12 +9,12 @@ function loadTradition( textid ) { // Then get and load the actual content. // TODO: scale #stemma_grpah both horizontally and vertically // TODO: load svgs from SVG.Jquery (to make scaling react in Safari) - $('#stemma_graph').load( "stemma/" + textid , function() { + $('#stemma_graph').load( basepath + "/stemma/" + textid , function() { var stemma_svg_element = $('#stemma_graph svg').svg().svg('get').root(); console.log( stemma_svg_element ); stemma_svg_element.height.baseVal.value = $('#stemma_graph').height(); }); - $('#variant_graph').load( "variantgraph/" + textid , function() { + $('#variant_graph').load( basepath + "/variantgraph/" + textid , function() { var variant_svg_element = $('#variant_graph svg').svg().svg('get').root(); var svg_height = variant_svg_element.height.baseVal.value; var svg_width = variant_svg_element.width.baseVal.value; diff --git a/root/src/index.tt b/root/src/index.tt index 910b1d1..90d0437 100644 --- a/root/src/index.tt +++ b/root/src/index.tt @@ -1,6 +1,6 @@ [% WRAPPER header.tt pagetitle = "Stemmaweb - Text tradition tools" - applicationjs = "js/componentload.js" + applicationjs = c.uri_for( 'js/componentload.js' ) %]