0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 01:10:28 +01:00

COMPATIBILITY: Convert actions in wizard composer editor

Dieser Commit ist enthalten in:
Angus McLeod 2024-10-09 10:15:13 +02:00
Ursprung c1db1442b7
Commit b78f3aad09
2 geänderte Dateien mit 73 neuen und 69 gelöschten Zeilen

Datei anzeigen

@ -14,6 +14,7 @@ import { uploadIcon } from "discourse/lib/uploads";
import { dasherize } from "@ember/string"; import { dasherize } from "@ember/string";
import InsertHyperlink from "discourse/components/modal/insert-hyperlink"; import InsertHyperlink from "discourse/components/modal/insert-hyperlink";
import { inject as service } from "@ember/service"; import { inject as service } from "@ember/service";
import { action } from "@ember/object";
const IMAGE_MARKDOWN_REGEX = const IMAGE_MARKDOWN_REGEX =
/!\[(.*?)\|(\d{1,4}x\d{1,4})(,\s*\d{1,3}%)?(.*?)\]\((upload:\/\/.*?)\)(?!(.*`))/g; /!\[(.*?)\|(\d{1,4}x\d{1,4})(,\s*\d{1,3}%)?(.*?)\]\((upload:\/\/.*?)\)(?!(.*`))/g;
@ -119,7 +120,7 @@ export default ComposerEditor.extend({
); );
}, },
actions: { @action
extraButtons(toolbar) { extraButtons(toolbar) {
const component = this; const component = this;
@ -135,6 +136,7 @@ export default ComposerEditor.extend({
toolbar.addButton({ toolbar.addButton({
id: "link", id: "link",
icon: "link",
group: "insertions", group: "insertions",
shortcut: "K", shortcut: "K",
trimLeading: true, trimLeading: true,
@ -168,6 +170,7 @@ export default ComposerEditor.extend({
} }
}, },
@action
previewUpdated(preview) { previewUpdated(preview) {
highlightSyntax(preview, this.siteSettings, this.session); highlightSyntax(preview, this.siteSettings, this.session);
@ -180,6 +183,7 @@ export default ComposerEditor.extend({
this._super(...arguments); this._super(...arguments);
}, },
@action
showLinkModal(toolbarEvent) { showLinkModal(toolbarEvent) {
let linkText = ""; let linkText = "";
this._lastSel = toolbarEvent.selected; this._lastSel = toolbarEvent.selected;
@ -192,9 +196,9 @@ export default ComposerEditor.extend({
}); });
}, },
@action
showUploadModal() { showUploadModal() {
this.session.set("wizardEventFieldId", this.field.id); this.session.set("wizardEventFieldId", this.field.id);
document.getElementById(this.fileUploadElementId).click(); document.getElementById(this.fileUploadElementId).click();
}, },
},
}); });

Datei anzeigen

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
# name: discourse-custom-wizard # name: discourse-custom-wizard
# about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more. # about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more.
# version: 2.8.6 # version: 2.8.7
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Juan Marcos Gutierrez Ramos # authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Juan Marcos Gutierrez Ramos
# url: https://github.com/paviliondev/discourse-custom-wizard # url: https://github.com/paviliondev/discourse-custom-wizard
# contact_emails: development@pavilion.tech # contact_emails: development@pavilion.tech