From fdccdb4afee82fe8ac4d2853ab806f4a7f90d13d Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 02 Apr 2008 15:48:27 -0400
Subject: [PATCH] fixed r1237 commit

---
 program/js/app.js |   61 ++++++------------------------
 1 files changed, 12 insertions(+), 49 deletions(-)

diff --git a/program/js/app.js b/program/js/app.js
index 2d30f30..94b329d 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -202,7 +202,7 @@
           }
 
         if (this.env.messagecount)
-          this.enable_command('select-all', 'select-none', 'sort', 'expunge', true);
+          this.enable_command('select-all', 'select-none', 'expunge', true);
 
         if (this.env.messagecount && (this.env.mailbox==this.env.trash_mailbox || this.env.mailbox==this.env.junk_mailbox))
           this.enable_command('purge', true);
@@ -2825,59 +2825,17 @@
 
   this.subscribe_folder = function(folder)
     {
-    var form;
-    if ((form = this.gui_objects.editform) && form.elements['_unsubscribed'])
-      this.change_subscription('_unsubscribed', '_subscribed', 'subscribe');
-    else if (folder)
-      this.http_post('subscribe', '_mboxes='+urlencode(folder));
+    if (folder)
+      this.http_post('subscribe', '_mbox='+urlencode(folder));
     };
 
 
   this.unsubscribe_folder = function(folder)
     {
-    var form;
-    if ((form = this.gui_objects.editform) && form.elements['_subscribed'])
-      this.change_subscription('_subscribed', '_unsubscribed', 'unsubscribe');
-    else if (folder)
-      this.http_post('unsubscribe', '_mboxes='+urlencode(folder));
+    if (folder)
+      this.http_post('unsubscribe', '_mbox='+urlencode(folder));
     };
     
-
-  this.change_subscription = function(from, to, action)
-    {
-    var form;
-    if (form = this.gui_objects.editform)
-      {
-      var a_folders = new Array();
-      var list_from = form.elements[from];
-
-      for (var i=0; list_from && i<list_from.options.length; i++)
-        {
-        if (list_from.options[i] && list_from.options[i].selected)
-          {
-          a_folders[a_folders.length] = list_from.options[i].value;
-          list_from[i] = null;
-          i--;
-          }
-        }
-
-      // yes, we have some folders selected
-      if (a_folders.length)
-        {
-        var list_to = form.elements[to];
-        var index;
-        
-        for (var n=0; n<a_folders.length; n++)
-          {
-          index = list_to.options.length;
-          list_to[index] = new Option(a_folders[n]);
-          }
-          
-        this.http_post(action, '_mboxes='+urlencode(a_folders.join(',')));
-        }
-      }
-      
-    };
 
   // helper method to find a specific mailbox row ID
   this.get_folder_row_id = function(folder)
@@ -3500,12 +3458,17 @@
 
       case 'list':
         if (this.env.messagecount)
-          this.enable_command('purge', (this.env.mailbox==this.env.trash_mailbox || this.env.mailbox==this.env.junk_mailbox));
-        this.msglist_select(this.message_list);
+	  this.enable_command('purge', (this.env.mailbox==this.env.trash_mailbox || this.env.mailbox==this.env.junk_mailbox));
+
+	this.msglist_select(this.message_list);
+
+      case 'getunread':
+	this.enable_command('sort', (this.env.messagecount > 0));
 
       case 'expunge':
         this.enable_command('select-all', 'select-none', 'expunge', this.env.messagecount ? true : false);
         break;
+
       }
 
     request_obj.reset();

--
Gitblit v1.9.1