From 515c15735211a9ec273e7587d3b15c0a1848c99a Mon Sep 17 00:00:00 2001 From: Chad Schroeder Date: Tue, 19 Sep 2023 07:32:17 -0500 Subject: [PATCH 1/4] fixes #1088, restore missing fileInputId property --- src/trix/config/input.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/trix/config/input.js b/src/trix/config/input.js index dadc163a1..fa5be0b87 100644 --- a/src/trix/config/input.js +++ b/src/trix/config/input.js @@ -3,6 +3,7 @@ import { makeElement, removeNode } from "trix/core/helpers/dom" const input = { level2Enabled: true, + fileInputId: `trix-file-input-${Date.now().toString(16)}`, getLevel() { if (this.level2Enabled && browser.supportsInputEvents) { From af818b83f120bdb876d51f4627640205a8aadd11 Mon Sep 17 00:00:00 2001 From: Chad Schroeder Date: Tue, 19 Sep 2023 07:53:21 -0500 Subject: [PATCH 2/4] add option to set file accept attribute --- .DS_Store | Bin 0 -> 6148 bytes src/trix/config/input.js | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..cc57b0bf6ecc3a8dd8f5db27dd89b16de811e3de GIT binary patch literal 6148 zcmeHK%}T>S5Z-O0O({YS3Oz1(E!bKu6fYsx7cim+m70*E!I&*gY7V84v%Zi|;`2DO zyAg}^Dq?3~_nY6{><8H&#u)eJQI9c)F=j(UbgvE7Ofn+JF~TC7hKUTpelxMZ z4*2aBi&)GumVf>JaGJzf-tE5gTHV^(ZrBaGW#9S_vhedDpJ!e$yGH9m$|S7xAiRtx z#n{13t~;%EXXH&<~Q$-8SivhOpX+({XK5nSd+=5HRURQRKnxHA#K7h< zV9o@)wYe0~%83DD;0Fe9e-O|RU4x}YwRJ#;*Jq4dh$x`rTLMuSbPbjoAp*j6DWERp z=83^|IrxRia}Aanbvff|W*EoJTs>a6njQQ?r8Dkoq@EZc238rUYtzB={|tVawU7MO z60(Q^V&I=Kz^#!#@?cTsZ2h)8JZlBCJ7_4FSE2#}`pP8$4BSWBDyZWEb;xrKmKt#s S^s90}x(Fyjs3Qh`fq@TF8cJ^f literal 0 HcmV?d00001 diff --git a/src/trix/config/input.js b/src/trix/config/input.js index fa5be0b87..60ef56204 100644 --- a/src/trix/config/input.js +++ b/src/trix/config/input.js @@ -4,6 +4,7 @@ import { makeElement, removeNode } from "trix/core/helpers/dom" const input = { level2Enabled: true, fileInputId: `trix-file-input-${Date.now().toString(16)}`, + acceptedFileTypes: '*', getLevel() { if (this.level2Enabled && browser.supportsInputEvents) { @@ -13,7 +14,7 @@ const input = { } }, pickFiles(callback) { - const input = makeElement("input", { type: "file", multiple: true, hidden: true, id: this.fileInputId }) + const input = makeElement("input", { type: "file", multiple: true, hidden: true, id: this.fileInputId, accept: this.acceptedFileTypes }) input.addEventListener("change", () => { callback(input.files) From 1bb9b6f129ab5c9dc9d54dadc2af3565a464c7eb Mon Sep 17 00:00:00 2001 From: Chad Schroeder Date: Tue, 19 Sep 2023 10:57:00 -0500 Subject: [PATCH 3/4] remove .DS_Store, use double quotes --- .DS_Store | Bin 6148 -> 0 bytes .gitignore | 1 + src/trix/config/input.js | 2 +- 3 files changed, 2 insertions(+), 1 deletion(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index cc57b0bf6ecc3a8dd8f5db27dd89b16de811e3de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5Z-O0O({YS3Oz1(E!bKu6fYsx7cim+m70*E!I&*gY7V84v%Zi|;`2DO zyAg}^Dq?3~_nY6{><8H&#u)eJQI9c)F=j(UbgvE7Ofn+JF~TC7hKUTpelxMZ z4*2aBi&)GumVf>JaGJzf-tE5gTHV^(ZrBaGW#9S_vhedDpJ!e$yGH9m$|S7xAiRtx z#n{13t~;%EXXH&<~Q$-8SivhOpX+({XK5nSd+=5HRURQRKnxHA#K7h< zV9o@)wYe0~%83DD;0Fe9e-O|RU4x}YwRJ#;*Jq4dh$x`rTLMuSbPbjoAp*j6DWERp z=83^|IrxRia}Aanbvff|W*EoJTs>a6njQQ?r8Dkoq@EZc238rUYtzB={|tVawU7MO z60(Q^V&I=Kz^#!#@?cTsZ2h)8JZlBCJ7_4FSE2#}`pP8$4BSWBDyZWEb;xrKmKt#s S^s90}x(Fyjs3Qh`fq@TF8cJ^f diff --git a/.gitignore b/.gitignore index 9ad4f258e..0457248fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.DS_store yarn-error.log package-lock.json /dist diff --git a/src/trix/config/input.js b/src/trix/config/input.js index 60ef56204..f632d5b8a 100644 --- a/src/trix/config/input.js +++ b/src/trix/config/input.js @@ -4,7 +4,7 @@ import { makeElement, removeNode } from "trix/core/helpers/dom" const input = { level2Enabled: true, fileInputId: `trix-file-input-${Date.now().toString(16)}`, - acceptedFileTypes: '*', + acceptedFileTypes: "*", getLevel() { if (this.level2Enabled && browser.supportsInputEvents) { From 3044c84132b43cd898bc02beb1c3e10b53c31644 Mon Sep 17 00:00:00 2001 From: Chad Schroeder Date: Tue, 19 Sep 2023 11:01:07 -0500 Subject: [PATCH 4/4] match casing exactly even though .gitignore is case insensitive --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0457248fb..09da4d46b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -.DS_store +.DS_Store yarn-error.log package-lock.json /dist