summaryrefslogtreecommitdiff
path: root/biblio/bibtex/utils/bib2xhtml/showeg.js
blob: 77e2e0300f324d636844f0389eceb2ef538ec93b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * Show the example file specified.
 *
 * $Id: showeg.js,v 1.1 2010/12/08 18:47:48 dds Exp $
 */

function showBib(form) {
	for(i = 0; i < form.style.length; i++)
		if( form.style[i].checked)
			style = form.style[i].value;
	if ((style == 'empty' ||
	     style == 'paragraph' ||
	     style == 'unsortlist') &&
	     form.append.checked) {
		alert ('The specified style does not support the display of BibTeX keys');
		return;
	}
	if ((style == 'unsort' || style == 'unsortlist') &&
	    (form.chrono.checked || form.reverse.checked)) {
		alert ('Unsorted styles do not support a sort specification');
		return;
	}
	open('eg/' +
		style +
		(form.name.checked ? form.name.value : '') +
		(form.unicode.checked ? form.unicode.value : '') +
		(form.chrono.checked ? form.chrono.value : '') +
		(form.reverse.checked ? form.reverse.value : '') +
		(form.append.checked ? form.append.value : '') +
		'.html'
	);
}