* Message delete: table row delete is now handled by a script.aculo.us effect
authorArt Cancro <ajc@citadel.org>
Sun, 6 Nov 2005 17:27:45 +0000 (17:27 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 6 Nov 2005 17:27:45 +0000 (17:27 +0000)
  instead of by just clearing out the innerHTML of the table row div, because
  IE barfs on the latter.

webcit/ChangeLog
webcit/static/wclib.js
webcit/webcit.c

index b6e7726dee197de02221426b78dff4bb1fd75c93..a9902fd1b1cec388306b149bdeced34a827995be 100644 (file)
@@ -1,5 +1,10 @@
 $Id$
 
+Sun Nov  6 12:26:43 EST 2005
+* Message delete: table row delete is now handled by a script.aculo.us effect
+  instead of by just clearing out the innerHTML of the table row div, because
+  IE barfs on the latter.
+
 Sat Nov  5 22:53:29 EST 2005 ajc
 * Found and removed more absolute URL's.
 
index 6605e598dc8281e822b8fc832201c716485b449e..6e9d0cfff313720beb93ffa36464c7e5f63adcf9 100644 (file)
@@ -42,9 +42,9 @@ function hide_imsg_popup() {
 
 // This function activates the ajax-powered recipient autocompleters on the message entry screen.
 function activate_entmsg_autocompleters() {
-       new Ajax.Autocompleter('cc_id', 'cc_name_choices', '/cc_autocomplete', {} );
-       new Ajax.Autocompleter('bcc_id', 'bcc_name_choices', '/bcc_autocomplete', {} );
-       new Ajax.Autocompleter('recp_id', 'recp_name_choices', '/recp_autocomplete', {} );
+       new Ajax.Autocompleter('cc_id', 'cc_name_choices', 'cc_autocomplete', {} );
+       new Ajax.Autocompleter('bcc_id', 'bcc_name_choices', 'bcc_autocomplete', {} );
+       new Ajax.Autocompleter('recp_id', 'recp_name_choices', 'recp_autocomplete', {} );
 }
 
 
@@ -96,11 +96,11 @@ function CtdlSingleClickMsg(evt, msgnum) {
        }
 
        // Update the preview pane
-       new Ajax.Updater('preview_pane', '/msg/'+msgnum, { method: 'get' } );
+       new Ajax.Updater('preview_pane', 'msg/'+msgnum, { method: 'get' } );
 
        // Mark the message as read
        new Ajax.Request(
-               '/ajax_servcmd', {
+               'ajax_servcmd', {
                        method: 'post',
                        parameters: 'g_cmd=SEEN '+msgnum+'|1',
                        onComplete: CtdlRemoveTheUnseenBold(msgnum)
@@ -110,26 +110,16 @@ function CtdlSingleClickMsg(evt, msgnum) {
        return false;           // try to defeat the default click behavior
 }
 
-// Take the boldface away from a message to indicate that it has been seen.
-function CtdlRemoveTheUnseenBold(msgnum) {
-       $('m'+msgnum).style.fontWeight='normal' ;
-}
-
-// A message has been deleted, so yank it from the list.
-function CtdlClearDeletedMsg(msgnum) {
-       $('m'+msgnum).innerHTML = '' ;
-}
-
-
 // Delete selected messages.
 function CtdlDeleteSelectedMessages(evt) {
+       
        if (CtdlNumMsgsSelected < 1) {
                // Nothing to delete, so exit silently.
                return false;
        }
        for (i=0; i<CtdlNumMsgsSelected; ++i) {
                new Ajax.Request(
-                       '/ajax_servcmd', {
+                       'ajax_servcmd', {
                                method: 'post',
                                parameters: 'g_cmd=MOVE ' + CtdlMsgsSelected[i] + '|_TRASH_|0',
                                onComplete: CtdlClearDeletedMsg(CtdlMsgsSelected[i])
@@ -144,9 +134,20 @@ function CtdlDeleteSelectedMessages(evt) {
 
 // This gets called when the user touches the keyboard after selecting messages...
 function CtdlMsgListKeyPress(evt) {
-       if (evt.which == 46) {                          // DELETE key
+       if (evt.keyCode == 46) {                                // DELETE key
                CtdlDeleteSelectedMessages(evt);
        }
        return true;
 }
 
+// Take the boldface away from a message to indicate that it has been seen.
+function CtdlRemoveTheUnseenBold(msgnum) {
+       $('m'+msgnum).style.fontWeight='normal';
+}
+
+// A message has been deleted, so yank it from the list.
+// (IE barfs on m9999.innerHTML='' so we use a script.aculo.us effect instead.)
+function CtdlClearDeletedMsg(msgnum) {
+       new Effect.Squish('m'+msgnum);
+}
+
index 1eff37aa76b606c0ae7832387cbd1f3f00081df6..bd875ecd3545b42f1ea9d605bc774662be62da41 100644 (file)
@@ -833,8 +833,10 @@ void ajax_servcmd(void)
 
        begin_ajax_response();
 
+       /* lprintf(9, "Sending cmd: %s\n", bstr("g_cmd")); */
        serv_printf("%s", bstr("g_cmd"));
        serv_getln(buf, sizeof buf);
+       /* lprintf(9, "   Response: %s\n", buf); */
 
        if (buf[0] == '8') {
                serv_printf("\n\n000");