- more code formatting

- allow re-selecting highlighted row (#1486442)
release-0.6
alecpl 14 years ago
parent 5ba5fd5e3d
commit 186537b2c6

@ -170,6 +170,7 @@ function rcube_webmail()
{multiselect:true, multiexpand:true, draggable:true, keyboard:true, dblclick_time:this.dblclick_time});
this.message_list.row_init = function(o){ p.init_message_row(o); };
this.message_list.addEventListener('dblclick', function(o){ p.msglist_dbl_click(o); });
this.message_list.addEventListener('click', function(o){ p.msglist_click(o); });
this.message_list.addEventListener('keypress', function(o){ p.msglist_keypress(o); });
this.message_list.addEventListener('select', function(o){ p.msglist_select(o); });
this.message_list.addEventListener('dragstart', function(o){ p.drag_start(o); });
@ -1419,14 +1420,12 @@ function rcube_webmail()
var selected = list.get_single_selection() != null;
// Hide certain command buttons when Drafts folder is selected
if (this.env.mailbox == this.env.drafts_mailbox)
{
if (this.env.mailbox == this.env.drafts_mailbox) {
this.enable_command('reply', 'reply-all', 'forward', false);
this.enable_command('show', 'print', 'open', 'edit', 'download', 'viewsource', selected);
this.enable_command('delete', 'moveto', 'copy', 'mark', (list.selection.length > 0 ? true : false));
}
else
{
else {
this.enable_command('show', 'reply', 'reply-all', 'forward', 'print', 'edit', 'open', 'download', 'viewsource', selected);
this.enable_command('delete', 'moveto', 'copy', 'mark', (list.selection.length > 0 ? true : false));
}
@ -1438,6 +1437,19 @@ function rcube_webmail()
this.show_contentframe(false);
};
// This allow as to re-select selected message and display it in preview frame
this.msglist_click = function(list)
{
if (list.multi_selecting || !this.env.contentframe)
return;
if (list.get_single_selection() && window.frames && window.frames[this.env.contentframe]) {
if (window.frames[this.env.contentframe].location.href.indexOf(this.env.blankpage)>=0) {
this.preview_timer = window.setTimeout(function(){ ref.msglist_get_preview(); }, 200);
}
}
};
this.msglist_dbl_click = function(list)
{
if (this.preview_timer)
@ -1685,7 +1697,7 @@ function rcube_webmail()
this.env.sort_col = sort_col;
this.env.sort_order = sort_order;
}
};
this.set_list_options = function(cols, sort_col, sort_order, threads)
{
@ -1708,7 +1720,7 @@ function rcube_webmail()
if (update)
this.list_mailbox('', '', sort_col+'_'+sort_order, add_url);
}
};
// when user doble-clicks on a row
this.show_message = function(id, safe, preview)
@ -1719,8 +1731,7 @@ function rcube_webmail()
var action = preview ? 'preview': 'show';
var target = window;
if (preview && this.env.contentframe && window.frames && window.frames[this.env.contentframe])
{
if (preview && this.env.contentframe && window.frames && window.frames[this.env.contentframe]) {
target = window.frames[this.env.contentframe];
add_url = '&_framed=1';
}
@ -1758,10 +1769,8 @@ function rcube_webmail()
this.show_contentframe = function(show)
{
var frm;
if (this.env.contentframe && (frm = $('#'+this.env.contentframe)) && frm.length)
{
if (!show && window.frames[this.env.contentframe])
{
if (this.env.contentframe && (frm = $('#'+this.env.contentframe)) && frm.length) {
if (!show && window.frames[this.env.contentframe]) {
if (window.frames[this.env.contentframe].location.href.indexOf(this.env.blankpage)<0)
window.frames[this.env.contentframe].location.href = this.env.blankpage;
}
@ -1785,8 +1794,7 @@ function rcube_webmail()
if (page=='first' && this.env.current_page>1)
page = 1;
if (page > 0 && page <= this.env.pagecount)
{
if (page > 0 && page <= this.env.pagecount) {
this.env.current_page = page;
if (this.task=='mail')
@ -1811,7 +1819,7 @@ function rcube_webmail()
this.http_request('search', '_filter='+filter
+ (search ? '&_q='+urlencode(search) : '')
+ (this.env.mailbox ? '&_mbox='+urlencode(this.env.mailbox) : ''), true);
}
};
// list messages of a specific mailbox
this.list_mailbox = function(mbox, page, sort, add_url)
@ -1834,8 +1842,7 @@ function rcube_webmail()
url += '&_search='+this.env.search_request;
// set page=1 if changeing to another mailbox
if (!page && this.env.mailbox != mbox)
{
if (!page && this.env.mailbox != mbox) {
page = 1;
this.env.current_page = page;
this.show_contentframe(false);
@ -1854,21 +1861,18 @@ function rcube_webmail()
this.env.mailbox = mbox;
// load message list remotely
if (this.gui_objects.messagelist)
{
if (this.gui_objects.messagelist) {
this.list_mailbox_remote(mbox, page, url);
return;
}
if (this.env.contentframe && window.frames && window.frames[this.env.contentframe])
{
if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) {
target = window.frames[this.env.contentframe];
url += '&_framed=1';
}
// load message list to target frame/window
if (mbox)
{
if (mbox) {
this.set_busy(true, 'loading');
target.location.href = this.env.comm_path+'&_mbox='+urlencode(mbox)+(page ? '&_page='+page : '')+url;
}
@ -2013,11 +2017,10 @@ function rcube_webmail()
else {
if (r.depth == depth)
r.parent_uid = parent;
if (r.unread && roots.length) {
if (r.unread && roots.length)
roots[roots.length-1].unread_children++;
}
}
}
row = row.nextSibling;
}
@ -2045,7 +2048,7 @@ function rcube_webmail()
}
row = row.nextSibling;
}
}
};
// set message icon
this.set_message_icon = function(uid)
@ -2060,8 +2063,7 @@ function rcube_webmail()
}
else if (rows[uid].deleted && this.env.deletedicon)
icn_src = this.env.deletedicon;
else if (rows[uid].replied && this.env.repliedicon)
{
else if (rows[uid].replied && this.env.repliedicon) {
if (rows[uid].forwarded && this.env.forwardedrepliedicon)
icn_src = this.env.forwardedrepliedicon;
else
@ -2085,7 +2087,7 @@ function rcube_webmail()
icn_src = this.env.unflaggedicon;
if (rows[uid].flagged_icon && icn_src)
rows[uid].flagged_icon.src = icn_src;
}
};
// set message status
this.set_message_status = function(uid, flag, status)
@ -2106,7 +2108,7 @@ function rcube_webmail()
rows[uid].flagged = status;
// this.env.messages[uid] = rows[uid];
}
};
// set message row status, class and icon
this.set_message = function(uid, flag, status)
@ -2165,8 +2167,7 @@ function rcube_webmail()
if (this.env.uid)
a_uids[0] = this.env.uid;
else
{
else {
var selection = this.message_list.get_selection();
var id;
for (var n=0; n<selection.length; n++) {
@ -2193,8 +2194,7 @@ function rcube_webmail()
var add_url = '&_target_mbox='+urlencode(mbox)+'&_from='+(this.env.action ? this.env.action : '');
// show wait message
if (this.env.action=='show')
{
if (this.env.action=='show') {
lock = true;
this.set_busy(true, 'movingmessage');
}
@ -2265,8 +2265,7 @@ function rcube_webmail()
if (this.env.uid)
a_uids[0] = this.env.uid;
else
{
else {
var selection = this.message_list.get_selection();
var id;
for (var n=0; n<selection.length; n++) {
@ -2310,10 +2309,8 @@ function rcube_webmail()
a_uids[0] = uid;
else if (this.env.uid)
a_uids[0] = this.env.uid;
else if (this.message_list)
{
for (var n=0; n<selection.length; n++)
{
else if (this.message_list) {
for (var n=0; n<selection.length; n++) {
a_uids[a_uids.length] = selection[n];
}
}
@ -2321,8 +2318,7 @@ function rcube_webmail()
if (!this.message_list)
r_uids = a_uids;
else
for (var id, n=0; n<a_uids.length; n++)
{
for (var id, n=0; n<a_uids.length; n++) {
id = a_uids[n];
if ((flag=='read' && this.message_list.rows[id].unread)
|| (flag=='unread' && !this.message_list.rows[id].unread)
@ -2339,8 +2335,7 @@ function rcube_webmail()
if (!r_uids.length && !this.select_all_mode)
return;
switch (flag)
{
switch (flag) {
case 'read':
case 'unread':
this.toggle_read_status(flag, r_uids);
@ -2837,7 +2832,7 @@ function rcube_webmail()
// move cursor before the signature
this.set_caret_pos(input_message.get(0), cursor_pos);
}
else if (is_html && show_sig && this.env.signatures) { // html
else if (show_sig && this.env.signatures) { // html
var editor = tinyMCE.get(this.env.composebody);
var sigElem = editor.dom.get('_rc_sig');

@ -21,7 +21,7 @@ var CONTROL_SHIFT_KEY = 3;
/**
* Default browser check class
* @construcotr
* @constructor
*/
function roundcube_browser()
{

Loading…
Cancel
Save