@bobfrankston/rmfmail 1.1.105 → 1.1.106

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.
@@ -9861,18 +9861,32 @@ optEditorTiptap?.addEventListener("change", () => {
9861
9861
  if (optEditorTiptap.checked) saveEditorSetting("tiptap");
9862
9862
  });
9863
9863
  optEditorTinymce?.addEventListener("change", () => {
9864
- if (optEditorTinymce.checked) {
9865
- saveEditorSetting("tinymce");
9866
- try {
9867
- const cdnUrl = localStorage.getItem("mailx-tinymce-cdn") || "lib/tinymce/tinymce.min.js";
9868
- const link = document.createElement("link");
9869
- link.rel = "prefetch";
9870
- link.as = "script";
9871
- link.href = cdnUrl;
9872
- document.head.appendChild(link);
9873
- } catch {
9874
- }
9875
- }
9864
+ if (!optEditorTinymce.checked) return;
9865
+ saveEditorSetting("tinymce");
9866
+ const cdnUrl = localStorage.getItem("mailx-tinymce-cdn") || "lib/tinymce/tinymce.min.js";
9867
+ const label = optEditorTinymce.closest("label");
9868
+ let status = document.getElementById("opt-editor-tinymce-status");
9869
+ if (label && !status) {
9870
+ status = document.createElement("span");
9871
+ status.id = "opt-editor-tinymce-status";
9872
+ status.className = "tb-menu-status";
9873
+ label.appendChild(status);
9874
+ }
9875
+ const setStatus = (text, state) => {
9876
+ if (!status) return;
9877
+ status.textContent = text;
9878
+ status.dataset.state = state;
9879
+ };
9880
+ setStatus(" loading\u2026", "pending");
9881
+ fetch(cdnUrl, { cache: "force-cache" }).then((r) => r.ok ? r.arrayBuffer() : Promise.reject(new Error(`HTTP ${r.status}`))).then(() => {
9882
+ setStatus(" \u2713 ready", "ready");
9883
+ setTimeout(() => {
9884
+ if (status?.dataset.state === "ready") setStatus("", "idle");
9885
+ }, 4e3);
9886
+ }).catch((e) => {
9887
+ setStatus(" \u26A0 load failed", "error");
9888
+ console.error("[tinymce] pre-warm fetch failed:", e?.message || e);
9889
+ });
9876
9890
  });
9877
9891
  var optExtEditAuto = document.getElementById("opt-extedit-auto");
9878
9892
  var optExtEditWord = document.getElementById("opt-extedit-word");