comparison client/digitallibrary/modules/fitGIFs.js @ 107:85126da2ae21 vendor start

XUL: Digilib Buttons in chrome
author engler
date Tue, 13 May 2003 21:02:22 +0200
parents
children 1a0496201c75
comparison
equal deleted inserted replaced
105:ecee3ff2f4d0 107:85126da2ae21
1 /*
2 Copyright (C) 2003 WTWG, Uni Bern
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
17
18 Author: Christian Luginbuehl, 01.05.2003 , Version Alcatraz 0.3
19 */
20 /****************************************************************************
21 * - fitGIFs module for digilib *
22 * *
23 * christian luginbuehl (luginbuehl@student.unibe.ch) *
24 ****************************************************************************/
25
26
27
28 /**
29 * fitGIFs
30 */
31 function fitGIFs() {
32
33 if (att.mo != "") {
34
35 idx_plus_after = att.mo.indexOf("fit,");
36 idx_plus_before = att.mo.indexOf(",fit");
37 idx_noplus = att.mo.indexOf("fit");
38
39 if (idx_plus_after > -1) {
40 att.mo = att.mo.slice(0, idx_plus_after) + att.mo.slice(idx_plus_after+5);
41 } else if (idx_plus_before > -1) {
42 att.mo = att.mo.slice(0, idx_plus_before) + att.mo.slice(idx_plus_before+5);
43 } else if (idx_noplus > -1) {
44 att.mo = att.mo.slice(0, idx_noplus) + att.mo.slice(idx_noplus+4);
45 } else {
46 att.mo += ",fit";
47 }
48 } else {
49 att.mo = "fit";
50 }
51
52 loadPicture(2);
53
54 }