widgets: Rename voting_widget to poll_widget.

This ensures greater consistency with our other widgets' naming
convention.
This commit is contained in:
Tim Abbott 2018-12-16 19:46:27 -08:00
parent 8a90441d2f
commit 7485cb2a50
8 changed files with 16 additions and 16 deletions

View File

@ -198,7 +198,7 @@
"user_pill": false,
"user_search": false,
"util": false,
"voting_widget": false,
"poll_widget": false,
"widgetize": false,
"zcommand": false,
"zform": false,

View File

@ -41,7 +41,7 @@ features:
- `static/js/zform.js`
- `static/js/zcommand.js`
- `static/js/submessage.js`
- `static/js/voting_widget.js`
- `static/js/poll_widget.js`
- `static/js/widgetize.js`
- `static/js/zform.js`
- `static/templates/widgets/`
@ -178,7 +178,7 @@ jQuery and template.render, and the developer can create
new templates in `static/templates/widgets/`.
A good way to learn the system is to read the code
in `static/js/voting_widget.js`. It is worth noting that
in `static/js/poll_widget.js`. It is worth noting that
writing a new widget requires only minor backend
changes in the current architecture. This could change
in the future, but for now a frontend developer mostly
@ -376,7 +376,7 @@ just has a somewhat more generic job to do.) In
converges, with snippets like this:
~~~ js
widgets.poll = voting_widget;
widgets.poll = poll_widget;
widgets.tictactoe = tictactoe_widget;
widgets.todo = todo_widget;
widgets.zform = zform;

View File

@ -1,4 +1,4 @@
zrequire('voting_widget');
zrequire('poll_widget');
set_global('$', global.make_zjquery());
set_global('i18n', global.stub_i18n);
@ -18,7 +18,7 @@ run_test('poll_data_holder my question', () => {
const sender_id = 99;
people.my_current_user_id = () => sender_id;
const data_holder = voting_widget.poll_data_holder(is_my_poll, question);
const data_holder = poll_widget.poll_data_holder(is_my_poll, question);
let data = data_holder.get_widget_data();
@ -198,7 +198,7 @@ run_test('activate another person poll', () => {
vote_button_callback = func;
};
voting_widget.activate(opts);
poll_widget.activate(opts);
assert.equal(widget_elem.html(), 'poll-widget');
assert.equal(widget_comment_container.html(), 'poll-widget-results');
@ -347,7 +347,7 @@ run_test('activate own poll', () => {
// Setting visiblity to true as default is false
poll_question_container.show();
voting_widget.activate(opts);
poll_widget.activate(opts);
assert.equal(widget_elem.html(), 'poll-widget');
assert.equal(widget_comment_container.html(), 'poll-widget-results');

View File

@ -1,5 +1,5 @@
set_global('$', global.make_zjquery());
set_global('voting_widget', {});
set_global('poll_widget', {});
set_global('tictactoe_widget', {});
set_global('todo_widget', {});
set_global('zform', {});
@ -74,7 +74,7 @@ run_test('activate', () => {
let is_widget_activated;
let is_widget_elem_inserted;
voting_widget.activate = (data) => {
poll_widget.activate = (data) => {
is_widget_activated = true;
widget_elem = data.elem;
assert(widget_elem.hasClass('widget-content'));

View File

@ -67,7 +67,7 @@ import "js/top_left_corner.js";
import "js/stream_list.js";
import "js/topic_zoom.js";
import "js/filter.js";
import 'js/voting_widget.js';
import 'js/poll_widget.js';
import 'js/todo_widget.js';
import 'js/tictactoe_widget.js';
import 'js/zform.js';

View File

@ -1,4 +1,4 @@
var voting_widget = (function () {
var poll_widget = (function () {
var exports = {};
@ -231,7 +231,7 @@ return exports;
}());
if (typeof module !== 'undefined') {
module.exports = voting_widget;
module.exports = poll_widget;
}
window.voting_widget = voting_widget;
window.poll_widget = poll_widget;

View File

@ -4,7 +4,7 @@ var exports = {};
var widgets = {};
widgets.poll = voting_widget;
widgets.poll = poll_widget;
widgets.tictactoe = tictactoe_widget;
widgets.todo = todo_widget;
widgets.zform = zform;

View File

@ -85,7 +85,7 @@ enforce_fully_covered = {
'static/js/user_search.js',
'static/js/util.js',
'static/js/widgetize.js',
'static/js/voting_widget.js',
'static/js/poll_widget.js',
'static/js/search_pill.js',
}