Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-26 11:00:28 +01:00
Merge pull request #228 from paviliondev/composer_copy_paste
Move to new Uppy handling in discourse/discourse
Dieser Commit ist enthalten in:
Commit
c475ec65cd
2 geänderte Dateien mit 8 neuen und 18 gelöschten Zeilen
|
@ -29,6 +29,7 @@ export default ComposerEditor.extend({
|
||||||
draftStatus: "null",
|
draftStatus: "null",
|
||||||
replyPlaceholder: alias("field.translatedPlaceholder"),
|
replyPlaceholder: alias("field.translatedPlaceholder"),
|
||||||
wizardEventFieldId: null,
|
wizardEventFieldId: null,
|
||||||
|
composerEventPrefix: "wizard-editor",
|
||||||
|
|
||||||
@on("didInsertElement")
|
@on("didInsertElement")
|
||||||
_composerEditorInit() {
|
_composerEditorInit() {
|
||||||
|
@ -77,24 +78,13 @@ export default ComposerEditor.extend({
|
||||||
$input.on("scroll", this._throttledSyncEditorAndPreviewScroll);
|
$input.on("scroll", this._throttledSyncEditorAndPreviewScroll);
|
||||||
this._bindUploadTarget();
|
this._bindUploadTarget();
|
||||||
|
|
||||||
const wizardEventNames = ["insert-text", "replace-text"];
|
const field = this.field;
|
||||||
const eventPrefix = this.eventPrefix;
|
this.editorInputClass = `.${dasherize(field.type)}-${dasherize(
|
||||||
this.appEvents.reopen({
|
field.id
|
||||||
trigger(name, ...args) {
|
)} .d-editor-input`;
|
||||||
let eventParts = name.split(":");
|
|
||||||
let currentEventPrefix = eventParts[0];
|
|
||||||
let currentEventName = eventParts[1];
|
|
||||||
|
|
||||||
if (
|
this._uppyInstance.on("file-added", () => {
|
||||||
currentEventPrefix !== "wizard-editor" &&
|
this.session.set("wizardEventFieldId", field.id);
|
||||||
wizardEventNames.some((wen) => wen === currentEventName)
|
|
||||||
) {
|
|
||||||
let wizardEventName = name.replace(eventPrefix, "wizard-editor");
|
|
||||||
return this._super(wizardEventName, ...args);
|
|
||||||
} else {
|
|
||||||
return this._super(name, ...args);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -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.2.7
|
# version: 2.2.8
|
||||||
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever
|
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever
|
||||||
# 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
|
||||||
|
|
Laden …
In neuem Issue referenzieren