/** * function renders a single day, either as link if there are * any stories online, or as plain text */ function renderCalendarDay(currGroupname,text) { if (text < 10) text = " "+text+" "; var currGroup = this.get(currGroupname); var linkit = false; if (currGroup && currGroup.size()) { linkit = false; for (var i=0;i" + text + ""; } return (text); } /** * function renders the list of stories for weblog-(front-)pages * and assigns the rendered list to res.data.storylist * scrollnavigation-links to previous and next page(s) are also * assigned to res.data (res.data.prevpage, res.data.nextpage) * using this separate renderFunction instead of doing the stuff * in storylist_macro() was necessary for completely independent * placement of the prevpage- and nextpage-links * @param Int Index-position to start with */ function renderStorylist(day) { if (this.allstories.size() == 0) { res.data.storylist = this.renderSkinAsString("welcome"); return; } var size = this.size(); var idx = 0; // if no day is specified, start with today. we may need // to search for today's entries (or the latest entry // before today) because there may be stories posted for // future days. (HW) var startdayString = day; if (!startdayString) startdayString = (new Date()).format("yyyyMMdd"); var startday = this.get(startdayString); if (startday && startday.size()>0) { idx = this.contains(startday); } else { // loop through days until we find a day less or equal than // the one we're looking for. for (var i=0; i= this.get(i).groupname) { idx = i; break; } } } var days = parseInt(this.days,10) ? parseInt(this.days,10) : 2; // only display "newer stories" if we are actually browsing the archive, // and the day parameter has been explicitly specified, // i.e. suppress the link if we are on the home page and there are // stories on future days. (HW) if (idx > 0 && day) { var sp = new Object(); var prev = this.get (Math.max(0, idx-days)); sp.url = this.href() + "?day=" + prev.groupname; sp.text = "newer stories"; res.data.prevpage = renderSkinAsString("prevpagelink",sp); } days = Math.min(days++,this.size()); var dayCnt = 0; res.data.storylist = ""; while (dayCnt < days && idx < size) { var day = this.get(idx++); // init var for incrementing daycounter var count = false; for (var i=0;i