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()
+ "<div class=\"ctdl-compose-toolbar\">"
+ "<span class=\"ctdl-msg-button\" onclick=\"mail_send_message()\"><i class=\"fa fa-paper-plane\" style=\"color:green\"></i> " + _("Send message") + "</span>"
+ "<span class=\"ctdl-msg-button\">" + _("Save to Drafts") + "</span>"
- + "<span class=\"ctdl-msg-button\">" + _("Attachments:") + " 0" + "</span>"
+ + "<span class=\"ctdl-msg-button\" onClick=\"show_or_hide_attachments()\"><i class=\"fa fa-paperclip\" style=\"color:grey\"></i> " + _("Attachments:") + " <span id=\"ctdl_num_attachments\">" + num_attachments + "</span></span>"
+ "<span class=\"ctdl-msg-button\">" + _("Contacts") + "</span>"
+ "<span class=\"ctdl-msg-button\" onClick=\"gotoroom(current_room)\"><i class=\"fa fa-trash\" style=\"color:red\"></i> " + _("Cancel") + "</span>"
+ "</div>"
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 = ""
+ + "<div id=\"ctdl_attachments_outer\">"
+ + "<div id=\"ctdl_attachments_title\" class=\"ctdl-compose-attachments-title\">"
+ + "<div><h1><i class=\"fa fa-paperclip\" style=\"color:grey\"></i> " + _("Attachments:") + "</h1></div>"
+ + "<div><h1><i class=\"fas fa-window-close\" style=\"color:red\" onClick=\"show_or_hide_attachments()\"></i></h1></div>"
+ + "</div>"
+ + "<br>"
+ + "this is the attachments modal. there are many like it, but this one is mine."
+ + "</div>"
+ ;
+
+}
+
+
+// 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";
+ }
+
}