This will be used for drag-and-drop.
// Display the mail folder list
//
// Display the mail folder list
//
-// Copyright (c) 2016-2022 by the citadel.org team
+// Copyright (c) 2016-2023 by the citadel.org team
//
// This program is open source software. Use, duplication, or
// disclosure are subject to the GNU General Public License v3.
//
// This program is open source software. Use, duplication, or
// disclosure are subject to the GNU General Public License v3.
rendered_list += "<ul class=\"ctdl_mail_folders\">\n";
for (let i=0; i<roomlist_json.length; ++i) {
if (roomlist_json[i].current_view == views.VIEW_MAILBOX) {
rendered_list += "<ul class=\"ctdl_mail_folders\">\n";
for (let i=0; i<roomlist_json.length; ++i) {
if (roomlist_json[i].current_view == views.VIEW_MAILBOX) {
- rendered_list += "<li onClick=\"gotoroom('" + roomlist_json[i].name + "');\">";
- rendered_list += ((roomlist_json[i].name == "Mail") ? _("INBOX") : escapeHTML(roomlist_json[i].name));
- rendered_list += "</li>\n";
+ rendered_list += "<li "
+ + "onmouseup=\"mail_mouseup('" + roomlist_json[i].name + "');\" "
+ + "onClick=\"gotoroom('" + roomlist_json[i].name + "');\">"
+ + ((roomlist_json[i].name == "Mail") ? _("INBOX") : escapeHTML(roomlist_json[i].name))
+ + "</li>\n"
+ ;
}
}
rendered_list += "</ul>";
}
}
rendered_list += "</ul>";
+
+
+// The user released the mouse button over a folder name -- this is probably a drop event
+function mail_mouseup(roomname) {
+ console.log("mail_mouseup " + roomname);
+
+ // todo:
+ // 1. First check to see if a drag operation is in progress. Exit if there is no such case.
+ // 2. Perform the MOVE operation on the selected rows.
+
+}
+
// This is the async back end for mail_delete_selected()
mail_delete_func = async(table, row) => {
// This is the async back end for mail_delete_selected()
mail_delete_func = async(table, row) => {
- let m = parseInt(row["id"].substring(12)); // derive msgnum from row id
+ let m = parseInt(row["id"].substring(12)); // derive msgnum from row id
if (is_trash_folder) {
response = await fetch(
if (is_trash_folder) {
response = await fetch(
- if (response.ok) { // If the server accepted the delete, blank out the message div.
+ if (response.ok) { // If the server accepted the delete, blank out the message div
table.deleteRow(row.rowIndex);
if (m == displayed_message) {
document.getElementById("ctdl-mailbox-reading-pane").innerHTML = "";
table.deleteRow(row.rowIndex);
if (m == displayed_message) {
document.getElementById("ctdl-mailbox-reading-pane").innerHTML = "";
-// Copyright (c) 2016-2022 by the citadel.org team
+// Copyright (c) 2016-2023 by the citadel.org team
//
// This program is open source software. Use, duplication, or
// disclosure are subject to the GNU General Public License v3.
//
// This program is open source software. Use, duplication, or
// disclosure are subject to the GNU General Public License v3.
// Clear the sidebar buttons of any style indicating that one is selected
function clear_sidebar_selection() {
var items = document.getElementById("ctdl-sidebar").getElementsByTagName("*");
// Clear the sidebar buttons of any style indicating that one is selected
function clear_sidebar_selection() {
var items = document.getElementById("ctdl-sidebar").getElementsByTagName("*");