strecke.js
3.01 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
if (typeof (nBildertool) === 'undefined')
nBildertool = {};
if (typeof (FRONT_URL) === 'undefined')
FRONT_URL = 'http://foto.westfaelische-nachrichten.de/';
// strecke wird ausschliesslich ueber einen entsprechenden xml Datensatz
// gefuellt.
nBildertool.strecke = function (data)
{
this.streckeId = null;
this.date = null;
this.showDate = null;
this.titel = null;
this.prio = null;
this.sektionen = null;
this.template = null;
this.ordnerId = null;
this.connectionId = null;
this.flags = null;
this.l0Id = null;
this.l1Id = null;
this.l2Id = null;
this.l3Id = null;
this.ordnerName = null;
this.viewFoto = null;
this.viewIndex = null;
this.downloads = null;
this.ffId = null;
this.ffBildzeile = null;
this.ffCopy = null;
this.ffSId = null;
this.ffSBildzeile = null;
this.ffSCopy = null;
this.fotoCount = null;
this.path = null;
SPECIAL_CHARS = Array (
/ /g, /ä/g, /ü/g, /ö/g, /Ä/g, /Ü/g, /Ö/g, /ß/g,
/\./g, /:/g, /\!/g, /\?/g, /\,/g,
/`/g, /"/g, /\'/g,
/é/g, /è/g, /á/g, /à/g, /ó/g,
/É/g, /Á/g, /Ó/g, /È/g, /À/g, /Ò/g,
/EUR/g, /¢/g, /\$/g,
/@/g, /%/g, /&/g, /\+/g, /§/g, /\(/g, /\)/g);
SPECIAL_CHARS_MAP = Array (
'_', 'ae', 'ue', 'oe', 'Ae', 'Ue', 'Oe', 'ss',
'', '', '', '', '',
'', '', '',
'e', 'e', 'a', 'a', 'o',
'E', 'A', 'O', 'E', 'A', 'O',
'_euro_', '_cent_', '_dollar_',
'_at_', '_prozent_', '_und_', '_und_', '_paragraph_', '', '');
function getOrdnerInfo (value, idx)
{
var val = value.split ('|%|');
if (typeof (idx) === 'undefined') return val;
return val[idx];
}
this.getOrdnerId = function (idx)
{
return getOrdnerInfo (this.ordnerId, idx);
}
this.getConnectionId = function (idx)
{
return getOrdnerInfo (this.connectionId, idx);
}
this.getFlags = function (idx)
{
return getOrdnerInfo (this.flags, idx);
}
this.getL0Id = function (idx)
{
return getOrdnerInfo (this.l0Id, idx);
}
this.getL1Id = function (idx)
{
return getOrdnerInfo (this.l1Id, idx);
}
this.getL2Id = function (idx)
{
return getOrdnerInfo (this.l2Id, idx);
}
this.getL3Id = function (idx)
{
return getOrdnerInfo (this.l3Id, idx);
}
this.getOrdnerName = function (idx)
{
return getOrdnerInfo (this.ordnerName, idx);
}
this.getTeaserUrl = function ()
{
var teaserPath =
escape (this.titel) + '/' +
this.streckeId.substr (this.streckeId.length-2) + '/' +
this.streckeId;
return FRONT_URL + teaserPath + '.jpeg';
}
this.getPath = function ()
{
var path = this.path;
for (i in SPECIAL_CHARS)
path = path.replace (SPECIAL_CHARS[i], SPECIAL_CHARS_MAP[i]);
return path;
}
this.getThumbUrl = function ()
{
return FRONT_URL + this.getPath () + 'T.jpeg';
}
this.getScreenUrl = function ()
{
return FRONT_URL + this.getPath () + 'S.jpeg';
}
this.getDownlUrl = function ()
{
return FRONT_URL + this.getPath () + '.jpeg';
}
this.getShowUrl = function ()
{
return FRONT_URL + this.getPath () + '.html';
}
nBildertool.strecke.baseConstructor.call (this, data);
}
nBildertool.extend (nBildertool.strecke, nBildertool.c_xmlify);