From: Art Cancro Date: Mon, 3 Jul 2023 17:07:39 +0000 (-0900) Subject: mail_folder_list.js: accept hover and drop events X-Git-Tag: v981~57 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=0eacbcaa68220fb56e1b0e82eba3bcb3302312d4;p=citadel.git mail_folder_list.js: accept hover and drop events --- diff --git a/webcit-ng/README.md b/webcit-ng/README.md index e5714bd81..a7890dcf9 100644 --- a/webcit-ng/README.md +++ b/webcit-ng/README.md @@ -26,6 +26,7 @@ REST format URLs will generally take the form of: * libcitadel for information about the Citadel server, some string handling, and the JSON encoder * Expat for DAV handling * OpenSSL for TLS +* FontAwesome for icons ## We are NOT using * Your favorite javascript library diff --git a/webcit-ng/static/css/webcit.css b/webcit-ng/static/css/webcit.css index 8bda814ff..9031087f5 100644 --- a/webcit-ng/static/css/webcit.css +++ b/webcit-ng/static/css/webcit.css @@ -279,11 +279,12 @@ html,body,h1,h2,h3,h4,h5 { } .ctdl_mail_folders li { - color: DarkSlateGrey; + color: Black; + padding-left: 10px; } .ctdl_mail_folders li:hover { - color: Black; + color: DarkSlateGrey; } .ctdl-avatar { diff --git a/webcit-ng/static/index.html b/webcit-ng/static/index.html index acff2e5d8..28e750e6f 100644 --- a/webcit-ng/static/index.html +++ b/webcit-ng/static/index.html @@ -1,7 +1,7 @@ @@ -18,7 +18,7 @@
-
DRAGGO
+
diff --git a/webcit-ng/static/js/mail_folder_list.js b/webcit-ng/static/js/mail_folder_list.js index e84730586..ba8a74f56 100644 --- a/webcit-ng/static/js/mail_folder_list.js +++ b/webcit-ng/static/js/mail_folder_list.js @@ -10,7 +10,7 @@ function display_mail_folder_list(target_div) { display_mail_folder_list_async = async(target_div) => { - let rendered_list = "hi from display_mail_folder_list_async()"; + let rendered_list = ""; // load the room list from the Citadel Server response = await fetch("/ctdl/r/", { method: "GET" } ); @@ -51,7 +51,11 @@ function render_mail_folder_list(roomlist_json) { for (let i=0; i" + ((roomlist_json[i].name == "Mail") ? _("INBOX") : escapeHTML(roomlist_json[i].name)) + "\n" @@ -63,13 +67,28 @@ function render_mail_folder_list(roomlist_json) { } -// 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); +function mail_dragenter_handler(event) { + event.preventDefault(); + return false; +} + + +function mail_dragover_handler(event) { + event.preventDefault(); + return false; +} - // 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. +function mail_dragleave_handler(event) { + event.preventDefault(); + return false; } + +function mail_drop_handler(event, to_room) { + console.log("Drop! " + event.currentTarget.id + " to room '" + to_room + "'"); + event.preventDefault(); + return false; +} + + diff --git a/webcit-ng/static/js/view_mail.js b/webcit-ng/static/js/view_mail.js index ff50eae3c..a925ce5b3 100644 --- a/webcit-ng/static/js/view_mail.js +++ b/webcit-ng/static/js/view_mail.js @@ -522,7 +522,7 @@ function make_cc_bcc_visible() { // Helper function for mail_send_messages() to extract and decode metadata values. function msm_field(element_name, separator) { let s1 = document.getElementById(element_name).innerHTML; - let s2 = s1.replaceAll("|",separator); // Replace "|" with "!" because "|" is a field separator in Citadel wire protocol + let s2 = s1.replaceAll("|",separator); // Replace "|" with "!" because "|" is a field separator in Citadel let s3 = decodeURI(s2); let s4 = document.createElement("textarea"); // This One Weird Trick Unescapes All HTML Entities s4.innerHTML = s3;