@bobfrankston/rmfmail 1.1.97 → 1.1.98

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.
package/.commitmsg CHANGED
@@ -1,15 +1,7 @@
1
- Reply scrolls to top; Ctrl+A no longer hijacked in text fields
1
+ Signature now applied to replies/forwards, not just new mail
2
2
 
3
- - Reply/forward: setCursor(0) now scrolls the editor viewport to the top
4
- (editor.getWin().scrollTo(0,0)), so the caret above the quoted block is
5
- the line you're looking at instead of being left scrolled down inside
6
- the quote.
7
-
8
- - Ctrl+A: the message-list select-all guard used `.closest(".message-list,
9
- .ml-body, body)` — `body` always matches, so Ctrl+A in the search box
10
- (or any input) selected every message instead of the box's text. Now it
11
- returns early when focus is in an INPUT/TEXTAREA/SELECT/contenteditable,
12
- so Ctrl+A selects (and lets you clear) the search field normally.
13
-
14
- - docs/rmf-tiny.md: marked implemented; added a running "Known TinyMCE
15
- quirks" log (caret/scroll, link-extend, spellcheck, <p>-to-<br>).
3
+ The new-format signature (acct.sig.text) was gated on "new mail only",
4
+ so anyone using it got no signature on a reply or forward — only the
5
+ legacy acct.signature field covered replies. Both formats now apply to
6
+ new + reply + forward alike: above the quoted block on a reply/forward,
7
+ at the end on new mail. Drafts still skip it (already in the saved body).
@@ -4006,14 +4006,18 @@ function applyInit(init) {
4006
4006
  (_match, attrs, inner) => `<pre${attrs}>${inner.replace(/\r\n|\r|\n/g, "<br>")}</pre>`
4007
4007
  );
4008
4008
  const acct = init.accounts.find((a) => a.id === init.accountId);
4009
- const isNew = init.mode !== "reply" && init.mode !== "replyAll" && init.mode !== "forward" && init.mode !== "draft" && !init.draftUid;
4010
4009
  const isReplyForward = init.mode === "reply" || init.mode === "replyAll" || init.mode === "forward";
4011
- if (isNew && acct?.sig?.text) {
4012
- const sigText = acct.sig.html ? acct.sig.text : escapeHtml(acct.sig.text).replace(/\n/g, "<br>");
4013
- bodyToRender = `${bodyToRender}<br><br>-- <br>${sigText}`;
4014
- } else if (acct?.signature && init.mode !== "draft" && !init.draftUid) {
4015
- const sigBlock = `<br><br>--<br>${acct.signature}`;
4016
- bodyToRender = isReplyForward ? `<br>${sigBlock}<br>${bodyToRender}` : `${bodyToRender}${sigBlock}`;
4010
+ if (init.mode !== "draft" && !init.draftUid) {
4011
+ let sigHtml = "";
4012
+ if (acct?.sig?.text) {
4013
+ sigHtml = acct.sig.html ? acct.sig.text : escapeHtml(acct.sig.text).replace(/\n/g, "<br>");
4014
+ } else if (acct?.signature) {
4015
+ sigHtml = acct.signature;
4016
+ }
4017
+ if (sigHtml) {
4018
+ const sigBlock = `<br><br>-- <br>${sigHtml}`;
4019
+ bodyToRender = isReplyForward ? `<br>${sigBlock}<br>${bodyToRender}` : `${bodyToRender}${sigBlock}`;
4020
+ }
4017
4021
  }
4018
4022
  if (bodyToRender) {
4019
4023
  editor.setHtml(bodyToRender);