135
|
1 /*
|
|
2
|
|
3 Copyright (C) 2003 WTWG, Uni Bern
|
|
4
|
|
5 This program is free software; you can redistribute it and/or
|
|
6 modify it under the terms of the GNU General Public License
|
|
7 as published by the Free Software Foundation; either version 2
|
|
8 of the License, or (at your option) any later version.
|
|
9
|
|
10 This program is distributed in the hope that it will be useful,
|
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13 GNU General Public License for more details.
|
|
14
|
|
15 You should have received a copy of the GNU General Public License
|
|
16 along with this program; if not, write to the Free Software
|
|
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
|
18
|
|
19 Author: Christian Luginbuehl, 22.05.2003 , Version Alcatraz 0.4
|
|
20
|
|
21 */
|
|
22
|
|
23 /*************************************************************************
|
|
24 * newReferences.js : digilib-module *
|
|
25 * *
|
|
26 * desc: creates references in the new parameter format (key-value) *
|
|
27 * *
|
|
28 *************************************************************************/
|
|
29
|
|
30
|
|
31 /**
|
|
32 * ref, overriding original one
|
|
33 */
|
|
34 function ref(select) {
|
|
35
|
|
36 var hyperlinkRef = baseUrl + "/digilib.jsp?";
|
|
37
|
|
38 if ( select == 2 ) {
|
|
39
|
|
40 // no original size is referenced at the moment,
|
|
41 // because the dpi values are not constant from user to user
|
|
42 removeMoFlag('osize');
|
|
43
|
|
44 var parameterString = '';
|
|
45
|
|
46 for ( param in dlParams ) {
|
|
47 if ( (dlParams[param].detail < 9) && (dlParams[param].defaultValue != dlParams[param].value) ) {
|
|
48 parameterString += "&" + param + "=" + dlParams[param].value;
|
|
49 }
|
|
50 }
|
|
51
|
|
52 parameterString += "&lv=3"; // level three
|
|
53
|
|
54 parameterString = parameterString.slice(1);
|
|
55
|
|
56 prompt("Alcatraz-style HTML link", hyperlinkRef + parameterString);
|
|
57
|
|
58 } else {
|
|
59
|
|
60 var parameterString = '';
|
|
61
|
|
62 parameterString += dlParams.fn.value + "+" + dlParams.pn.value + "+" + dlParams.ws.value + "+";
|
|
63 parameterString += dlParams.mo.value + "+" + dlParams.mk.value;
|
|
64
|
|
65 if ( (dlParams.wx.value != 0) || (dlParams.wy.value != 0) || (dlParams.ww.value != 1) || (dlParams.wh.value != 1) ) {
|
|
66 parameterString += "+" + dlParams.wx.value + "+" + dlParams.wy.value + "+" + dlParams.ww.value;
|
|
67 parameterString += "+" + dlParams.wh.value;
|
|
68 }
|
|
69
|
|
70 if ( select == 1 ) {
|
|
71 prompt("Link for HTML-documents", hyperlinkRef+ parameterString);
|
|
72 }
|
|
73
|
|
74 if ( select == 0 ) {
|
|
75 prompt("Link for LaTeX-documents", "\\href{" + hyperlinkRef + parameterString + "}{TEXT}");
|
|
76 }
|
|
77 }
|
|
78 }
|