@bobfrankston/rmfmail 1.1.106 → 1.1.107

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.
@@ -7418,14 +7418,14 @@ function quoteBody(msg) {
7418
7418
  const date = new Date(msg.date).toLocaleString();
7419
7419
  const from = msg.from.name ? `${msg.from.name} <${msg.from.address}>` : msg.from.address;
7420
7420
  const body = sanitizeQuotedBody(msg);
7421
- return `<br><br><div class="reply"><p>On ${date}, ${from} wrote:</p><blockquote>${body}</blockquote></div>`;
7421
+ return `<p><br></p><div class="reply"><p>On ${date}, ${from} wrote:</p><blockquote>${body}</blockquote></div>`;
7422
7422
  }
7423
7423
  function forwardBody(msg) {
7424
7424
  const date = new Date(msg.date).toLocaleString();
7425
7425
  const from = msg.from.name ? `${msg.from.name} &lt;${msg.from.address}&gt;` : msg.from.address;
7426
7426
  const to = msg.to.map((a) => a.name ? `${a.name} &lt;${a.address}&gt;` : a.address).join(", ");
7427
7427
  const body = sanitizeQuotedBody(msg);
7428
- return `<br><br><div class="reply"><p>---------- Forwarded message ----------<br>From: ${from}<br>Date: ${date}<br>Subject: ${msg.subject}<br>To: ${to}</p>${body}</div>`;
7428
+ return `<p><br></p><div class="reply"><p>---------- Forwarded message ----------<br>From: ${from}<br>Date: ${date}<br>Subject: ${msg.subject}<br>To: ${to}</p>${body}</div>`;
7429
7429
  }
7430
7430
  var lastDeleted = null;
7431
7431
  var lastMoved = null;
@@ -7944,6 +7944,8 @@ searchInput?.addEventListener("scroll", () => {
7944
7944
  });
7945
7945
  searchInput?.addEventListener("change", () => updateSearchHighlight());
7946
7946
  updateSearchHighlight();
7947
+ var SERVER_SEARCH_DALLY_MS = 700;
7948
+ var serverSearchTimer = null;
7947
7949
  function doSearch(immediate = false) {
7948
7950
  const query = searchInput.value.trim();
7949
7951
  if (query.length === 0) {
@@ -7954,9 +7956,13 @@ function doSearch(immediate = false) {
7954
7956
  const serverCheck = document.getElementById("search-server-too");
7955
7957
  const trashCheck = document.getElementById("search-include-trash");
7956
7958
  const localScope = searchScope?.value || "all";
7957
- const effectiveScope = serverCheck?.checked ? "server" : localScope;
7958
7959
  const includeTrash = !!trashCheck?.checked;
7959
- if (effectiveScope === "current" && !immediate) {
7960
+ const serverOn = !!serverCheck?.checked;
7961
+ if (serverSearchTimer) {
7962
+ clearTimeout(serverSearchTimer);
7963
+ serverSearchTimer = null;
7964
+ }
7965
+ if (localScope === "current" && !serverOn && !immediate) {
7960
7966
  const body = document.getElementById("ml-body");
7961
7967
  if (body) {
7962
7968
  const lower = query.toLowerCase();
@@ -7967,19 +7973,30 @@ function doSearch(immediate = false) {
7967
7973
  }
7968
7974
  return;
7969
7975
  }
7970
- loadSearchResults(query, effectiveScope, currentAccountId3, currentFolderId2, includeTrash);
7976
+ const localScopeEff = localScope === "current" ? "current" : "all";
7977
+ loadSearchResults(query, localScopeEff, currentAccountId3, currentFolderId2, includeTrash);
7971
7978
  setTitle(`${APP_NAME} - Search: ${query}`);
7972
7979
  setActiveView(
7973
- { kind: "search", query, scope: effectiveScope, accountId: currentAccountId3, folderId: currentFolderId2, includeTrash },
7980
+ { kind: "search", query, scope: serverOn ? "server" : localScopeEff, accountId: currentAccountId3, folderId: currentFolderId2, includeTrash },
7974
7981
  `Search: ${query}`
7975
7982
  );
7976
7983
  recordSearchHistory(query);
7984
+ if (serverOn) {
7985
+ serverSearchTimer = setTimeout(() => {
7986
+ serverSearchTimer = null;
7987
+ loadSearchResults(query, "server", currentAccountId3, currentFolderId2, includeTrash);
7988
+ }, SERVER_SEARCH_DALLY_MS);
7989
+ }
7977
7990
  }
7978
7991
  var currentAccountId3 = "";
7979
7992
  var currentFolderId2 = 0;
7980
7993
  var reloadDebounceTimer = null;
7981
7994
  searchInput?.addEventListener("input", () => {
7982
7995
  clearTimeout(searchTimeout);
7996
+ if (serverSearchTimer) {
7997
+ clearTimeout(serverSearchTimer);
7998
+ serverSearchTimer = null;
7999
+ }
7983
8000
  updateSearchHighlight();
7984
8001
  if (searchInput.value.trim() === "") {
7985
8002
  clearSearchMode();
@@ -7988,7 +8005,7 @@ searchInput?.addEventListener("input", () => {
7988
8005
  reloadCurrentFolder();
7989
8006
  setTitle(APP_NAME);
7990
8007
  } else {
7991
- searchTimeout = setTimeout(() => doSearch(false), 300);
8008
+ searchTimeout = setTimeout(() => doSearch(false), 180);
7992
8009
  }
7993
8010
  });
7994
8011
  searchInput?.addEventListener("keydown", (e) => {
@@ -7998,6 +8015,10 @@ searchInput?.addEventListener("keydown", (e) => {
7998
8015
  }
7999
8016
  if (e.key === "Escape") {
8000
8017
  searchInput.value = "";
8018
+ if (serverSearchTimer) {
8019
+ clearTimeout(serverSearchTimer);
8020
+ serverSearchTimer = null;
8021
+ }
8001
8022
  updateSearchHighlight();
8002
8023
  clearSearchMode();
8003
8024
  const body = document.getElementById("ml-body");