diff --git a/CHANGELOG b/CHANGELOG index 782c31883..a27960901 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,11 @@ CHANGELOG RoundCube Webmail --------------------------- +2006/12/17 (thomasb) +---------- +- Added patch by Ryan Rittenhouse & David Glick for a resizeable preview pane + + 2006/12/06 (thomasb) ---------- - Improve memory usage when sending mail (closes #1484098) diff --git a/program/js/app.js b/program/js/app.js index d47f4278e..4bb261cda 100644 --- a/program/js/app.js +++ b/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.p1pos.y) && ((pos.y + this.layer.height * 1.5) < (this.p2pos.y + this.p2.offsetHeight))) + { + this.pos = pos.y; + this.resize(); + } + } + else + { + if (((pos.x - this.layer.width * 1.5) > this.p1pos.x) && ((pos.x + this.layer.width * 1.5) < (this.p2pos.x + this.p2.offsetWidth))) + { + this.pos = pos.x; + this.resize(); + } + } + + this.p1pos = rcube_get_object_pos(this.p1); + this.p2pos = rcube_get_object_pos(this.p2); + return false; + }; + + /** + * Handler for mouseup events + */ + this.onDragStop = function(e) + { + // cancel the listening for drag events + rcube_event.remove_listener({element:document, event:'mousemove', object:this, method:'onDrag'}); + rcube_event.remove_listener({element:document, event:'mouseup', object:this, method:'onDragStop'}); + var iframes = document.getElementsByTagName('IFRAME'); + + for (var n in iframes) + { + var iframedoc; + if (iframes[n].contentDocument) + iframedoc = iframes[n].contentDocument; + else if (iframes[n].contentWindow) + iframedoc = iframes[n].contentWindow.document; + else if (iframes[n].document) + iframedoc = iframes[n].document; + if (iframedoc) + { + if (this.iframe_events[n]) { + if (iframedoc.removeEventListener) + iframedoc.removeEventListener('mousemove', this.iframe_events[n], false); + else if (iframedoc.detachEvent) + iframedoc.detachEvent('onmousemove', this.iframe_events[n]); + else + iframedoc['onmousemove'] = null; + } + + rcube_event.remove_listener({element:iframedoc, event:'mouseup', object:this, method:'onDragStop'}); + } + } + + // save state in cookie + var exp = new Date(); + exp.setYear(exp.getFullYear() + 1); + bw.set_cookie(this.id, 'pos='+this.pos, exp); + + return bw.safari ? true : rcube_event.cancel(e); + }; + + /** + * Handler for window resize events + */ + this.onResize = function(e) + { + this.p1pos = rcube_get_object_pos(this.p1); + this.p2pos = rcube_get_object_pos(this.p2); + var height = this.horizontal ? this.p2pos.y - this.p1pos.y - this.p1.offsetHeight : this.p1.offsetHeight; + var width = this.horizontal ? this.p1.offsetWidth : this.p2pos.x - this.p1pos.x - this.p1.offsetWidth; + this.layer.resize(width, height); + }; + + } // end class rcube_splitter diff --git a/skins/default/templates/addressbook.html b/skins/default/templates/addressbook.html index 1cbdc84d2..e5b5a104b 100644 --- a/skins/default/templates/addressbook.html +++ b/skins/default/templates/addressbook.html @@ -4,6 +4,7 @@ <roundcube:object name="pagetitle" /> + @@ -31,6 +32,11 @@ + +
diff --git a/skins/default/templates/mail.html b/skins/default/templates/mail.html index 7e83057c5..d7f11bdfd 100644 --- a/skins/default/templates/mail.html +++ b/skins/default/templates/mail.html @@ -4,6 +4,7 @@ <roundcube:object name="pagetitle" /> + @@ -55,6 +56,10 @@ +
@@ -62,7 +67,7 @@