DEV: make composer-upload-uppy more flexible

DEV: make composer-upload-uppy more flexible

diff --git a/app/assets/javascripts/discourse/app/components/composer-editor-uppy.js b/app/assets/javascripts/discourse/app/components/composer-editor-uppy.js
index 152b1fb..1e230a3 100644
--- a/app/assets/javascripts/discourse/app/components/composer-editor-uppy.js
+++ b/app/assets/javascripts/discourse/app/components/composer-editor-uppy.js
@@ -9,4 +9,6 @@ export default ComposerEditor.extend(ComposerUploadUppy, {
   uploadType: "composer",
   uppyId: "composer-editor-uppy",
   composerModel: alias("composer"),
+  composerModelContentKey: "reply",
+  editorInputClass: ".d-editor-input",
 });
diff --git a/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js b/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js
index 36a82b3..885c86b 100644
--- a/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js
+++ b/app/assets/javascripts/discourse/app/mixins/composer-upload-uppy.js
@@ -334,9 +334,9 @@ export default Mixin.create({
       filename: escapedFilename + "(?:\\()?([0-9])?(?:\\))?",
     })}\\]\\(\\)`;
     const globalRegex = new RegExp(regexString, "g");
-    const matchingPlaceholder = this.get("composerModel.reply").match(
-      globalRegex
-    );
+    const matchingPlaceholder = this.get(
+      `composerModel.${this.composerModelContentKey}`
+    ).match(globalRegex);
     if (matchingPlaceholder) {
       // get last matching placeholder and its consecutive nr in regex
       // capturing group and apply +1 to the placeholder
@@ -525,7 +525,7 @@ export default Mixin.create({
   _bindPasteListener() {
     this.pasteEventListener = function pasteListener(event) {
       if (
-        document.activeElement !== document.querySelector(".d-editor-input")
+        document.activeElement !== document.querySelector(this.editorInputClass)
       ) {
         return;
       }

GitHub sha: db0429da1f0212d1244eb99fb832023644b3a76f

This commit appears in #14177 which was approved by eviltrout. It was merged by markvanlan.