From 848f16e8f5935f90b30b7e2ffd078007906dbe6b Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 22 Aug 2016 11:41:23 +0200 Subject: [PATCH] unused function which computes values for the table --- www/poll/main.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/www/poll/main.js b/www/poll/main.js index 0f50a70bb..9ae642e13 100644 --- a/www/poll/main.js +++ b/www/poll/main.js @@ -44,14 +44,33 @@ define([ Cryptpad: Cryptpad, }; + module.getResults = function () { + if (!module.ready) { return []; } + var table = module.rt.proxy.table; + var cells = table.cells; + var rows = table.rows; + + return Object.keys(rows).map(function (id) { + var text = rows[id]; + var count = Object.keys(cells).filter(function (c) { + return c.indexOf(id) !== -1 && cells[c]; + }).length; + return { + text: text, + count: count, + }; + }).sort(function (a,b) { + return b.count - a.count; + }); + }; + module.Wizard = Wizard; // special UI elements var $title = $('#title').attr('placeholder', Messages.dateTitleHint || 'title'); - var $location = $('#location').attr('placeholder', Messages.dateLocationHint || 'location'); var $description = $('#description').attr('placeholder', Messages.dateDescription || 'description'); - var items = [$title, $location, $description]; + var items = [$title, $description]; var Uid = function (prefix, f) { f = f || function () {