From: Art Cancro Date: Thu, 20 Oct 2022 23:05:59 +0000 (-0400) Subject: get ready for quoted messages X-Git-Tag: v959~19 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=9ac48b6d5bffeb709db5d2460c7c1f208ae1fb35;p=citadel.git get ready for quoted messages --- diff --git a/webcit-ng/static/js/view_mail.js b/webcit-ng/static/js/view_mail.js index e69e74939..f6b8d83d1 100644 --- a/webcit-ng/static/js/view_mail.js +++ b/webcit-ng/static/js/view_mail.js @@ -11,7 +11,8 @@ var RefreshMailboxInterval; // We store our refresh timer here // Render a message into the mailbox view -function mail_render_one(msg, target_div) { +// (We want the message number and the message itself because we need to keep the msgnum for reply purposes) +function mail_render_one(msgnum, msg, target_div) { let div = "FIXME"; try { outmsg = @@ -28,13 +29,13 @@ function mail_render_one(msg, target_div) { + "" // begin buttons on right side + "" // Reply (mail is always Quoted) - + "" + + "" + " " + _("Reply") + "" + "" // Reply-All (mail is always Quoted) - + "" + + "" + " " + _("ReplyAll") + ""; @@ -78,7 +79,7 @@ function mail_display_message(msgnum, target_div) { response = await fetch(url); msg = await(response.json()); if (response.ok) { - mail_render_one(msg, target_div); + mail_render_one(msgnum, msg, target_div); } } mail_fetch_msg(); @@ -208,7 +209,8 @@ function render_mailbox_display() { // Compose a new mail message (called by the Reply button here, or by the dispatcher in views.js) -function mail_compose(is_quoted, references, msgid) { +function mail_compose(is_quoted, references, msgnum) { + quoted_div_name = randomString(); // Make the "Write mail" button disappear. We're already there! document.getElementById("ctdl-newmsg-button").style.display = "none"; @@ -218,12 +220,10 @@ function mail_compose(is_quoted, references, msgid) { // msgid if a reply, the msgid of the most recent message in the chain, the one to which we are replying // Now display the screen. - document.getElementById("ctdl-main").innerHTML - + compose_screen = // Hidden values that we are storing right here in the document tree for later - = "" + "" + "" - + "" // Header fields, the composition window, and the button bar are arranged using a Grid layout. + "
" @@ -249,7 +249,18 @@ function mail_compose(is_quoted, references, msgid) { // Message composition box + "
" - + "
" + ; + + if (is_quoted) { + compose_screen += + "

" + + "FIXME get the quoted message into here" + + "
"; + ; + } + + compose_screen += + "
" // The button bar is a Grid element, and is also a Flexbox container. + "
" @@ -260,6 +271,9 @@ function mail_compose(is_quoted, references, msgid) { + " " + _("Cancel") + "" + "
" ; + + document.getElementById("ctdl-main").innerHTML = compose_screen; + } function make_cc_bcc_visible() { diff --git a/webcit-ng/static/js/views.js b/webcit-ng/static/js/views.js index 46db83528..971f6397b 100644 --- a/webcit-ng/static/js/views.js +++ b/webcit-ng/static/js/views.js @@ -61,7 +61,7 @@ function entmsg_dispatcher() { forum_entmsg(); break; case views.VIEW_MAILBOX: - mail_compose(false, "", ""); + mail_compose(false, "", 0); break; default: break;