mirror of https://github.com/zulip/zulip.git
widgets: Rename voting_widget to poll_widget.
This ensures greater consistency with our other widgets' naming convention.
This commit is contained in:
parent
8a90441d2f
commit
7485cb2a50
|
@ -198,7 +198,7 @@
|
||||||
"user_pill": false,
|
"user_pill": false,
|
||||||
"user_search": false,
|
"user_search": false,
|
||||||
"util": false,
|
"util": false,
|
||||||
"voting_widget": false,
|
"poll_widget": false,
|
||||||
"widgetize": false,
|
"widgetize": false,
|
||||||
"zcommand": false,
|
"zcommand": false,
|
||||||
"zform": false,
|
"zform": false,
|
||||||
|
|
|
@ -41,7 +41,7 @@ features:
|
||||||
- `static/js/zform.js`
|
- `static/js/zform.js`
|
||||||
- `static/js/zcommand.js`
|
- `static/js/zcommand.js`
|
||||||
- `static/js/submessage.js`
|
- `static/js/submessage.js`
|
||||||
- `static/js/voting_widget.js`
|
- `static/js/poll_widget.js`
|
||||||
- `static/js/widgetize.js`
|
- `static/js/widgetize.js`
|
||||||
- `static/js/zform.js`
|
- `static/js/zform.js`
|
||||||
- `static/templates/widgets/`
|
- `static/templates/widgets/`
|
||||||
|
@ -178,7 +178,7 @@ jQuery and template.render, and the developer can create
|
||||||
new templates in `static/templates/widgets/`.
|
new templates in `static/templates/widgets/`.
|
||||||
|
|
||||||
A good way to learn the system is to read the code
|
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
|
writing a new widget requires only minor backend
|
||||||
changes in the current architecture. This could change
|
changes in the current architecture. This could change
|
||||||
in the future, but for now a frontend developer mostly
|
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:
|
converges, with snippets like this:
|
||||||
|
|
||||||
~~~ js
|
~~~ js
|
||||||
widgets.poll = voting_widget;
|
widgets.poll = poll_widget;
|
||||||
widgets.tictactoe = tictactoe_widget;
|
widgets.tictactoe = tictactoe_widget;
|
||||||
widgets.todo = todo_widget;
|
widgets.todo = todo_widget;
|
||||||
widgets.zform = zform;
|
widgets.zform = zform;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
zrequire('voting_widget');
|
zrequire('poll_widget');
|
||||||
|
|
||||||
set_global('$', global.make_zjquery());
|
set_global('$', global.make_zjquery());
|
||||||
set_global('i18n', global.stub_i18n);
|
set_global('i18n', global.stub_i18n);
|
||||||
|
@ -18,7 +18,7 @@ run_test('poll_data_holder my question', () => {
|
||||||
const sender_id = 99;
|
const sender_id = 99;
|
||||||
people.my_current_user_id = () => sender_id;
|
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();
|
let data = data_holder.get_widget_data();
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ run_test('activate another person poll', () => {
|
||||||
vote_button_callback = func;
|
vote_button_callback = func;
|
||||||
};
|
};
|
||||||
|
|
||||||
voting_widget.activate(opts);
|
poll_widget.activate(opts);
|
||||||
|
|
||||||
assert.equal(widget_elem.html(), 'poll-widget');
|
assert.equal(widget_elem.html(), 'poll-widget');
|
||||||
assert.equal(widget_comment_container.html(), 'poll-widget-results');
|
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
|
// Setting visiblity to true as default is false
|
||||||
poll_question_container.show();
|
poll_question_container.show();
|
||||||
|
|
||||||
voting_widget.activate(opts);
|
poll_widget.activate(opts);
|
||||||
|
|
||||||
assert.equal(widget_elem.html(), 'poll-widget');
|
assert.equal(widget_elem.html(), 'poll-widget');
|
||||||
assert.equal(widget_comment_container.html(), 'poll-widget-results');
|
assert.equal(widget_comment_container.html(), 'poll-widget-results');
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
set_global('$', global.make_zjquery());
|
set_global('$', global.make_zjquery());
|
||||||
set_global('voting_widget', {});
|
set_global('poll_widget', {});
|
||||||
set_global('tictactoe_widget', {});
|
set_global('tictactoe_widget', {});
|
||||||
set_global('todo_widget', {});
|
set_global('todo_widget', {});
|
||||||
set_global('zform', {});
|
set_global('zform', {});
|
||||||
|
@ -74,7 +74,7 @@ run_test('activate', () => {
|
||||||
let is_widget_activated;
|
let is_widget_activated;
|
||||||
let is_widget_elem_inserted;
|
let is_widget_elem_inserted;
|
||||||
|
|
||||||
voting_widget.activate = (data) => {
|
poll_widget.activate = (data) => {
|
||||||
is_widget_activated = true;
|
is_widget_activated = true;
|
||||||
widget_elem = data.elem;
|
widget_elem = data.elem;
|
||||||
assert(widget_elem.hasClass('widget-content'));
|
assert(widget_elem.hasClass('widget-content'));
|
||||||
|
|
|
@ -67,7 +67,7 @@ import "js/top_left_corner.js";
|
||||||
import "js/stream_list.js";
|
import "js/stream_list.js";
|
||||||
import "js/topic_zoom.js";
|
import "js/topic_zoom.js";
|
||||||
import "js/filter.js";
|
import "js/filter.js";
|
||||||
import 'js/voting_widget.js';
|
import 'js/poll_widget.js';
|
||||||
import 'js/todo_widget.js';
|
import 'js/todo_widget.js';
|
||||||
import 'js/tictactoe_widget.js';
|
import 'js/tictactoe_widget.js';
|
||||||
import 'js/zform.js';
|
import 'js/zform.js';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
var voting_widget = (function () {
|
var poll_widget = (function () {
|
||||||
|
|
||||||
var exports = {};
|
var exports = {};
|
||||||
|
|
||||||
|
@ -231,7 +231,7 @@ return exports;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
if (typeof module !== 'undefined') {
|
if (typeof module !== 'undefined') {
|
||||||
module.exports = voting_widget;
|
module.exports = poll_widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.voting_widget = voting_widget;
|
window.poll_widget = poll_widget;
|
|
@ -4,7 +4,7 @@ var exports = {};
|
||||||
|
|
||||||
var widgets = {};
|
var widgets = {};
|
||||||
|
|
||||||
widgets.poll = voting_widget;
|
widgets.poll = poll_widget;
|
||||||
widgets.tictactoe = tictactoe_widget;
|
widgets.tictactoe = tictactoe_widget;
|
||||||
widgets.todo = todo_widget;
|
widgets.todo = todo_widget;
|
||||||
widgets.zform = zform;
|
widgets.zform = zform;
|
||||||
|
|
|
@ -85,7 +85,7 @@ enforce_fully_covered = {
|
||||||
'static/js/user_search.js',
|
'static/js/user_search.js',
|
||||||
'static/js/util.js',
|
'static/js/util.js',
|
||||||
'static/js/widgetize.js',
|
'static/js/widgetize.js',
|
||||||
'static/js/voting_widget.js',
|
'static/js/poll_widget.js',
|
||||||
'static/js/search_pill.js',
|
'static/js/search_pill.js',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue