DEV: Remove chat plugin button (#16342)
This commit is contained in:
parent
558bc6b746
commit
e66933ead4
|
@ -87,32 +87,10 @@ function _rangeElements(element) {
|
||||||
|
|
||||||
function initializeDiscourseLocalDates(api) {
|
function initializeDiscourseLocalDates(api) {
|
||||||
const siteSettings = api.container.lookup("site-settings:main");
|
const siteSettings = api.container.lookup("site-settings:main");
|
||||||
const chat = api.container.lookup("service:chat");
|
|
||||||
const defaultTitle = I18n.t("discourse_local_dates.default_title", {
|
const defaultTitle = I18n.t("discourse_local_dates.default_title", {
|
||||||
site_name: siteSettings.title,
|
site_name: siteSettings.title,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (chat) {
|
|
||||||
chat.addToolbarButton({
|
|
||||||
title: "discourse_local_dates.title",
|
|
||||||
id: "local-dates",
|
|
||||||
icon: "calendar-alt",
|
|
||||||
action: "insertDiscourseLocalDate",
|
|
||||||
});
|
|
||||||
|
|
||||||
api.modifyClass("component:chat-composer", {
|
|
||||||
pluginId: "discourse-local-dates",
|
|
||||||
actions: {
|
|
||||||
insertDiscourseLocalDate() {
|
|
||||||
const insertDate = this.addText.bind(this);
|
|
||||||
showModal("discourse-local-dates-create-modal").setProperties({
|
|
||||||
insertDate,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
api.decorateCookedElement(
|
api.decorateCookedElement(
|
||||||
(elem, helper) => {
|
(elem, helper) => {
|
||||||
const dates = elem.querySelectorAll(".discourse-local-date");
|
const dates = elem.querySelectorAll(".discourse-local-date");
|
||||||
|
|
Loading…
Reference in New Issue