Mercurial > hg > ismi-richfaces
diff src/main/webapp/imageServer/resources/js/diva4ismi.js @ 70:954d6200336d
display live reference from Drupal in edit form (ticket #71).
author | casties |
---|---|
date | Wed, 16 Dec 2015 20:53:12 +0100 |
parents | e15c7ddeb76c |
children | f2c1e5be355c |
line wrap: on
line diff
--- a/src/main/webapp/imageServer/resources/js/diva4ismi.js Wed Dec 16 18:26:34 2015 +0100 +++ b/src/main/webapp/imageServer/resources/js/diva4ismi.js Wed Dec 16 20:53:12 2015 +0100 @@ -108,31 +108,32 @@ -function showBibliographyEntryFormatted(bibId, bibInf, bibLoc){ - // extract endnote id number, call formatbiblioNumeric - var numIdPat = /#(\d+)/; - var numIdRes = numIdPat.exec(bibId); - var id = numIdRes[1]; +function showBibliographyEntryFormatted(bibId, bibInf, bibLoc) { + // extract endnote id number, call formatbiblioNumeric + var numIdPat = /#(\d+)/; + var numIdRes = numIdPat.exec(bibId); + var id = numIdRes[1]; var loc = bibLoc; - console.debug("setting up bib id="+id+" at loc="+loc); - $.ajax({ - url: divaGlobal.drupal_url+"/formatbiblioNumeric/"+id, - type: 'GET', - success: function(data){ - console.debug("got bib id="+id+" for loc="+loc); - //inserting the template in this document - //mache rel urls zu absoluten - if (data.nodes.length > 0) { - // FIXME: better handling of relative URLs - var ref = data.nodes[0].node.citation.replace(new RegExp("/drupal-ismi","g"),divaGlobal.drupal_url); - var bib = $(loc); - bib.html(ref); - } - }, - error: function(data) { - console.error('unable to load formatted bib entry ' + id); - } - }); + console.debug("setting up bib id=" + id + " at loc=" + loc); + $.ajax({ + url : divaGlobal.drupal_url + "/formatbiblioNumeric/" + id, + type : 'GET', + success : function(data) { + console.debug("got bib id=" + id + " for loc=" + loc); + // inserting the template in this document + // mache rel urls zu absoluten + if (data.nodes.length > 0) { + // FIXME: better handling of relative URLs + var ref = data.nodes[0].node.citation.replace(new RegExp( + "/drupal-ismi", "g"), divaGlobal.drupal_url); + var bib = $(loc); + bib.html(ref); + } + }, + error : function(data) { + console.error('unable to load formatted bib entry ' + id); + } + }); } function loadWitnessInformation(json, titleId){