From 3f97120cb1f546f9c7973f11949e37ac1fb23412 Mon Sep 17 00:00:00 2001 From: vbenincasa Date: Sun, 4 Oct 2009 08:16:20 +0000 Subject: [PATCH] - Added an alert message when uploading still in progress and the user tries to send the message - Added the functionality to abort the upload process - Changed the loading icon background to transparent, so it can be used in other templates easily --- program/js/app.js | 19 ++++++++++++++++-- program/localization/en_US/messages.inc | 1 + program/localization/pt_BR/messages.inc | 2 ++ program/steps/mail/compose.inc | 8 +++++--- skins/default/images/display/loading_blue.gif | Bin 754 -> 847 bytes skins/default/templates/compose.html | 2 +- 6 files changed, 26 insertions(+), 6 deletions(-) diff --git a/program/js/app.js b/program/js/app.js index 016162fdf..879c9aa15 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -1631,7 +1631,7 @@ function rcube_webmail() add_url += '&_search='+this.env.search_request; // set page=1 if changeing to another mailbox - if (!page && this.env.mailbox != mbox) + if (!page && this.env.mailbox != mbox) { page = 1; this.env.current_page = page; @@ -2176,7 +2176,10 @@ function rcube_webmail() var list = this.gui_objects.attachmentlist.getElementsByTagName("li"); for (i=0;i'+content; + if (this.env.cancelicon) + content = ''+content; this.add2attachment_list(ts, content); } @@ -2535,6 +2540,16 @@ function rcube_webmail() return true; }; + this.cancel_attachment_upload = function(name, frame_name) + { + if (!name || !frame_name) + return false; + + this.remove_from_attachment_list(name); + $("iframe[name='"+frame_name+"']").remove(); + return false; + }; + // send remote request to add a new contact this.add_contact = function(value) { diff --git a/program/localization/en_US/messages.inc b/program/localization/en_US/messages.inc index 3bc513213..6fc7be862 100644 --- a/program/localization/en_US/messages.inc +++ b/program/localization/en_US/messages.inc @@ -69,6 +69,7 @@ $messages['notsentwarning'] = 'Message has not been sent. Do you want to discard $messages['noldapserver'] = 'Please select an ldap server to search'; $messages['nocontactsreturned'] = 'No contacts were found'; $messages['nosearchname'] = 'Please enter a contact name or email address'; +$messages['notuploadedwarning'] = 'Not all attachments have been uploaded yet. Please wait or cancel the upload.'; $messages['searchsuccessful'] = '$nr messages found'; $messages['searchnomatch'] = 'Search returned no matches'; $messages['searching'] = 'Searching...'; diff --git a/program/localization/pt_BR/messages.inc b/program/localization/pt_BR/messages.inc index 752a19820..14585a1df 100644 --- a/program/localization/pt_BR/messages.inc +++ b/program/localization/pt_BR/messages.inc @@ -32,6 +32,7 @@ $messages['nomessagesfound'] = 'Nenhuma mensagem foi encontrada'; $messages['loggedout'] = 'Sua sessão foi finalizada com sucesso. Até breve!'; $messages['mailboxempty'] = 'A caixa de mensagens está vazia'; $messages['loading'] = 'Carregando...'; +$messages['uploading'] = 'Enviando anexo...'; $messages['loadingdata'] = 'Carregando informações...'; $messages['checkingmail'] = 'Verificando se há novas mensagens...'; $messages['sendingmessage'] = 'Enviando mensagem...'; @@ -72,6 +73,7 @@ $messages['notsentwarning'] = 'A mensagem não foi enviada, deseja excluí-la?'; $messages['noldapserver'] = 'Por favor, selecione um servidor LDAP para a pesquisa'; $messages['nocontactsreturned'] = 'Nenhum contato foi encontrado'; $messages['nosearchname'] = 'Por favor, informe o nome do contado ou seu endereço de e-mail'; +$messages['notuploadedwarning'] = 'Há anexos ainda não enviados. Aguarde ou cancele o envio.'; $messages['searchsuccessful'] = '$nr mensagens encontradas'; $messages['searchnomatch'] = 'A pesquisa não encontrou resultados'; $messages['searching'] = 'Pesquisando...'; diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index e3c7fda16..c894da776 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -92,9 +92,9 @@ if (!is_array($_SESSION['compose']) || $_SESSION['compose']['id'] != get_input_v // add some labels to client -$OUTPUT->add_label('nosubject', 'nosenderwarning', 'norecipientwarning', 'nosubjectwarning', - 'nobodywarning', 'notsentwarning', 'savingmessage', 'sendingmessage', 'messagesaved', - 'converting', 'editorwarning', 'searching', 'uploading', 'fileuploaderror'); +$OUTPUT->add_label('nosubject', 'nosenderwarning', 'norecipientwarning', 'nosubjectwarning', 'cancel', + 'nobodywarning', 'notsentwarning', 'notuploadedwarning', 'savingmessage', 'sendingmessage', + 'messagesaved', 'converting', 'editorwarning', 'searching', 'uploading', 'fileuploaderror'); // add config parameters to client script if (!empty($CONFIG['drafts_mbox'])) { @@ -809,6 +809,8 @@ function rcmail_compose_attachment_list($attrib) if ($attrib['deleteicon']) $_SESSION['compose']['deleteicon'] = $CONFIG['skin_path'] . $attrib['deleteicon']; + if ($attrib['cancelicon']) + $OUTPUT->set_env('cancelicon', $CONFIG['skin_path'] . $attrib['cancelicon']); if ($attrib['loadingicon']) $OUTPUT->set_env('loadingicon', $CONFIG['skin_path'] . $attrib['loadingicon']); diff --git a/skins/default/images/display/loading_blue.gif b/skins/default/images/display/loading_blue.gif index 52c9ee49fada40283650c868e88064f119be141e..2ea6b19aed14632292e801472ce398460a0f0ca2 100644 GIT binary patch literal 847 zcmZ?wbhEHb6krfw_`<;O|Nno1()~Yv{c)LmrhCtQ(TW4cohNR*__Fr=3zdc=bzAP_ zuetH`{r7pto}9e@A$azMgvD1FNCArfx&2&2f}I@$T#fV$m>Ge375_;&7o{eaq^2m8 zXO?6rBxWU6otbEINafjWLRY2!70|NW6iz~gEtaOk8&Zmh)doe~~B7us%UunTmtm@p|k*U*tz=BAkF!4MHVgQGFmbjeo6 zBo~h@Yz(V*CMM}{^{F-#7>gwzQQn~bgZGURyNQ{3fSOi>euG9&uL@R6z+soy%IayL(jn0+=WV`;*F%T>V5e?LvsP2HtCWbqlEbVA#nav0=JHKcBOC28X^OOB!p8W_OR8B7-$3d4d4|tKba{ literal 754 zcmZ?wbhEHb6krfwXklRZ|NlS3r2jvD|Fc;6ujSM~wkiMA7X7>S=HH5&|HNkhD?9Qp zZSTJ)pZ?9b^zYcSe;ynDg>Cx>)IvN^{Lk&@8WQa67~pE8XTZ$Jz`&sRlZAnc;Xi{8 zkPUQ%00RT7*8+vUl+1b00@k#y5LmIR%QI1C*}<-kyeTZRyOuQfhHxBgXwlGd-y9rb zq8mDKN$Y~2BCPcnTsJ=P=88zTDP*}rt?&5+5fzY+OB5$|JmWIZwm6o`s zxU($nFsN{IZ<9;D#<8ld>8M|3vuqh>zBym8x48x{XRR_;8^eGeQvN(a=0u$^wU`? zDw7<4YQ<#9MVhm!54cT~4%g)8X~b%kHze#p$YVb#}Nx864iU<*8jzX{NJ3ZD9%yZfI1+>XC4$MIItY9TvDKE9hj)s7w;^%oAz5xHv3g zN}WFA;*H4<-L^1xK2=b0Uz52or8LF8nW?E{g{l;f=!Pu{c5e2EE4Fx_acz&!?b%Uu On6*x`xkW{h!5RS5XD*EZ diff --git a/skins/default/templates/compose.html b/skins/default/templates/compose.html index 6441332ae..a5d7dcc71 100644 --- a/skins/default/templates/compose.html +++ b/skins/default/templates/compose.html @@ -93,7 +93,7 @@
- +