Commit Graph

12 Commits

Author SHA1 Message Date
Shubham Dhama 1e157057c3 voting_widget: Don't update question in question.outbound function.
We should wait for server response(event) for updating the question.
2018-07-06 11:30:12 -04:00
Shubham Dhama 1e32f66832 voting_widget: Minor refactor of jquery elements selectors. 2018-07-06 11:30:12 -04:00
Armaan Ahluwalia 6d255efe4c app: Prepare JS files for consumption by webpack.
This commit prepares the frontend code to be consumed by webpack.

It is a hack: In theory, modules should be declaring and importing the
modules they depend on and the globals they expose directly.

However, that requires significant per-module work, which we don't
really want to block moving our toolchain to webpack on.

So we expose the modules by setting window.varName = varName; as
needed in the js files.
2018-07-05 10:53:36 +02:00
Steve Howell 1fdfe11e8b node tests: Add tests for voting_widget.js.
This first commit starts by testing handling of
inbound data.
2018-07-02 13:46:30 -04:00
Rhea Parekh b22d266667 widgets: Add question for poll widget in the message itself.
Use the command '/poll question?', to start a question.
2018-07-01 19:56:19 -04:00
Rhea Parekh 784e7249a5 widgets: Add question in the poll widget itself.
The user can also edit the question after adding it.

The question in the poll can only be added/edited
by the user who started the poll.

The input bar will be disabled for the other users
if the question is not yet added. If the question is
added, the input bar will not be visible to the other
users.
2018-07-01 19:56:19 -04:00
Rhea Parekh 3d5cecdad5 widgets: Avoid voting while adding a new option in poll widget. 2018-07-01 19:56:19 -04:00
Shubham Dhama 9a45e52f75 widgets: Fix empty message_content of "All messages" widgets.
Fixes: #9827.
2018-06-28 14:04:37 -04:00
Steve Howell c1cd0b710e poll widget: Handle unknown keys.
This directly prevents a traceback when submessage events
arrive in the wrong order.  This was probably a symptom
of not updating message.submessages for not-yet-widgeted
messages, which was fixed in an earlier commit, but we
want defensive code in case of races or other glitches, and
it's not the end of the world is somebody sees partial
survey results due to some corner case.
2018-05-31 12:11:32 -04:00
Steve Howell c0a9eb19fd poll widget: Clear input after adding an option. 2018-05-30 18:11:03 -07:00
Steve Howell f1877d8fdb poll widget: Prevent blank poll options. 2018-05-30 18:11:03 -07:00
Steve Howell d0e70a9700 Add poll widget. 2018-05-16 15:13:33 -07:00