[tei-council] Popup bibliography references in the Guidelines

Martin Holmes mholmes at uvic.ca
Thu Jul 3 20:22:38 EDT 2014


Some of you might remember that last year I added some JavaScript to the 
Guidelines HTML output that modifies what used to be jumping-links from 
the text down to the footnotes into a slightly more elegant system 
whereby a footnote now shows in a popup without causing your browser 
window to jump around. For a long while I've been intending to extend 
that so that it also handles bibliography links. I had time to do that 
on the plane home, and it's now in the Jenkins builds. For example, if 
you go here:

<http://teijenkins.hcmc.uvic.ca/job/TEIP5/lastSuccessfulBuild/artifact/release/doc/tei-p5-doc/en/html/CE.html>

and look for the reference "Kay (ed.) (2007)" and click on it, you 
should see it show in a popup instead of bouncing you off to the 
BIB.html page.

As with the previous footnote code, this fails gracefully; if you have 
JavaScript turned off, or your browser refuses to do this for some 
reason, you'll just default to bouncing to the BIB page as before. If 
you're looking at a purely local copy of the Guidelines on your hard 
drive, Chrome does refuse to do this because it's suspicious of your 
intentions, so you just get the normal link behaviour.

I've tested this in Firefox, Chrome, and Opera on Linux, and IE on 
Windows, and it seems to be working everywhere. I'd appreciate a bit of 
testing on Safari and on Mac versions of browsers if you have a minute.

For anyone interested in how this works: it creates an invisible iframe 
after the page has loaded, and loads the BIB.html page into it, so that 
it can then retrieve the bibl references from there and put them in the 
popup. There is no actual change to the Guidelines HTML code at all; 
it's all done by JS that runs after the page loads. I'm as uncomfortable 
with iframes as the next person, but this one never actually appears in 
our HTML, so I think it's worth it.

Cheers,
Martin


More information about the tei-council mailing list