From: Art Cancro Date: Sat, 23 Sep 2023 20:28:05 +0000 (-0400) Subject: view_mail.js: show/hide attachments screen, added title bar style and close button X-Git-Tag: v995~13 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=dff30f2126e212eec6fd5884c0673f78e252d214;p=citadel.git view_mail.js: show/hide attachments screen, added title bar style and close button --- diff --git a/webcit-ng/static/css/webcit.css b/webcit-ng/static/css/webcit.css index 66147d118..57a611ef5 100644 --- a/webcit-ng/static/css/webcit.css +++ b/webcit-ng/static/css/webcit.css @@ -637,6 +637,17 @@ blockquote pre { overflow: hidden; } +.ctdl-compose-attachments-title { + padding: 1em; + background: Gainsboro; + display: flex; + flex-wrap: nowrap; + flex-direction: row; + justify-content: space-between; + align-items: auto; + align-content: start +} + .ctdl-login-screen-grid-container { display: grid; grid-template-columns: auto auto; diff --git a/webcit-ng/static/js/view_mail.js b/webcit-ng/static/js/view_mail.js index 2847109b3..4bcb2886c 100644 --- a/webcit-ng/static/js/view_mail.js +++ b/webcit-ng/static/js/view_mail.js @@ -13,6 +13,7 @@ var newmail_notify = { NO : 0, // do not perform new mail notifications YES : 1 // yes, perform new mail notifications }; +var num_attachments = 0; // number of attachments in current composed msg // This is the async back end for mail_delete_selected() @@ -513,7 +514,7 @@ function mail_compose(is_quoted, references, quoted_msgnum, m_to, m_cc, m_subjec + "
" + " " + _("Send message") + "" + "" + _("Save to Drafts") + "" - + "" + _("Attachments:") + " 0" + "" + + " " + _("Attachments:") + " " + num_attachments + "" + "" + _("Contacts") + "" + " " + _("Cancel") + "" + "
" @@ -525,6 +526,37 @@ function mail_compose(is_quoted, references, quoted_msgnum, m_to, m_cc, m_subjec document.getElementById("ctdl-compose-cc-label").style.display = "block"; document.getElementById("ctdl-compose-cc-field").style.display = "block"; } + + // Now the compose screen is set up properly; set up the attachments modal in case the user wants it + + document.getElementById("ctdl_big_modal").innerHTML = "" + + "
" + + "
" + + "

" + _("Attachments:") + "

" + + "

" + + "
" + + "
" + + "this is the attachments modal. there are many like it, but this one is mine." + + "
" + ; + +} + + +// Show or hide the attachments window in the composer +function show_or_hide_attachments() { + + if (document.getElementById("ctdl_big_modal").style.display == "block") { + document.getElementById("ctdl_big_modal").style.display = "none"; + } + else { + document.getElementById("ctdl_big_modal").style.display = "block"; + document.getElementById("ctdl_attachments_outer").style.width = + Math.trunc((document.getElementById("ctdl-editor-body").getBoundingClientRect().width) * 0.90).toString() + "px"; + document.getElementById("ctdl_attachments_outer").style.height = + Math.trunc((document.getElementById("ctdl-editor-body").getBoundingClientRect().height) * 0.90).toString() + "px"; + } + }