| | |
| | | // enable general commands |
| | | this.enable_command('logout', 'mail', 'addressbook', 'settings', true); |
| | | |
| | | if (this.env.permaurl) |
| | | this.enable_command('permaurl', true); |
| | | |
| | | switch (this.task) |
| | | { |
| | | case 'mail': |
| | |
| | | this.message_list.addEventListener('select', function(o){ p.msglist_select(o); }); |
| | | this.message_list.addEventListener('dragstart', function(o){ p.drag_start(o); }); |
| | | this.message_list.addEventListener('dragmove', function(o, e){ p.drag_move(e); }); |
| | | this.message_list.addEventListener('dragend', function(o){ p.drag_active = false; }); |
| | | this.message_list.addEventListener('dragend', function(o, e){ p.drag_end(e); }); |
| | | document.onmouseup = function(e){ return p.doc_mouse_up(e); }; |
| | | |
| | | this.message_list.init(); |
| | |
| | | this.contact_list.addEventListener('select', function(o){ p.contactlist_select(o); }); |
| | | this.contact_list.addEventListener('dragstart', function(o){ p.drag_start(o); }); |
| | | this.contact_list.addEventListener('dragmove', function(o, e){ p.drag_move(e); }); |
| | | this.contact_list.addEventListener('dragend', function(o){ p.drag_active = false; }); |
| | | this.contact_list.addEventListener('dragend', function(o, e){ p.drag_end(e); }); |
| | | this.contact_list.init(); |
| | | |
| | | if (this.env.cid) |
| | |
| | | this.switch_task(command); |
| | | break; |
| | | |
| | | case 'permaurl': |
| | | if (obj && obj.href && obj.target) |
| | | return true; |
| | | else if (this.env.permaurl) |
| | | parent.location.href = this.env.permaurl; |
| | | break; |
| | | |
| | | case 'open': |
| | | var uid; |
| | | var uid; |
| | | if (uid = this.get_single_uid()) |
| | | { |
| | | obj.href = '?_task='+this.env.task+'&_action=show&_mbox='+urlencode(this.env.mailbox)+'&_uid='+uid; |
| | | return true; |
| | | } |
| | | break; |
| | | { |
| | | obj.href = '?_task='+this.env.task+'&_action=show&_mbox='+urlencode(this.env.mailbox)+'&_uid='+uid; |
| | | return true; |
| | | } |
| | | break; |
| | | |
| | | // misc list commands |
| | | case 'list': |
| | |
| | | } |
| | | }; |
| | | |
| | | this.drag_end = function(e) |
| | | { |
| | | this.drag_active = false; |
| | | |
| | | // over the folders |
| | | if (this.gui_objects.folderlist && this.env.folder_coords) { |
| | | for (var k in this.env.folder_coords) { |
| | | if (k == this.env.last_folder_target) { |
| | | $(this.get_folder_li(k)).removeClass('droptarget'); |
| | | this.env.last_folder_target = null; |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | |
| | | this.drag_move = function(e) |
| | | { |
| | | if (this.gui_objects.folderlist && this.env.folder_coords) { |