]> code.citadel.org Git - citadel.git/blobdiff - webcit/notes.c
* collect sender / read / unread information for calendar items
[citadel.git] / webcit / notes.c
index d41ed4d2f6e53d2562d651aed8e1f34ea7176be6..3896d11cfe21588ca2e3d2bb8110dd36966412dd 100644 (file)
@@ -14,7 +14,7 @@
  * \brief display sticky notes
  * \param msgnum the citadel mesage number
  */
-void display_note(long msgnum)
+void display_note(long msgnum, int unread)
 {
        char buf[SIZ];
        char notetext[SIZ];
@@ -23,8 +23,7 @@ void display_note(long msgnum)
        int in_text = 0;
        int i, len;
 
-       wprintf("<IMG ALIGN=MIDDLE src=\"static/storenotes_48x.gif\">\n");
-
+//     wprintf("<IMG ALIGN=MIDDLE src=\"static/storenotes_48x.gif\">\n");
        serv_printf("MSG0 %ld", msgnum);
        serv_getln(buf, sizeof buf);
        if (buf[0] != '1') {
@@ -58,6 +57,26 @@ void display_note(long msgnum)
 
        /** Make it HTML-happy and print it. */
        stresc(display_notetext, SIZ, notetext, 0, 0);
+/* Lets try it as a draggable */
+       if (!IsEmptyStr(eid)) {
+               wprintf ("<IMG ALIGN=MIDDLE src=\"static/storenotes_48x.gif\" id=\"note_%s\" alt=\"Note\" ", eid); 
+               wprintf ("class=\"notes\">\n");
+               wprintf ("<script type=\"text/javascript\">\n");
+//             wprintf ("//<![CDATA[\n");
+               wprintf ("new Draggable (\"note_%s\", {revert:true})\n", eid);
+//             wprintf ("//]]>\n");
+               wprintf ("</script>\n");
+       }
+       else {
+               wprintf ("<IMG ALIGN=MIDDLE src=\"static/storenotes_48x.gif\" id=\"note_%ld\" ", msgnum); 
+               wprintf ("class=\"notes\">\n");
+               wprintf ("<script type=\"text/javascript\">\n");
+//             wprintf ("//<![CDATA[\n");
+               wprintf ("new Draggable (\"note_%ld\", {revert:true})\n", msgnum);
+//             wprintf ("//]]>\n");
+               wprintf ("</script>\n");
+       }
+       
        if (!IsEmptyStr(eid)) {
                wprintf("<span id=\"note%s\">%s</span><br />\n", eid, display_notetext);
        }
@@ -103,6 +122,7 @@ void updatenote(void)
                serv_printf("MSG0 %ld", msgnum);
                serv_getln(buf, sizeof buf);
                if (buf[0] == '1') {
+                       strcpy(notetext, "");
                        while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
                
                                /** Fill the buffer */