annotate client/digitallibrary/modules/newReferences.js @ 382:ef1519f9cf42

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