2016-06-13 06:21:14 -04:00
|
|
|
import { withPluginApi } from 'discourse/lib/plugin-api';
|
|
|
|
import showModal from 'discourse/lib/show-modal';
|
2016-07-05 00:22:14 -04:00
|
|
|
import ComposerController from 'discourse/controllers/composer';
|
2016-06-13 06:21:14 -04:00
|
|
|
|
|
|
|
function initializePollUIBuilder(api) {
|
|
|
|
ComposerController.reopen({
|
|
|
|
actions: {
|
|
|
|
showPollBuilder() {
|
|
|
|
showModal("poll-ui-builder").set("toolbarEvent", this.get("toolbarEvent"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
api.addToolbarPopupMenuOptionsCallback(function() {
|
|
|
|
return {
|
|
|
|
action: 'showPollBuilder',
|
|
|
|
icon: 'bar-chart-o',
|
|
|
|
label: 'poll.ui_builder.title'
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: "add-poll-ui-builder",
|
|
|
|
|
|
|
|
initialize() {
|
2016-06-30 21:25:37 -04:00
|
|
|
withPluginApi('0.5', initializePollUIBuilder);
|
2016-06-13 06:21:14 -04:00
|
|
|
}
|
|
|
|
};
|