Sourcecode in Root/renderFunctions.js:
1: function renderSitelist(limit, show, scroll) {
2: if (show && show == "all")
3: var collection = root.publicSites;
4: else
5: var collection = root;
6:
7: var size = collection.size();
8: if (!size)
9: return;
10:
11: var idx = parseInt (req.data.start, 10);
12: var scroll = (!scroll || scroll == "no" ? false : true);
13:
14: if (isNaN(idx) || idx > size-1 || idx < 0)
15: idx = 0;
16: if (scroll && idx > 0) {
17: var sp = new Object();
18: sp.url = root.href("list") + "?start=" + Math.max(0, idx-limit);
19: sp.text = getMessage("Site.previousPage");
20: res.data.prevpage = renderSkinAsString("prevpagelink", sp);
21: }
22:
23: var cnt = 0;
24: collection.prefetchChildren(idx, limit);
25: res.push();
26: while (cnt < limit && idx < size) {
27: var s = collection.get(idx++);
28: if (!s.blocked && s.online) {
29: s.renderSkin("preview");
30: cnt++;
31: }
32: }
33: res.data.sitelist = res.pop();
34:
35: if (scroll && idx < size) {
36: var sp = new Object();
37: sp.url = root.href("list") + "?start=" + idx;
38: sp.text = getMessage("Site.nextPage");
39: res.data.nextpage = renderSkinAsString("nextpagelink", sp);
40: }
41: return;
42: }
|