| | |
| | | if (this.env.uid && props.mimetype && find_in_array(props.mimetype, this.mimetypes)>=0) |
| | | { |
| | | if (props.mimetype == 'text/html') |
| | | qstring += '&safe=1'; |
| | | qstring += '&_safe=1'; |
| | | this.attachment_win = window.open(this.env.comm_path+'&_action=get&'+qstring+'&_frame=1', 'rcubemailattachment'); |
| | | if (this.attachment_win) |
| | | { |
| | |
| | | { |
| | | this.enable_command('show', 'reply', 'reply-all', 'forward', 'print', selected); |
| | | this.enable_command('delete', 'moveto', list.selection.length>0 ? true : false); |
| | | |
| | | // start timer for message preview (wait for double click) |
| | | if (selected && this.env.contentframe) |
| | | this.preview_timer = setTimeout(function(){ ref.msglist_get_preview(); }, this.dblclick_time + 10); |
| | | else if (this.env.contentframe) |
| | | this.show_messageframe(false); |
| | | } |
| | | |
| | | // start timer for message preview (wait for double click) |
| | | if (selected && this.env.contentframe) |
| | | this.preview_timer = setTimeout(function(){ ref.msglist_get_preview(); }, this.dblclick_time + 10); |
| | | else if (this.env.contentframe) |
| | | this.show_messageframe(false); |
| | | }; |
| | | |
| | | |
| | |
| | | page = 1; |
| | | add_url += '&_refresh=1'; |
| | | this.env.current_page = page; |
| | | this.message_list.clear_selection(); |
| | | if (this.message_list) |
| | | this.message_list.clear_selection(); |
| | | this.show_messageframe(false); |
| | | } |
| | | |
| | |
| | | // delete selected messages from the current mailbox |
| | | this.delete_messages = function() |
| | | { |
| | | var selection = this.message_list ? this.message_list.get_selection() : new Array(); |
| | | |
| | | // exit if no mailbox specified or if selection is empty |
| | | if (!this.env.uid) |
| | | { |
| | | if (!this.message_list || !this.message_list.get_selection().length) |
| | | if (!this.env.uid && !selection.length) |
| | | return; |
| | | } |
| | | |
| | | // if there is a trash mailbox defined and we're not currently in it: |
| | | if (this.env.trash_mailbox && String(this.env.mailbox).toLowerCase()!=String(this.env.trash_mailbox).toLowerCase()) |
| | | if (this.env.trash_mailbox && String(this.env.mailbox).toLowerCase() != String(this.env.trash_mailbox).toLowerCase()) |
| | | { |
| | | // if shift was pressed delete it immediately |
| | | if (this.message_list && this.message_list.shiftkey) |
| | |
| | | // if there isn't a defined trash mailbox and the config is set to flag for deletion |
| | | else if (!this.env.trash_mailbox && this.env.flag_for_deletion) |
| | | { |
| | | flag = 'delete'; |
| | | this.mark_message(flag); |
| | | this.mark_message('delete'); |
| | | if(this.env.action=="show") |
| | | this.command('nextmessage','',this); |
| | | else if (selection.length == 1) |
| | |
| | | // exit if no mailbox specified or if selection is empty |
| | | if (!this.env.uid && (!this.message_list || !this.message_list.get_selection().length)) |
| | | return; |
| | | |
| | | |
| | | this.show_messageframe(false); |
| | | this._with_selected_messages('delete', false, '&_from='+(this.env.action ? this.env.action : '')); |
| | | }; |
| | |
| | | a_uids[0] = uid; |
| | | else if (this.env.uid) |
| | | a_uids[0] = this.env.uid; |
| | | else |
| | | else if (this.message_list) |
| | | { |
| | | var id; |
| | | for (var n=0; n<selection.length; n++) |
| | | for (var id, n=0; n<selection.length; n++) |
| | | { |
| | | id = selection[n]; |
| | | if ((flag=='read' && this.message_list.rows[id].unread) || (flag=='unread' && !this.message_list.rows[id].unread)) |
| | | if ((flag=='read' && this.message_list.rows[id].unread) || (flag=='unread' && !this.message_list.rows[id].unread) |
| | | || (flag=='delete' && !this.message_list.rows[id].deleted) || (flag=='undelete' && this.message_list.rows[id].deleted)) |
| | | a_uids[a_uids.length] = id; |
| | | } |
| | | } |
| | |
| | | return false; |
| | | |
| | | var rows = this.message_list.rows; |
| | | if (a_uids.length==1) { |
| | | if (a_uids.length==1) |
| | | { |
| | | if (rows[a_uids[0]] && rows[a_uids[0]].classname.indexOf('deleted') < 0) |
| | | this.flag_as_deleted(a_uids); |
| | | else |
| | |
| | | } |
| | | |
| | | var all_deleted = true; |
| | | for (var i=0; i<a_uids.length; i++) { |
| | | for (var i=0; i<a_uids.length; i++) |
| | | { |
| | | uid = a_uids[i]; |
| | | if (rows[uid]) { |
| | | if (rows[uid].classname.indexOf('deleted')<0) { |
| | | if (rows[uid].classname.indexOf('deleted')<0) |
| | | { |
| | | all_deleted = false; |
| | | break; |
| | | } |
| | |
| | | var icn_src; |
| | | var rows = this.message_list.rows; |
| | | |
| | | for (var i=0; i<a_uids.length; i++) { |
| | | for (var i=0; i<a_uids.length; i++) |
| | | { |
| | | uid = a_uids[i]; |
| | | if (rows[uid]) { |
| | | rows[uid].deleted = false; |
| | | |
| | | if (rows[uid].classname.indexOf('deleted') > 0) { |
| | | if (rows[uid].classname.indexOf('deleted') > 0) |
| | | { |
| | | rows[uid].classname = rows[uid].classname.replace(/\s*deleted/, ''); |
| | | this.set_classname(rows[uid].obj, 'deleted', false); |
| | | } |
| | |
| | | return false; |
| | | |
| | | var rows = this.message_list.rows; |
| | | for (var i=0; i<a_uids.length; i++) { |
| | | for (var i=0; i<a_uids.length; i++) |
| | | { |
| | | uid = a_uids[i]; |
| | | if (rows[uid]) { |
| | | rows[uid].deleted = true; |
| | |
| | | form.elements['_folder_name'].value = ''; |
| | | } |
| | | |
| | | this.sort_subscription_list(); |
| | | }; |
| | | |
| | | |
| | |
| | | return new_row; |
| | | }; |
| | | |
| | | // sort subscription folder list |
| | | this.sort_subscription_list = function() |
| | | { |
| | | var index = new Array(); |
| | | var tbody = this.gui_objects.subscriptionlist.tBodies[0]; |
| | | var swapped = false; |
| | | for (var i = 0; i<(tbody.childNodes.length-1); i++) |
| | | if (this.env.subscriptionrows[tbody.childNodes[i].id]!=null) |
| | | index.push(i); |
| | | for (i = 0; i<(index.length-1); i++) |
| | | { |
| | | if (this.env.subscriptionrows[tbody.childNodes[index[i]].id][0]> |
| | | this.env.subscriptionrows[tbody.childNodes[index[i+1]].id][0]) |
| | | { |
| | | var swap = tbody.replaceChild(tbody.childNodes[index[i]], tbody.childNodes[index[i+1]]); |
| | | if (typeof(tbody.childNodes[index[i]]) != 'undefined') |
| | | tbody.insertBefore(swap, tbody.childNodes[index[i]]) |
| | | else |
| | | tbody.appendChild(swap); |
| | | swapped = true; |
| | | } |
| | | } |
| | | if (swapped) |
| | | this.sort_subscription_list(); |
| | | }; |
| | | |
| | | |
| | | /*********************************************************/ |
| | | /********* GUI functionality *********/ |