From a894ba5029a09fb9d0453b5cf9c944ce313f8a48 Mon Sep 17 00:00:00 2001 From: svncommit Date: Thu, 29 Jun 2006 23:41:40 +0000 Subject: Removeable attachments, Auto-default folder creation, bug fixes --- program/js/app.js | 60 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 16 deletions(-) (limited to 'program/js') diff --git a/program/js/app.js b/program/js/app.js index c61c20a63..fb103bf43 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -143,7 +143,7 @@ function rcube_webmail() if (this.env.action=='compose') { - this.enable_command('add-attachment', 'send-attachment', 'send', true); + this.enable_command('add-attachment', 'send-attachment', 'remove-attachment', 'send', true); if (this.env.spellcheck) this.enable_command('spellcheck', true); if (this.env.drafts_mailbox) @@ -945,6 +945,10 @@ function rcube_webmail() case 'send-attachment': this.upload_file(props) break; + + case 'remove-attachment': + this.remove_attachment(props); + break; case 'reply-all': case 'reply': @@ -1347,8 +1351,6 @@ function rcube_webmail() { if (this.env.mailbox==this.env.drafts_mailbox) { - //alert(this.env.mailbox); - //this.disable_command('reply', 'reply-all', 'forward', 'print', 'moveto'); this.enable_command('show', selected); this.enable_command('delete', this.selection.length>0 ? true : false); } @@ -1669,7 +1671,6 @@ function rcube_webmail() lock = true; this.set_busy(true, 'movingmessage'); } - // send request to server this.http_request('moveto', '_uid='+a_uids.join(',')+'&_mbox='+escape(this.env.mailbox)+'&_target_mbox='+escape(mbox)+'&_from='+(this.env.action ? this.env.action : ''), lock); }; @@ -2095,17 +2096,36 @@ function rcube_webmail() // add file name to attachment list // called from upload page - this.add2attachment_list = function(name) + this.add2attachment_list = function(name,content) { if (!this.gui_objects.attachmentlist) return false; var li = document.createElement('LI'); - li.innerHTML = name; + li.id = name; + li.innerHTML = content; this.gui_objects.attachmentlist.appendChild(li); return true; }; + this.remove_from_attachment_list = function(name) + { + if (!this.gui_objects.attachmentlist) + return false; + + var list = this.gui_objects.attachmentlist.getElementsByTagName("li"); + for (i=0;i