]> git.donarmstrong.com Git - roundcube.git/blobdiff - plugins/archive/archive.js
Imported Upstream version 0.7
[roundcube.git] / plugins / archive / archive.js
index d771fb66b226c093b6ad55e188df0de04e36ef67..5c576e1009444c23151fc0a33c971b0c85d460b4 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Archive plugin script
- * @version 1.2
+ * @version @package_version@
  */
 
 function rcmail_archive(prop)
@@ -8,10 +8,8 @@ function rcmail_archive(prop)
   if (!rcmail.env.uid && (!rcmail.message_list || !rcmail.message_list.get_selection().length))
     return;
   
-  var uids = rcmail.env.uid ? rcmail.env.uid : rcmail.message_list.get_selection().join(',');
-    
-  rcmail.set_busy(true, 'loading');
-  rcmail.http_post('plugin.archive', '_uid='+uids+'&_mbox='+urlencode(rcmail.env.mailbox), true);
+  if (rcmail.env.mailbox != rcmail.env.archive_folder)
+    rcmail.command('moveto', rcmail.env.archive_folder);
 }
 
 // callback for app-onload event
@@ -29,8 +27,10 @@ if (window.rcmail) {
     
     // set css style for archive folder
     var li;
-    if (rcmail.env.archive_folder && (li = rcmail.get_folder_li(rcmail.env.archive_folder)))
-      $(li).css('background-image', 'url(plugins/archive/foldericon.png)');
+    if (rcmail.env.archive_folder && rcmail.env.archive_folder_icon
+      && (li = rcmail.get_folder_li(rcmail.env.archive_folder, '', true))
+    )
+      $(li).css('background-image', 'url(' + rcmail.env.archive_folder_icon + ')');
   })
 }