From 1b9f7ef174bafe09ec974c233a0494d2edf16fae Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 29 Apr 2014 13:27:34 +0100 Subject: [PATCH] Add new "Ranking" widget. Uses mkwsHtmlSort and mkwsHtmlPerpage functions to generate mkwsSort and mkwsPerpage widgets. --- src/mkws-widgets.js | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/src/mkws-widgets.js b/src/mkws-widgets.js index 5103bbc..80fe222 100644 --- a/src/mkws-widgets.js +++ b/src/mkws-widgets.js @@ -396,3 +396,64 @@ mkws.registerWidgetType('Results', function() { }); +mkws.registerWidgetType('Ranking', function() { + var tname = this.team.name(); + var that = this; + var M = mkws.M; + + var s = '
'; + if (this.config.show_sort) { + s += M('Sort by') + ' ' + mkwsHtmlSort() + ' '; + } + if (this.config.show_perpage) { + s += M('and show') + ' ' + mkwsHtmlPerpage() + ' ' + M('per page') + '.'; + } + s += '
'; + + $(this.node).html(s); + + + function mkwsHtmlSort() { + var order = that.team.sortOrder(); + + that.log("HTML sort, sortOrder = '" + order + "'"); + var sort_html = ''; + + return sort_html; + } + + function mkwsHtmlPerpage() { + var perpage = that.team.perpage(); + + that.log("HTML perpage, perpage = " + perpage); + var perpage_html = ''; + + return perpage_html; + } +}); + + -- 1.7.10.4