[Svn] r3015 - in trunk/roundcubemail: program/js program/localization/en_US program/localization/pt_BR program/steps/mail skins/default/images/display skins/default/templates

trac at roundcube.net trac at roundcube.net
Sun Oct 4 10:16:20 CEST 2009


Author: netbit
Date: 2009-10-04 03:16:20 -0500 (Sun, 04 Oct 2009)
New Revision: 3015

Modified:
   trunk/roundcubemail/program/js/app.js
   trunk/roundcubemail/program/localization/en_US/messages.inc
   trunk/roundcubemail/program/localization/pt_BR/messages.inc
   trunk/roundcubemail/program/steps/mail/compose.inc
   trunk/roundcubemail/skins/default/images/display/loading_blue.gif
   trunk/roundcubemail/skins/default/templates/compose.html
Log:
- 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

Modified: trunk/roundcubemail/program/js/app.js
===================================================================
--- trunk/roundcubemail/program/js/app.js	2009-10-04 05:04:23 UTC (rev 3014)
+++ trunk/roundcubemail/program/js/app.js	2009-10-04 08:16:20 UTC (rev 3015)
@@ -1631,7 +1631,7 @@
       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 @@
       var list = this.gui_objects.attachmentlist.getElementsByTagName("li");
       for (i=0;i<list.length;i++)
         if (!String(list[i].id).match(/^rcmfile/))
+          {
+          alert(this.get_label('notuploadedwarning'));
           return false;
+          }
     }
     
     // display localized warning for missing subject
@@ -2484,10 +2487,12 @@
       
       // hide upload form
       this.show_attachment_form(false);
-      // display upload indicator
+      // display upload indicator and cancel button
       var content = this.get_label('uploading');
       if (this.env.loadingicon)
         content = '<img src="'+this.env.loadingicon+'" alt="" />'+content;
+      if (this.env.cancelicon)
+        content = '<a title="'+this.get_label('cancel')+'" onclick="return rcmail.cancel_attachment_upload(\''+ts+'\', \''+frame_name+'\');" href="#cancelupload"><img src="'+this.env.cancelicon+'" alt="" /></a>'+content;
       this.add2attachment_list(ts, content);
       }
     
@@ -2535,6 +2540,16 @@
     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)
     {

Modified: trunk/roundcubemail/program/localization/en_US/messages.inc
===================================================================
--- trunk/roundcubemail/program/localization/en_US/messages.inc	2009-10-04 05:04:23 UTC (rev 3014)
+++ trunk/roundcubemail/program/localization/en_US/messages.inc	2009-10-04 08:16:20 UTC (rev 3015)
@@ -69,6 +69,7 @@
 $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...';

Modified: trunk/roundcubemail/program/localization/pt_BR/messages.inc
===================================================================
--- trunk/roundcubemail/program/localization/pt_BR/messages.inc	2009-10-04 05:04:23 UTC (rev 3014)
+++ trunk/roundcubemail/program/localization/pt_BR/messages.inc	2009-10-04 08:16:20 UTC (rev 3015)
@@ -32,6 +32,7 @@
 $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['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...';

Modified: trunk/roundcubemail/program/steps/mail/compose.inc
===================================================================
--- trunk/roundcubemail/program/steps/mail/compose.inc	2009-10-04 05:04:23 UTC (rev 3014)
+++ trunk/roundcubemail/program/steps/mail/compose.inc	2009-10-04 08:16:20 UTC (rev 3015)
@@ -92,9 +92,9 @@
 
 
 // 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 @@
 
   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']);
 

Modified: trunk/roundcubemail/skins/default/images/display/loading_blue.gif
===================================================================
(Binary files differ)

Modified: trunk/roundcubemail/skins/default/templates/compose.html
===================================================================
--- trunk/roundcubemail/skins/default/templates/compose.html	2009-10-04 05:04:23 UTC (rev 3014)
+++ trunk/roundcubemail/skins/default/templates/compose.html	2009-10-04 08:16:20 UTC (rev 3015)
@@ -93,7 +93,7 @@
 
 <div id="compose-attachments">
 <div id="attachment-title"><roundcube:label name="attachments" /></div>
-<roundcube:object name="composeAttachmentList" deleteIcon="/images/icons/delete.png" loadingIcon="/images/display/loading_blue.gif" />
+<roundcube:object name="composeAttachmentList" deleteIcon="/images/icons/delete.png" cancelIcon="/images/icons/delete.png" loadingIcon="/images/display/loading_blue.gif" />
 <p><roundcube:button command="add-attachment" imagePas="/images/buttons/add_pas.png" imageSel="/images/buttons/add_sel.png" imageAct="/images/buttons/add_act.png" width="23" height="18" title="addattachment" /></p>
 </div>
 

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn


More information about the Svn mailing list