106
|
1 /*
|
134
|
2
|
106
|
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
|
134
|
19 Author: Christian Luginbuehl, 22.05.2003 , Version Alcatraz 0.4
|
|
20
|
106
|
21 */
|
|
22
|
134
|
23 /*************************************************************************
|
|
24 * fitGIFs.js : digilib-module *
|
|
25 * *
|
|
26 * desc: enable od disable the fitting of GIF/PNG images to the *
|
|
27 * drawing area.
|
|
28 * *
|
|
29 *************************************************************************/
|
106
|
30
|
|
31
|
|
32 /**
|
|
33 * fitGIFs
|
|
34 */
|
|
35 function fitGIFs() {
|
|
36
|
134
|
37 if ( dlParams.mo.value != '' ) {
|
106
|
38
|
134
|
39 idx_plus_after = dlParams.mo.value.indexOf("fit,");
|
|
40 idx_plus_before = dlParams.mo.value.indexOf(",fit");
|
|
41 idx_noplus = dlParams.mo.value.indexOf("fit");
|
106
|
42
|
134
|
43 if ( idx_plus_after > -1 ) {
|
|
44 dlParams.mo.value = dlParams.mo.value.slice(0, idx_plus_after) + dlParams.mo.value.slice(idx_plus_after+5);
|
|
45 } else if ( idx_plus_before > -1 ) {
|
|
46 dlParams.mo.value = dlParams.mo.value.slice(0, idx_plus_before) + dlParams.mo.value.slice(idx_plus_before+5);
|
|
47 } else if ( idx_noplus > -1 ) {
|
|
48 dlParams.mo.value = dlParams.mo.value.slice(0, idx_noplus) + dlParams.mo.value.slice(idx_noplus+4);
|
106
|
49 } else {
|
134
|
50 dlParams.mo.value += ",fit";
|
106
|
51 }
|
|
52 } else {
|
134
|
53 dlParams.mo.value = "fit";
|
106
|
54 }
|
|
55
|
134
|
56 display(3);
|
106
|
57
|
134
|
58 } |