From f742626786ff0c55dd33f7e80eb95e3a51409f02 Mon Sep 17 00:00:00 2001 From: angusmcleod Date: Wed, 16 Jun 2021 13:55:10 +1000 Subject: [PATCH 1/2] Ensure our custom paste logic is running --- assets/javascripts/wizard/custom-wizard.js.es6 | 4 ++++ .../wizard/initializers/custom-wizard-field.js.es6 | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/wizard/custom-wizard.js.es6 b/assets/javascripts/wizard/custom-wizard.js.es6 index 63a9ea10..35fef004 100644 --- a/assets/javascripts/wizard/custom-wizard.js.es6 +++ b/assets/javascripts/wizard/custom-wizard.js.es6 @@ -4,6 +4,10 @@ export default Ember.Application.extend({ rootElement: "#custom-wizard-main", Resolver: buildResolver("wizard"), + customEvents: { + paste: "paste" + }, + start() { Object.keys(requirejs._eak_seen).forEach((key) => { if (/\/pre\-initializers\//.test(key)) { diff --git a/assets/javascripts/wizard/initializers/custom-wizard-field.js.es6 b/assets/javascripts/wizard/initializers/custom-wizard-field.js.es6 index 3ede2b05..f5deb927 100644 --- a/assets/javascripts/wizard/initializers/custom-wizard-field.js.es6 +++ b/assets/javascripts/wizard/initializers/custom-wizard-field.js.es6 @@ -15,7 +15,7 @@ export default { ); const DEditor = requirejs("discourse/components/d-editor").default; const { clipboardHelpers } = requirejs("discourse/lib/utilities"); - const { toMarkdown } = requirejs("discourse/lib/to-markdown"); + const toMarkdown = requirejs("discourse/lib/to-markdown").default; FieldComponent.reopen({ classNameBindings: ["field.id"], @@ -181,7 +181,7 @@ export default { markdown = pre.match(/\S$/) ? ` ${markdown}` : markdown; } - this.appEvents.trigger("composer:insert-text", { + this.appEvents.trigger("wizard-editor:insert-text", { fieldId: this.fieldId, text: markdown, }); From 46bb28bb07079cd5a13b8d840e5a0834b6f4d325 Mon Sep 17 00:00:00 2001 From: angusmcleod Date: Wed, 16 Jun 2021 14:26:28 +1000 Subject: [PATCH 2/2] Fix linting --- assets/javascripts/wizard/custom-wizard.js.es6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/javascripts/wizard/custom-wizard.js.es6 b/assets/javascripts/wizard/custom-wizard.js.es6 index 35fef004..8c0a473c 100644 --- a/assets/javascripts/wizard/custom-wizard.js.es6 +++ b/assets/javascripts/wizard/custom-wizard.js.es6 @@ -5,7 +5,7 @@ export default Ember.Application.extend({ Resolver: buildResolver("wizard"), customEvents: { - paste: "paste" + paste: "paste", }, start() {