@bobfrankston/rmfmail 1.2.105 → 1.2.108

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2013,15 +2013,28 @@ async function createTinyMceEditor(container2, opts = {}) {
2013
2013
  const input = document.createElement("input");
2014
2014
  input.type = "file";
2015
2015
  input.accept = "image/*";
2016
+ input.style.display = "none";
2017
+ const cleanup = () => {
2018
+ input.remove();
2019
+ };
2016
2020
  input.onchange = () => {
2017
2021
  const file = input.files && input.files[0];
2018
- if (!file)
2022
+ if (!file) {
2023
+ cleanup();
2019
2024
  return;
2025
+ }
2020
2026
  const reader = new FileReader();
2021
- reader.onload = () => cb(reader.result, { alt: file.name, title: file.name });
2022
- reader.onerror = () => cb("");
2027
+ reader.onload = () => {
2028
+ cb(reader.result, { alt: file.name, title: file.name });
2029
+ cleanup();
2030
+ };
2031
+ reader.onerror = () => {
2032
+ cb("");
2033
+ cleanup();
2034
+ };
2023
2035
  reader.readAsDataURL(file);
2024
2036
  };
2037
+ document.body.appendChild(input);
2025
2038
  input.click();
2026
2039
  },
2027
2040
  // Right-click context menu DISABLED so WebView2's native menu
@@ -2155,6 +2168,20 @@ async function createTinyMceEditor(container2, opts = {}) {
2155
2168
  applyZoom();
2156
2169
  saveZoom();
2157
2170
  };
2171
+ const suppressLinkSpellcheck = () => {
2172
+ try {
2173
+ const body = ed.getBody();
2174
+ if (!body)
2175
+ return;
2176
+ const links = body.querySelectorAll("a:not([spellcheck])");
2177
+ for (const a of links)
2178
+ a.setAttribute("spellcheck", "false");
2179
+ } catch {
2180
+ }
2181
+ };
2182
+ ed.on("init", suppressLinkSpellcheck);
2183
+ ed.on("SetContent", suppressLinkSpellcheck);
2184
+ ed.on("NodeChange", suppressLinkSpellcheck);
2158
2185
  const BORDER_STYLES = { "border": "1px solid #888", "border-radius": "4px", "padding": "10px" };
2159
2186
  const openCodeDialog = () => {
2160
2187
  const preEl = ed.dom.getParent(ed.selection.getNode(), "pre");