annotate client/digitallibrary/modules/fitGIFs.js @ 242:e2c455c2a0d0

new digimage with red triangles for moving the zoomed area (can be switched off with "clop=noarrows")
author robcast
date Wed, 04 Aug 2004 20:35:35 +0200
parents 1a0496201c75
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
106
19edc2593b88 Initial revision
engler
parents:
diff changeset
1 /*
134
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
2
106
19edc2593b88 Initial revision
engler
parents:
diff changeset
3 Copyright (C) 2003 WTWG, Uni Bern
19edc2593b88 Initial revision
engler
parents:
diff changeset
4
19edc2593b88 Initial revision
engler
parents:
diff changeset
5 This program is free software; you can redistribute it and/or
19edc2593b88 Initial revision
engler
parents:
diff changeset
6 modify it under the terms of the GNU General Public License
19edc2593b88 Initial revision
engler
parents:
diff changeset
7 as published by the Free Software Foundation; either version 2
19edc2593b88 Initial revision
engler
parents:
diff changeset
8 of the License, or (at your option) any later version.
19edc2593b88 Initial revision
engler
parents:
diff changeset
9
19edc2593b88 Initial revision
engler
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
19edc2593b88 Initial revision
engler
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
19edc2593b88 Initial revision
engler
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19edc2593b88 Initial revision
engler
parents:
diff changeset
13 GNU General Public License for more details.
19edc2593b88 Initial revision
engler
parents:
diff changeset
14
19edc2593b88 Initial revision
engler
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
19edc2593b88 Initial revision
engler
parents:
diff changeset
16 along with this program; if not, write to the Free Software
19edc2593b88 Initial revision
engler
parents:
diff changeset
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19edc2593b88 Initial revision
engler
parents:
diff changeset
18
134
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
19 Author: Christian Luginbuehl, 22.05.2003 , Version Alcatraz 0.4
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
20
106
19edc2593b88 Initial revision
engler
parents:
diff changeset
21 */
19edc2593b88 Initial revision
engler
parents:
diff changeset
22
134
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
23 /*************************************************************************
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
24 * fitGIFs.js : digilib-module *
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
25 * *
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
26 * desc: enable od disable the fitting of GIF/PNG images to the *
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
27 * drawing area.
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
28 * *
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
29 *************************************************************************/
106
19edc2593b88 Initial revision
engler
parents:
diff changeset
30
19edc2593b88 Initial revision
engler
parents:
diff changeset
31
19edc2593b88 Initial revision
engler
parents:
diff changeset
32 /**
19edc2593b88 Initial revision
engler
parents:
diff changeset
33 * fitGIFs
19edc2593b88 Initial revision
engler
parents:
diff changeset
34 */
19edc2593b88 Initial revision
engler
parents:
diff changeset
35 function fitGIFs() {
19edc2593b88 Initial revision
engler
parents:
diff changeset
36
134
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
37 if ( dlParams.mo.value != '' ) {
106
19edc2593b88 Initial revision
engler
parents:
diff changeset
38
134
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
39 idx_plus_after = dlParams.mo.value.indexOf("fit,");
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
40 idx_plus_before = dlParams.mo.value.indexOf(",fit");
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
41 idx_noplus = dlParams.mo.value.indexOf("fit");
106
19edc2593b88 Initial revision
engler
parents:
diff changeset
42
134
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
43 if ( idx_plus_after > -1 ) {
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
44 dlParams.mo.value = dlParams.mo.value.slice(0, idx_plus_after) + dlParams.mo.value.slice(idx_plus_after+5);
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
45 } else if ( idx_plus_before > -1 ) {
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
46 dlParams.mo.value = dlParams.mo.value.slice(0, idx_plus_before) + dlParams.mo.value.slice(idx_plus_before+5);
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
47 } else if ( idx_noplus > -1 ) {
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
48 dlParams.mo.value = dlParams.mo.value.slice(0, idx_noplus) + dlParams.mo.value.slice(idx_noplus+4);
106
19edc2593b88 Initial revision
engler
parents:
diff changeset
49 } else {
134
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
50 dlParams.mo.value += ",fit";
106
19edc2593b88 Initial revision
engler
parents:
diff changeset
51 }
19edc2593b88 Initial revision
engler
parents:
diff changeset
52 } else {
134
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
53 dlParams.mo.value = "fit";
106
19edc2593b88 Initial revision
engler
parents:
diff changeset
54 }
19edc2593b88 Initial revision
engler
parents:
diff changeset
55
134
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
56 display(3);
106
19edc2593b88 Initial revision
engler
parents:
diff changeset
57
134
1a0496201c75 unified scripts, nice xul sidebar, bugfixes
luginbue
parents: 106
diff changeset
58 }