From 741ac7d021c1983e023231ce48da11b63c9d8a6e Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 3 Sep 2009 15:25:18 +0000 Subject: [PATCH] * Move SMTP queue view JavaScript to wclib.js * Initial load of SMTP queue is now done with an ajax refresh, so if the queue is large the page displays with a throbber and then loads --- webcit/smtpqueue.c | 35 ++++++++--------------------------- webcit/static/wclib.js | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 27 deletions(-) diff --git a/webcit/smtpqueue.c b/webcit/smtpqueue.c index f1310a6ad..b3c0983d1 100644 --- a/webcit/smtpqueue.c +++ b/webcit/smtpqueue.c @@ -131,7 +131,7 @@ void display_queue_msg(long msgnum) wprintf(""); wprintf("%ld
", msgnum); - wprintf(" %s", + wprintf(" %s", msgnum, msgid, _("(Delete)") ); @@ -233,26 +233,6 @@ void display_smtpqueue(void) { output_headers(1, 1, 2, 0, 0, 0); - wprintf(" \n" - ); - wprintf("
\n"); wprintf("

"); wprintf(_("View the outbound SMTP queue")); @@ -265,16 +245,17 @@ void display_smtpqueue(void) "" "
\n"); - wprintf("
"); - - display_smtpqueue_inner_div(); - - wprintf("
" + wprintf("
" + "
" + "
" "
" - "%s" + "%s" "
" "

\n", _("Refresh this page") ); + + StrBufAppendPrintf(WC->trailing_javascript, "RefreshSMTPqueueDisplay();\n"); + wDumpContent(1); } diff --git a/webcit/static/wclib.js b/webcit/static/wclib.js index ff5d1b0cd..77b07f5f8 100644 --- a/webcit/static/wclib.js +++ b/webcit/static/wclib.js @@ -924,3 +924,19 @@ function resizeViewport() { global.style.width = newContentSize+"px"; } } + +function RefreshSMTPqueueDisplay() { + new Ajax.Updater('smtpqueue_inner_div', + 'display_smtpqueue_inner_div', { method: 'get', + parameters: Math.random() } ); +} + +function DeleteSMTPqueueMsg(msgnum1, msgnum2) { + new Ajax.Request( + 'ajax_servcmd', { + method: 'post', + parameters: 'g_cmd=DELE ' + msgnum1 + ',' + msgnum2, + onComplete: RefreshSMTPqueueDisplay() + } + ); +} -- 2.30.2