summaryrefslogtreecommitdiff
path: root/program/js/app.js
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2013-06-14 01:13:13 +0200
committerThomas Bruederli <thomas@roundcube.net>2013-06-14 01:13:13 +0200
commit4f53ab347e6ad026f69105b69ce66e21a7654c78 (patch)
treefb4bf5b2d3de9c0799d0b1a5139996a99cf5e5bc /program/js/app.js
parentbf305c181095cc05522b1c0fcee7093dea3043c1 (diff)
Add feature to import messages to the currently selected folder
Diffstat (limited to 'program/js/app.js')
-rw-r--r--program/js/app.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 0dea59216..37aee8d88 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -191,7 +191,7 @@ function rcube_webmail()
case 'mail':
// enable mail commands
- this.enable_command('list', 'checkmail', 'add-contact', 'search', 'reset-search', 'collapse-folder', true);
+ this.enable_command('list', 'checkmail', 'add-contact', 'search', 'reset-search', 'collapse-folder', 'import-messages', true);
if (this.gui_objects.messagelist) {
this.message_list = new rcube_list_widget(this.gui_objects.messagelist, {
@@ -277,11 +277,12 @@ function rcube_webmail()
this.init_messageform();
}
// show printing dialog
- else if (this.env.action == 'print' && this.env.uid)
+ else if (this.env.action == 'print' && this.env.uid) {
if (bw.safari)
setTimeout('window.print()', 10);
else
window.print();
+ }
// get unread count for each mailbox
if (this.gui_objects.mailboxlist) {
@@ -1000,7 +1001,7 @@ function rcube_webmail()
// Reset the auto-save timer
clearTimeout(this.save_timer);
- this.upload_file(props || this.gui_objects.uploadform);
+ this.upload_file(props || this.gui_objects.uploadform, 'upload');
break;
case 'insert-sig':
@@ -1101,6 +1102,12 @@ function rcube_webmail()
this.list_contacts(props.source, props.id);
break;
+ case 'import-messages':
+ var form = props || this.gui_objects.importform;
+ $('input[name="_unlock"]', form).val(this.set_busy(true, 'importwait'));
+ this.upload_file(form, 'import');
+ break;
+
case 'import':
if (this.env.action == 'import' && this.gui_objects.importform) {
var file = document.getElementById('rcmimportfile');
@@ -3492,8 +3499,8 @@ function rcube_webmail()
return true;
};
- // upload attachment file
- this.upload_file = function(form)
+ // upload (attachment) file
+ this.upload_file = function(form, action)
{
if (!form)
return false;
@@ -3520,7 +3527,7 @@ function rcube_webmail()
return;
}
- var frame_name = this.async_upload_form(form, 'upload', function(e) {
+ var frame_name = this.async_upload_form(form, action || 'upload', function(e) {
var d, content = '';
try {
if (this.contentDocument) {