| | |
| | | |
| | | // select the folder if one of its childs is currently selected |
| | | // don't select if it's virtual (#1488346) |
| | | if (this.env.mailbox && this.env.mailbox.indexOf(name + this.env.delimiter) == 0 && !node.virtual) |
| | | if (this.env.mailbox && this.env.mailbox.startsWith(name + this.env.delimiter) && !node.virtual) |
| | | this.command('list', name); |
| | | } |
| | | else { |
| | |
| | | this.env.coltypes = []; |
| | | |
| | | for (i=0; i<cols.length; i++) |
| | | if (cols[i].id && cols[i].id.match(/^rcm/)) { |
| | | name = cols[i].id.replace(/^rcm/, ''); |
| | | if (cols[i].id && cols[i].id.startsWith('rcm')) { |
| | | name = cols[i].id.slice(3); |
| | | this.env.coltypes.push(name); |
| | | } |
| | | |
| | |
| | | return (this.env.exists && ( |
| | | this.env.mailbox == this.env.trash_mailbox |
| | | || this.env.mailbox == this.env.junk_mailbox |
| | | || this.env.mailbox.indexOf(this.env.trash_mailbox + this.env.delimiter) == 0 |
| | | || this.env.mailbox.indexOf(this.env.junk_mailbox + this.env.delimiter) == 0 |
| | | || this.env.mailbox.startsWith(this.env.trash_mailbox + this.env.delimiter) |
| | | || this.env.mailbox.startsWith(this.env.junk_mailbox + this.env.delimiter) |
| | | )); |
| | | }; |
| | | |
| | |
| | | return; |
| | | |
| | | // ...new search value contains old one and previous search was not finished or its result was empty |
| | | if (old_value && old_value.length && q.indexOf(old_value) == 0 && (!ac || ac.num <= 0) && this.env.contacts && !this.env.contacts.length) |
| | | if (old_value && old_value.length && q.startsWith(old_value) && (!ac || ac.num <= 0) && this.env.contacts && !this.env.contacts.length) |
| | | return; |
| | | |
| | | var i, lock, source, xhr, reqid = new Date().getTime(), |
| | |
| | | if (this.check_droptarget(folder) && |
| | | !this.env.subscriptionrows[this.get_folder_row_id(this.env.mailbox)][2] && |
| | | (folder != this.env.mailbox.replace(reg, '')) && |
| | | (!folder.match(new RegExp('^'+RegExp.escape(this.env.mailbox+this.env.delimiter)))) |
| | | (!folder.startsWith(this.env.mailbox + this.env.delimiter)) |
| | | ) { |
| | | this.env.dstfolder = folder; |
| | | $(row).addClass('droptarget'); |
| | |
| | | tmp = tmp_name; |
| | | } |
| | | // protected folder's child |
| | | else if (tmp && folders[n][0].indexOf(tmp) == 0) |
| | | else if (tmp && folders[n][0].startsWith(tmp)) |
| | | slist.push(folders[n][0]); |
| | | // other |
| | | else { |
| | |
| | | |
| | | // check if subfolder of a protected folder |
| | | for (n=0; n<slist.length; n++) { |
| | | if (name.indexOf(slist[n]+this.env.delimiter) == 0) |
| | | if (name.startsWith(slist[n] + this.env.delimiter)) |
| | | rowid = this.get_folder_row_id(slist[n]); |
| | | } |
| | | |
| | |
| | | this.get_subfolders = function(folder) |
| | | { |
| | | var name, list = [], |
| | | regex = new RegExp('^'+RegExp.escape(folder)+RegExp.escape(this.env.delimiter)), |
| | | prefix = folder + this.env.delimiter, |
| | | row = $('#'+this.get_folder_row_id(folder)).get(0); |
| | | |
| | | while (row = row.nextSibling) { |
| | | if (row.id) { |
| | | name = this.env.subscriptionrows[row.id][0]; |
| | | if (regex.test(name)) { |
| | | if (name && name.startsWith(prefix)) { |
| | | list.push(row.id); |
| | | } |
| | | else |
| | |
| | | div.className.match(/collapsed/)) { |
| | | // add children's counters |
| | | for (var k in this.env.unread_counts) |
| | | if (k.indexOf(mbox + this.env.delimiter) == 0) |
| | | if (k.startsWith(mbox + this.env.delimiter)) |
| | | childcount += this.env.unread_counts[k]; |
| | | } |
| | | |