| | |
| | | this.gui_objects.messagelist.parentNode.onmousedown = function(e){ return p.click_on_list(e); }; |
| | | |
| | | this.enable_command('toggle_status', 'toggle_flag', 'sort', true); |
| | | this.enable_command('set-listmode', this.env.threads && !this.env.search_request); |
| | | |
| | | // load messages |
| | | this.command('list'); |
| | |
| | | } |
| | | else if (this.task == 'addressbook') |
| | | this.list_contacts(props); |
| | | break; |
| | | |
| | | case 'set-listmode': |
| | | this.set_list_options(null, undefined, undefined, props == 'threads' ? 1 : 0); |
| | | break; |
| | | |
| | | case 'sort': |
| | |
| | | this.init_message_row = function(row) |
| | | { |
| | | var i, fn = {}, self = this, uid = row.uid, |
| | | status_icon = (this.env.status_col != null ? 'status' : 'msg') + 'icn' + row.uid; |
| | | status_icon = (this.env.status_col != null ? 'status' : 'msg') + 'icn' + row.id; |
| | | |
| | | if (uid && this.env.messages[uid]) |
| | | $.extend(row, this.env.messages[uid]); |
| | |
| | | |
| | | // save message icon position too |
| | | if (this.env.status_col != null) |
| | | row.msgicon = document.getElementById('msgicn'+row.uid); |
| | | row.msgicon = document.getElementById('msgicn'+row.id); |
| | | else |
| | | row.msgicon = row.icon; |
| | | |
| | | // set eventhandler to flag icon |
| | | if (this.env.flagged_col != null && (row.flagicon = document.getElementById('flagicn'+row.uid))) { |
| | | if (this.env.flagged_col != null && (row.flagicon = document.getElementById('flagicn'+row.id))) { |
| | | fn.flagicon = function(e) { self.command('toggle_flag', uid); }; |
| | | } |
| | | |
| | | // set event handler to thread expand/collapse icon |
| | | if (!row.depth && row.has_children && (row.expando = document.getElementById('rcmexpando'+row.uid))) { |
| | | if (!row.depth && row.has_children && (row.expando = document.getElementById('rcmexpando'+row.id))) { |
| | | fn.expando = function(e) { self.expand_message_row(e, uid); }; |
| | | } |
| | | |
| | |
| | | + (flags.deleted ? ' deleted' : '') |
| | | + (flags.flagged ? ' flagged' : '') |
| | | + (message.selected ? ' selected' : ''), |
| | | row = { cols:[], style:{}, id:'rcmrow'+uid }; |
| | | row = { cols:[], style:{}, id:'rcmrow'+this.html_identifier(uid,true), uid:uid }; |
| | | |
| | | // message status icons |
| | | css_class = 'msgicon'; |
| | |
| | | if (this.env.threading) { |
| | | if (message.depth) { |
| | | // This assumes that div width is hardcoded to 15px, |
| | | tree += '<span id="rcmtab' + uid + '" class="branch" style="width:' + (message.depth * 15) + 'px;"> </span>'; |
| | | tree += '<span id="rcmtab' + row.id + '" class="branch" style="width:' + (message.depth * 15) + 'px;"> </span>'; |
| | | |
| | | if ((rows[message.parent_uid] && rows[message.parent_uid].expanded === false) |
| | | || ((this.env.autoexpand_threads == 0 || this.env.autoexpand_threads == 2) && |
| | |
| | | message.expanded = true; |
| | | } |
| | | |
| | | expando = '<div id="rcmexpando' + uid + '" class="' + (message.expanded ? 'expanded' : 'collapsed') + '"> </div>'; |
| | | expando = '<div id="rcmexpando' + row.id + '" class="' + (message.expanded ? 'expanded' : 'collapsed') + '"> </div>'; |
| | | row_class += ' thread' + (message.expanded? ' expanded' : ''); |
| | | } |
| | | |
| | |
| | | row_class += ' unroot'; |
| | | } |
| | | |
| | | tree += '<span id="msgicn'+uid+'" class="'+css_class+'"> </span>'; |
| | | tree += '<span id="msgicn'+row.id+'" class="'+css_class+'"> </span>'; |
| | | row.className = row_class; |
| | | |
| | | // build subject link |
| | | if (!bw.ie && cols.subject) { |
| | | var action = flags.mbox == this.env.drafts_mailbox ? 'compose' : 'show'; |
| | | var uid_param = flags.mbox == this.env.drafts_mailbox ? '_draft_uid' : '_uid'; |
| | | cols.subject = '<a href="./?_task=mail&_action='+action+'&_mbox='+urlencode(flags.mbox)+'&'+uid_param+'='+uid+'"'+ |
| | | cols.subject = '<a href="./?_task=mail&_action='+action+'&_mbox='+urlencode(flags.mbox)+'&'+uid_param+'='+urlencode(uid)+'"'+ |
| | | ' onclick="return rcube_event.cancel(event)" onmouseover="rcube_webmail.long_subject_title(this,'+(message.depth+1)+')">'+cols.subject+'</a>'; |
| | | } |
| | | |
| | |
| | | |
| | | if (c == 'flag') { |
| | | css_class = (flags.flagged ? 'flagged' : 'unflagged'); |
| | | html = '<span id="flagicn'+uid+'" class="'+css_class+'"> </span>'; |
| | | html = '<span id="flagicn'+row.id+'" class="'+css_class+'"> </span>'; |
| | | } |
| | | else if (c == 'attachment') { |
| | | if (/application\/|multipart\/(m|signed)/.test(flags.ctype)) |
| | |
| | | css_class = 'unreadchildren'; |
| | | else |
| | | css_class = 'msgicon'; |
| | | html = '<span id="statusicn'+uid+'" class="'+css_class+'"> </span>'; |
| | | html = '<span id="statusicn'+row.id+'" class="'+css_class+'"> </span>'; |
| | | } |
| | | else if (c == 'threads') |
| | | html = expando; |
| | |
| | | } |
| | | |
| | | if (html) |
| | | $('#rcmtab'+uid).html(html); |
| | | $('#rcmtab'+this.html_identifier(uid, true)).html(html); |
| | | }; |
| | | |
| | | // update parent in a thread |
| | |
| | | |
| | | r.depth--; // move left |
| | | // reset width and clear the content of a tab, icons will be added later |
| | | $('#rcmtab'+r.uid).width(r.depth * 15).html(''); |
| | | $('#rcmtab'+r.id).width(r.depth * 15).html(''); |
| | | if (!r.depth) { // a new root |
| | | count++; // increase roots count |
| | | r.parent_uid = 0; |
| | | if (r.has_children) { |
| | | // replace 'leaf' with 'collapsed' |
| | | $('#rcmrow'+r.uid+' '+'.leaf:first') |
| | | .attr('id', 'rcmexpando' + r.uid) |
| | | $('#'+r.id+' .leaf:first') |
| | | .attr('id', 'rcmexpando' + r.id) |
| | | .attr('class', (r.obj.style.display != 'none' ? 'expanded' : 'collapsed')) |
| | | .bind('mousedown', {uid:r.uid, p:this}, |
| | | function(e) { return e.data.p.expand_message_row(e, e.data.uid); }); |
| | |
| | | r = this.http_request(action, url, lock); |
| | | |
| | | this.env.qsearch = {lock: lock, request: r}; |
| | | this.enable_command('set-listmode', this.env.threads && (this.env.search_scope || 'base') == 'base'); |
| | | } |
| | | }; |
| | | |
| | |
| | | { |
| | | var n, url = {}, mods_arr = [], |
| | | mods = this.env.search_mods, |
| | | mbox = this.env.mailbox; |
| | | mbox = this.env.mailbox, |
| | | scope = this.env.search_scope || 'base'; |
| | | |
| | | if (!filter && this.gui_objects.search_filter) |
| | | filter = this.gui_objects.search_filter.value; |
| | |
| | | } |
| | | } |
| | | |
| | | if (mbox) |
| | | if (scope) |
| | | url._scope = scope; |
| | | if (mbox && scope != 'all') |
| | | url._mbox = mbox; |
| | | |
| | | return url; |
| | |
| | | this.env.qsearch = null; |
| | | this.env.search_request = null; |
| | | this.env.search_id = null; |
| | | |
| | | this.enable_command('set-listmode', this.env.threads); |
| | | }; |
| | | |
| | | this.sent_successfully = function(type, msg, folders) |