From: Art Cancro Date: Fri, 10 Dec 2010 17:26:22 +0000 (-0500) Subject: Reworking the enter message and attach dialogs X-Git-Tag: v8.01~528 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=06189cea8146e80cbb594c3ee0facb462c8953c1 Reworking the enter message and attach dialogs --- diff --git a/libcitadel/tests/dolcov.sh b/libcitadel/tests/dolcov.sh old mode 100755 new mode 100644 diff --git a/webcit/messages.c b/webcit/messages.c index 9286d3992..88faa7b2e 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -1072,47 +1072,17 @@ void post_message(void) att->Data = WCC->upload; WCC->upload = NULL; WCC->upload_length = 0; - display_enter(); - return; + + /* and keep going, because we don't do attachments in two posts anymore */ } if (!strcasecmp(bstr("submit_action"), "cancel")) { sprintf(WCC->ImportantMessage, _("Cancelled. Message was not posted.")); - } else if (havebstr("attach_button")) { - display_enter(); - return; } else if (lbstr("postseq") == dont_post) { sprintf(WCC->ImportantMessage, _("Automatically cancelled because you have already " "saved this message.")); - } else if (havebstr("remove_attach_button")) { - /* now thats st00pit. need to find it by name. */ - void *vAtt; - StrBuf *WhichAttachment; - HashPos *at; - long len; - const char *key; - - WhichAttachment = NewStrBufDup(sbstr("which_attachment")); - StrBufUnescape(WhichAttachment, 0); - at = GetNewHashPos(WCC->attachments, 0); - do { - GetHashPos(WCC->attachments, at, &len, &key, &vAtt); - - att = (wc_mime_attachment*) vAtt; - if ((att != NULL) && - (strcmp(ChrPtr(WhichAttachment), - ChrPtr(att->FileName) ) == 0)) - { - DeleteEntryFromHash(WCC->attachments, at); - break; - } - } - while (NextHashPos(WCC->attachments, at)); - FreeStrBuf(&WhichAttachment); - display_enter(); - return; } else { const char CMD[] = "ENT0 1|%s|%d|4|%s|%s||%s|%s|%s|%s|%s"; StrBuf *Recp = NULL; @@ -1681,8 +1651,6 @@ void MimeLoadData(wc_mime_attachment *Mime) } - - void view_mimepart(void) { mimepart(0); } @@ -1717,6 +1685,7 @@ void download_postpart(void) { FreeStrBuf(&partnum); } + void h_readnew(void) { readloop(readnew, eUseDefault);} void h_readold(void) { readloop(readold, eUseDefault);} void h_readfwd(void) { readloop(readfwd, eUseDefault);} diff --git a/webcit/paramhandling.c b/webcit/paramhandling.c index 86d9d1aa4..8b36c277e 100644 --- a/webcit/paramhandling.c +++ b/webcit/paramhandling.c @@ -308,7 +308,7 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp, long keylen; #ifdef DEBUG_URLSTRINGS - lprintf(9, "upload_handler() name=%s, type=%s, len=%d\n", name, cbtype, length); + lprintf(9, "\033[31mupload_handler() name=%s, type=%s, len=%d\033[0m\n", name, cbtype, length); #endif if (WCC->Hdr->urlstrings == NULL) WCC->Hdr->urlstrings = NewHash(1, NULL); @@ -340,13 +340,15 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp, #endif } - /** Uploaded files */ + /* Uploaded files */ if ( (length > 0) && (!IsEmptyStr(cbtype)) ) { WCC->upload = NewStrBufPlain(content, length); WCC->upload_length = length; WCC->upload_filename = NewStrBufPlain(filename, -1); - safestrncpy(WCC->upload_content_type, cbtype, - sizeof(WC->upload_content_type)); + safestrncpy(WCC->upload_content_type, cbtype, sizeof(WC->upload_content_type)); +#ifdef DEBUG_URLSTRINGS + lprintf(9, "File: <%s> len: [%ld]\n", filename, length); +#endif } diff --git a/webcit/static/styles/webcit.css b/webcit/static/styles/webcit.css index 358a77179..792f8a3a9 100644 --- a/webcit/static/styles/webcit.css +++ b/webcit/static/styles/webcit.css @@ -1262,3 +1262,29 @@ a.event_title:hover span.bttbottom, a.event_unread:hover span.bttbottom, a.event font-size: 100%; font-style: italic; } + +#attachments_form { + display:none; + position:absolute; + top:5%; + bottom:5%; + right:5%; + left:5%; + z-index: 10; + padding: 5px; + border-width: 1px; + border-style: solid; + border-color: #022750; + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; + background: #FFFFFF; + background: -webkit-gradient(linear, 0 0, 0 bottom, from(#FFFFFF), to(#DDDDEE)); + background: -moz-linear-gradient(#FFFFFF, #DDDDEE); + background: linear-gradient(#FFFFFF, #DDDDEE); + -pie-background: linear-gradient(#FFFFFF, #DDDDEE); + -webkit-box-shadow: #666 0px 2px 3px; + -moz-box-shadow: #666 0px 2px 3px; + box-shadow: #666 0px 2px 3px; + behavior: url(/static/styles/PIE.htc); +} diff --git a/webcit/static/t/attachments_pane.html b/webcit/static/t/attachments_pane.html new file mode 100644 index 000000000..bb3863483 --- /dev/null +++ b/webcit/static/t/attachments_pane.html @@ -0,0 +1,16 @@ +
+ + 
+ +

 

+ + + + + +  "> +  "> + + diff --git a/webcit/static/t/edit_message.html b/webcit/static/t/edit_message.html index 3e9b26671..2a07b04dd 100644 --- a/webcit/static/t/edit_message.html +++ b/webcit/static/t/edit_message.html @@ -2,6 +2,14 @@
+ +
+
+

+

+
+
+
"> @@ -66,19 +74,8 @@ " size=45 maxlength=70> - - - -
- - -    - -  "> -  "> -
+ + @@ -122,6 +119,14 @@ +
  • + + + + + + +
  • @@ -139,8 +144,8 @@
  • - + function hide_attachments_form() { + $('attachments_form').style.display = 'none'; + } + + function show_attachments_form() { + $('attachments_form').style.display = 'block'; + + p = 'template=attachments_pane&r=' + CtdlRandomString(); + new Ajax.Updater( + 'attachments_form', + 'do_template', + { + method: 'get', + parameters: p, + evalScripts: true + } + ); + } + +
    diff --git a/webcit/static/t/edit_message/section_attach_select.html b/webcit/static/t/edit_message/section_attach_select.html index 4fb8906d6..81c8787a1 100644 --- a/webcit/static/t/edit_message/section_attach_select.html +++ b/webcit/static/t/edit_message/section_attach_select.html @@ -1,2 +1,6 @@ - +
  • +   + (%, Bytes) +   "> +