2021-03-28 11:06:49 +02:00
|
|
|
import {
|
|
|
|
default as computed,
|
|
|
|
observes,
|
|
|
|
} from "discourse-common/utils/decorators";
|
2022-03-16 14:09:23 +01:00
|
|
|
import Component from "@ember/component";
|
2024-10-09 10:01:28 +02:00
|
|
|
import EmberObject, { action } from "@ember/object";
|
2018-02-08 05:30:55 +01:00
|
|
|
|
2022-03-16 14:09:23 +01:00
|
|
|
export default Component.extend({
|
2019-11-20 13:08:04 +01:00
|
|
|
showPreview: false,
|
2021-03-28 11:06:49 +02:00
|
|
|
classNameBindings: [
|
|
|
|
":wizard-field-composer",
|
|
|
|
"showPreview:show-preview:hide-preview",
|
|
|
|
],
|
|
|
|
|
2024-10-28 09:52:04 +01:00
|
|
|
init() {
|
|
|
|
this._super(...arguments);
|
2021-03-28 11:06:49 +02:00
|
|
|
this.set(
|
|
|
|
"composer",
|
|
|
|
EmberObject.create({
|
|
|
|
loading: false,
|
2021-12-01 08:19:14 +01:00
|
|
|
reply: this.get("field.value") || "",
|
2024-11-22 15:04:06 +01:00
|
|
|
afterRefresh: () => {},
|
2021-03-28 11:06:49 +02:00
|
|
|
})
|
|
|
|
);
|
2019-11-20 13:08:04 +01:00
|
|
|
},
|
2021-03-28 11:06:49 +02:00
|
|
|
|
|
|
|
@observes("composer.reply")
|
2019-11-20 13:08:04 +01:00
|
|
|
setField() {
|
2021-03-28 11:06:49 +02:00
|
|
|
this.set("field.value", this.get("composer.reply"));
|
2019-11-20 13:08:04 +01:00
|
|
|
},
|
2021-03-28 11:06:49 +02:00
|
|
|
|
|
|
|
@computed("showPreview")
|
2018-02-08 05:30:55 +01:00
|
|
|
togglePreviewLabel(showPreview) {
|
2021-03-28 11:06:49 +02:00
|
|
|
return showPreview
|
|
|
|
? "wizard_composer.hide_preview"
|
|
|
|
: "wizard_composer.show_preview";
|
2018-02-08 05:30:55 +01:00
|
|
|
},
|
|
|
|
|
2024-10-09 10:01:28 +02:00
|
|
|
@action
|
|
|
|
importQuote() {},
|
2021-03-28 11:06:49 +02:00
|
|
|
|
2024-10-09 10:01:28 +02:00
|
|
|
@action
|
|
|
|
groupsMentioned() {},
|
|
|
|
|
|
|
|
@action
|
|
|
|
afterRefresh() {},
|
|
|
|
|
|
|
|
@action
|
|
|
|
cannotSeeMention() {},
|
|
|
|
|
|
|
|
@action
|
|
|
|
showUploadSelector() {},
|
|
|
|
|
|
|
|
@action
|
|
|
|
togglePreview() {
|
|
|
|
this.toggleProperty("showPreview");
|
2021-03-28 11:06:49 +02:00
|
|
|
},
|
2018-02-08 05:30:55 +01:00
|
|
|
});
|