galleryThumbs.js
2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
function c_GalleryThumb (thu, cat, tit, tex, u)
{
var thumb = thu;
var cat = cat;
var title = tit;
var text = tex;
var url = u;
this.getThumb = function () { return thumb; }
this.getCat = function () { return cat; }
this.getTitle = function () { return title; }
this.getText = function () { return text; }
this.getUrl = function () { return url; }
}
function c_GalleryThumbs (_id, data, pos, _count)
{
var thumbs = new Array ();
var startIdx = pos;
var id = _id;
var count = _count;
for (var d in data)
{
var expr = /(.*) [^ ]*$/;
thumbs.push (
new c_GalleryThumb (
d.getThumbUrl (),
d.getOrdnerName (0).toUpperCase (),
d.titel,
d.ffBildzeile+' '.substr (0, 100).replace (expr, '$1...'),
d.getShowUrl ()));
}
// Dies kann warscheinlich auch raus aus c_GalleryThumbs
this.popup = function (i)
{
url = document.getElementById (id+'_BG_URL1_'+i).href;
thumbs = eval ();
if (url.match (/javascript:ftvlaunch\(/))
{
expr = /\(([0-9]+),\s*([0-9]+),\s*'(.+)'\)/;
expr.exec (url);
ftvlaunch (RegExp.$1, RegExp.$2, RegExp.$3);
return false;
}
return popup (document.getElementById (id+'_BG_URL1_'+i).href);
}
// -----
function changeDisplay (client)
{
for (i = 0; i < count; i++)
{
idx = i + startIdx;
if (idx > (thumbs.length - 1))
idx -= thumbs.length;
thumb = thumbs[idx].getThumb ();
cat = thumbs[idx].getCat ();
title = thumbs[idx].getTitle ();
text = thumbs[idx].getText ();
url = thumbs[idx].getUrl ();
document.getElementById (id+'_BG_THUMB'+i).src = thumb;
node = document.getElementById (id+'_BG_CAT'+i);
node.firstChild.data = cat;
node = document.getElementById (id+'_BG_TITLE'+i);
node.firstChild.data = title;
node = document.getElementById (id+'_BG_TEXT'+i);
node.firstChild.data = text;
document.getElementById (id+'_BG_URL1_'+i).href =
url + '?em_client=' + client;
document.getElementById (id+'_BG_URL2_'+i).href =
url + '?em_client=' + client;
}
}
this.incGallery = function (client)
{
startIdx = (startIdx == (thumbs.length - count)) ?
thumbs.length - count : startIdx + 1;
changeDisplay (client);
return false;
}
this.decGallery = function (client)
{
startIdx = (startIdx == 0) ? 0 : startIdx - 1;
changeDisplay (client);
return false;
}
}