summaryrefslogtreecommitdiff
path: root/roundcubemail/program/js/app.js
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2006-12-17 21:28:37 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2006-12-17 21:28:37 +0000
commit69bb5dd8808a57cadde7a419a1abd9edde4e3994 (patch)
tree86e0cec0209ff6a8f326621904532bf668edc0d0 /roundcubemail/program/js/app.js
parent6169d2cf1325be45a3054f7ab525aeb6f54e6a5d (diff)
Added patch for resizeable preview pane
git-svn-id: https://svn.roundcube.net/trunk@412 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js/app.js')
-rw-r--r--roundcubemail/program/js/app.js31
1 files changed, 23 insertions, 8 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js
index d47f4278e..4bb261cda 100644
--- a/roundcubemail/program/js/app.js
+++ b/roundcubemail/program/js/app.js
@@ -26,6 +26,7 @@ function rcube_webmail()
this.buttons = new Object();
this.gui_objects = new Object();
this.commands = new Object();
+ this.onloads = new Array();
// create public reference to myself
rcube_webmail_client = this;
@@ -77,13 +78,17 @@ function rcube_webmail()
this.buttons[command][this.buttons[command].length] = button_prop;
};
-
// register a specific gui object
this.gui_object = function(name, id)
{
this.gui_objects[name] = id;
};
-
+
+ // execute the given script on load
+ this.add_onload = function(f)
+ {
+ this.onloads[this.onloads.length] = f;
+ };
// initialize webmail client
this.init = function()
@@ -101,7 +106,7 @@ function rcube_webmail()
// find all registered gui objects
for (var n in this.gui_objects)
this.gui_objects[n] = rcube_find_object(this.gui_objects[n]);
-
+
// tell parent window that this frame is loaded
if (this.env.framed && parent.rcmail && parent.rcmail.set_busy)
parent.rcmail.set_busy(false);
@@ -293,6 +298,16 @@ function rcube_webmail()
// start keep-alive interval
this.start_keepalive();
+
+
+ // execute all foreign onload scripts
+ for (var i=0; i<this.onloads.length; i++)
+ {
+ if (typeof(this.onloads[i]) == 'string')
+ eval(this.onloads[i]);
+ else if (typeof(this.onloads[i]) == 'function')
+ this.onloads[i]();
+ }
};
@@ -678,7 +693,7 @@ function rcube_webmail()
this.show_message(this.env.next_uid, false, this.env.action=='preview');
break;
- case 'lastmessage':
+ case 'lastmessage':
if (this.env.last_uid)
this.show_message(this.env.last_uid);
break;
@@ -1209,6 +1224,7 @@ function rcube_webmail()
add_url += '&_refresh=1';
this.env.current_page = page;
this.message_list.clear_selection();
+ this.show_messageframe(false);
}
// also send search request to get the right messages
@@ -1324,17 +1340,16 @@ function rcube_webmail()
else
{
var selection = this.message_list.get_selection();
- var id;
- for (var n=0; n<selection.length; n++)
+ for (var n=0, id; n<selection.length; n++)
{
id = selection[n];
a_uids[a_uids.length] = id;
this.message_list.remove_row(id);
}
- this.message_list.select_next();
+ this.show_messageframe(false);
}
-
+
var lock = false;
// show wait message