- var next = '<b> | </b><span class="mkwsNext">' + M('Next') + ' >></span>';
- if (pages - currentPage > 0)
- next = '<b> | </b><a href="#" class="mkwsNext" onclick="mkws.pagerNext(\'' + team.name() + '\')">'
- + M('Next') + ' >></a>';
+ var next = '<b> | </b><span class="mkwsNext">' + M('Next') + ' >></span>';
+ if (pages - currentPage > 0)
+ next = '<b> | </b><a href="#" class="mkwsNext" onclick="mkws.pagerNext(\'' + teamName + '\')">'
+ + M('Next') + ' >></a>';
+
+ var predots = '';
+ if (firstClkbl > 1)
+ predots = '...';
+
+ var postdots = '';
+ if (lastClkbl < pages)
+ postdots = '...';
+
+ s += '<div style="float: clear">'
+ + prev + predots + middle + postdots + next + '</div>';
+
+ return s;
+ }
+ });
+}
+mkws.registerWidgetType('Pager', promoteToPager);
+
+
+function promoteToRecords() {
+ var that = this;
+ var team = this.team;
+
+ this.team.queue("records").subscribe(function(data) {
+ var html = [];
+ for (var i = 0; i < data.hits.length; i++) {
+ var hit = data.hits[i];
+ var divId = team.recordElementId(hit.recid[0]);
+ html.push('<div class="record mkwsTeam_' + team.name() + ' ' + divId + '">', renderSummary(hit), '</div>');
+ // ### At some point, we may be able to move the
+ // m_currentRecordId and m_currentRecordData members
+ // from the team object into this widget.
+ if (hit.recid == team.currentRecordId()) {
+ if (team.currentRecordData())
+ html.push(team.renderDetails(team.currentRecordData()));
+ }
+ }
+ $(that.node).html(html.join(''));
+
+ function renderSummary(hit)
+ {
+ var template = team.loadTemplate("Summary");
+ hit._id = team.recordElementId(hit.recid[0]);
+ hit._onclick = "mkws.showDetails('" + team.name() + "', '" + hit.recid[0] + "');return false;"
+ return template(hit);
+ }
+ });
+}
+mkws.registerWidgetType('Records', promoteToRecords);