- Added vertical splitter for folders list resizing

- Added possibility to view all headers in message view
- Fixed splitter drag/resize on Opera (#1485170)
- debug console css fixes for IE
release-0.6
alecpl 16 years ago
parent 3e8bd7af59
commit e5686f4a01

@ -1,6 +1,12 @@
CHANGELOG RoundCube Webmail CHANGELOG RoundCube Webmail
--------------------------- ---------------------------
2008/09/12 (alec)
----------
- Added vertical splitter for folders list resizing
- Added possibility to view all headers in message view
- Fixed splitter drag/resize on Opera (#1485170)
2008/09/12 (thomasb) 2008/09/12 (thomasb)
---------- ----------
- Refactor drag & drop functionality. Don't rely on browser events anymore (#1484453) - Refactor drag & drop functionality. Don't rely on browser events anymore (#1484453)

@ -1371,6 +1371,23 @@ class rcube_imap
return $body; return $body;
} }
/**
* Returns the message headers as string
*
* @param int Message UID
* @return string Message headers string
*/
function &get_raw_headers($uid)
{
if (!($msg_id = $this->_uid2id($uid)))
return FALSE;
$headers = iil_C_FetchPartHeader($this->conn, $this->mailbox, $msg_id, NULL);
return $headers;
}
/** /**

@ -320,9 +320,9 @@ class rcube_template extends rcube_html_page
// add debug console // add debug console
if ($this->config['debug_level'] & 8) { if ($this->config['debug_level'] & 8) {
$this->add_footer('<div style="position:absolute;top:5px;left:5px;width:400px;padding:0.2em;background:white;opacity:0.8;z-index:9000"> $this->add_footer('<div style="position:absolute;top:5px;left:5px;width:405px;padding:2px;background:white;opacity:0.8;filter:alpha(opacity=80);z-index:9000">
<a href="#toggle" onclick="con=document.getElementById(\'dbgconsole\');con.style.display=(con.style.display==\'none\'?\'block\':\'none\');return false">console</a> <a href="#toggle" onclick="con=document.getElementById(\'dbgconsole\');con.style.display=(con.style.display==\'none\'?\'block\':\'none\');return false">console</a>
<form action="/" name="debugform"><textarea name="console" id="dbgconsole" rows="20" cols="40" wrap="off" style="display:none;width:400px;border:none;font-size:x-small"></textarea></form></div>' <form action="/" name="debugform" style="display:inline"><textarea name="console" id="dbgconsole" rows="20" cols="40" wrap="off" style="display:none;width:400px;border:none;font-size:x-small"></textarea></form></div>'
); );
} }
$output = $this->parse_with_globals($output); $output = $this->parse_with_globals($output);

@ -159,7 +159,7 @@ function rcube_webmail()
if (this.env.action=='show' || this.env.action=='preview') if (this.env.action=='show' || this.env.action=='preview')
{ {
this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'delete', 'mark', 'viewsource', 'print', 'load-attachment', true); this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'delete', 'mark', 'viewsource', 'print', 'load-attachment', 'load-headers', true);
if (this.env.next_uid) if (this.env.next_uid)
{ {
this.enable_command('nextmessage', true); this.enable_command('nextmessage', true);
@ -510,7 +510,6 @@ function rcube_webmail()
return false; return false;
} }
// process command // process command
switch (command) switch (command)
{ {
@ -554,6 +553,11 @@ function rcube_webmail()
break; break;
case 'load-headers':
this.load_headers(obj);
break;
case 'sort': case 'sort':
// get the type of sorting // get the type of sorting
var a_sort = props.split('_'); var a_sort = props.split('_');
@ -3654,6 +3658,54 @@ function rcube_webmail()
} }
// display fetched raw headers
this.set_headers = function(content)
{
if (this.gui_objects.all_headers_row && this.gui_objects.all_headers_box && content)
{
var box = this.gui_objects.all_headers_box;
box.innerHTML = content;
box.style.display = 'block';
if (this.env.framed && parent.rcmail)
parent.rcmail.set_busy(false);
else
this.set_busy(false);
}
};
// display all-headers row and fetch raw message headers
this.load_headers = function(elem)
{
if (!this.gui_objects.all_headers_row || !this.gui_objects.all_headers_box || !this.env.uid)
return;
this.set_classname(elem, 'show-headers', false);
this.set_classname(elem, 'hide-headers', true);
this.gui_objects.all_headers_row.style.display = bw.ie ? 'block' : 'table-row';
elem.onclick = function() { rcmail.hide_headers(elem); }
// fetch headers only once
if (!this.gui_objects.all_headers_box.innerHTML)
{
this.set_busy(true, 'loading');
this.http_post('headers', '_uid='+this.env.uid);
}
}
// hide all-headers row
this.hide_headers = function(elem)
{
if (!this.gui_objects.all_headers_row || !this.gui_objects.all_headers_box)
return;
this.set_classname(elem, 'hide-headers', false);
this.set_classname(elem, 'show-headers', true);
this.gui_objects.all_headers_row.style.display = 'none';
elem.onclick = function() { rcmail.load_headers(elem); }
}
/********************************************************/ /********************************************************/
/********* remote request methods *********/ /********* remote request methods *********/
@ -3760,7 +3812,7 @@ function rcube_webmail()
} }
if (request_obj.__lock) if (request_obj.__lock)
this.set_busy(false); this.set_busy(false);
console.log(request_obj.get_text()); console.log(request_obj.get_text());

@ -253,23 +253,28 @@ function rcube_layer(id, attributes)
var obj; var obj;
obj = document.createElement('DIV'); obj = document.createElement('DIV');
with(obj) with(obj)
{ {
id = this.name; id = this.name;
with(style) with(style)
{ {
position = 'absolute'; position = 'absolute';
visibility = (vis) ? (vis==2) ? 'inherit' : 'visible' : 'hidden'; visibility = (vis) ? (vis==2) ? 'inherit' : 'visible' : 'hidden';
left = l+'px'; left = l+'px';
top = t+'px'; top = t+'px';
if(w) width = w+'px'; if (w)
if(h) height = h+'px'; width = w.toString().match(/\%$/) ? w : w+'px';
if (h)
height = h.toString().match(/\%$/) ? h : h+'px';
if(z) zIndex = z; if(z) zIndex = z;
} }
} }
if(parent) parent.appendChild(obj); if (parent)
else document.body.appendChild(obj); parent.appendChild(obj);
else
document.body.appendChild(obj);
this.elm = obj; this.elm = obj;
}; };
@ -496,7 +501,7 @@ function rcube_find_object(id, d)
// return the absolute position of an object within the document // return the absolute position of an object within the document
function rcube_get_object_pos(obj) function rcube_get_object_pos(obj, relative)
{ {
if(typeof(obj)=='string') if(typeof(obj)=='string')
obj = rcube_find_object(obj); obj = rcube_find_object(obj);
@ -506,7 +511,7 @@ function rcube_get_object_pos(obj)
var iX = (bw.layers) ? obj.x : obj.offsetLeft; var iX = (bw.layers) ? obj.x : obj.offsetLeft;
var iY = (bw.layers) ? obj.y : obj.offsetTop; var iY = (bw.layers) ? obj.y : obj.offsetTop;
if(bw.ie || bw.mz) if(!relative && (bw.ie || bw.mz))
{ {
var elm = obj.offsetParent; var elm = obj.offsetParent;
while(elm && elm!=null) while(elm && elm!=null)
@ -598,8 +603,9 @@ function rcube_console()
this.log = function(msg) this.log = function(msg)
{ {
box = rcube_find_object('console'); box = rcube_find_object('console');
if (box) if (box)
if (msg[msg.length-1]=='\n') if (msg.charAt(msg.length-1)=='\n')
box.value += msg+'--------------------------------------\n'; box.value += msg+'--------------------------------------\n';
else else
box.value += msg+'\n--------------------------------------\n'; box.value += msg+'\n--------------------------------------\n';

@ -128,7 +128,7 @@ $labels['quicksearch'] = 'Quick search';
$labels['resetsearch'] = 'Reset search'; $labels['resetsearch'] = 'Reset search';
$labels['compose'] = 'Compose a message'; $labels['compose'] = 'Compose a message';
$labels['savemessage'] = 'Save this draft'; $labels['savemessage'] = 'Save this draft';
$labels['sendmessage'] = 'Send the message now'; $labels['sendmessage'] = 'Send now';
$labels['addattachment'] = 'Attach a file'; $labels['addattachment'] = 'Attach a file';
$labels['charset'] = 'Charset'; $labels['charset'] = 'Charset';
$labels['editortype'] = 'Editor type'; $labels['editortype'] = 'Editor type';

@ -164,7 +164,7 @@ $labels['resetsearch'] = 'Reset search';
// message compose // message compose
$labels['compose'] = 'Compose a message'; $labels['compose'] = 'Compose a message';
$labels['savemessage'] = 'Save this draft'; $labels['savemessage'] = 'Save this draft';
$labels['sendmessage'] = 'Send the message now'; $labels['sendmessage'] = 'Send now';
$labels['addattachment'] = 'Attach a file'; $labels['addattachment'] = 'Attach a file';
$labels['charset'] = 'Charset'; $labels['charset'] = 'Charset';
$labels['editortype'] = 'Editor type'; $labels['editortype'] = 'Editor type';

@ -740,7 +740,7 @@ function rcmail_message_headers($attrib, $headers=NULL)
// show these headers // show these headers
$standard_headers = array('subject', 'from', 'organization', 'to', 'cc', 'bcc', 'replyto', 'date'); $standard_headers = array('subject', 'from', 'organization', 'to', 'cc', 'bcc', 'replyto', 'date');
foreach ($standard_headers as $hkey) foreach ($standard_headers as $hkey)
{ {
if (!$headers[$hkey]) if (!$headers[$hkey])
@ -771,6 +771,14 @@ function rcmail_message_headers($attrib, $headers=NULL)
$header_count++; $header_count++;
} }
// all headers division
$out .= "\n".'<tr><td colspan="2" class="more-headers show-headers"
onclick="return '.JS_OBJECT_NAME.'.command(\'load-headers\', \'\', this)"></td></tr>';
$out .= "\n".'<tr id="all-headers"><td colspan="2" class="all"><div id="headers-source"></div></td></tr>';
$OUTPUT->add_gui_object('all_headers_row', 'all-headers');
$OUTPUT->add_gui_object('all_headers_box', 'headers-source');
$out .= "\n</table>\n\n"; $out .= "\n</table>\n\n";
return $header_count ? $out : ''; return $header_count ? $out : '';

@ -0,0 +1,39 @@
<?php
/*
+-----------------------------------------------------------------------+
| program/steps/mail/headers.inc |
| |
| This file is part of the RoundCube Webmail client |
| Copyright (C) 2005-2007, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
| Fetch message headers in raw format for display |
| |
+-----------------------------------------------------------------------+
| Author: Aleksander Machniak <alec@alec.pl> |
+-----------------------------------------------------------------------+
$Id: mark.inc 1580 2008-06-30 09:36:18Z alec $
*/
if ($uid = get_input_value('_uid', RCUBE_INPUT_POST))
{
$source = $IMAP->get_raw_headers($uid);
if ($source)
{
$source = htmlspecialchars(trim($source));
$source = preg_replace('/\t/', '&nbsp;&nbsp;&nbsp;&nbsp;', $source);
$source = preg_replace('/^([a-z0-9_:-]+)/im', '<font class="bold">'.'\1'.'</font>', $source);
$source = preg_replace('/\r?\n/', '<br />', $source);
$OUTPUT->command('set_headers', $source);
$OUTPUT->send();
}
}
exit;
?>

@ -1,6 +1,5 @@
/***** RoundCube|Mail address book task styles *****/ /***** RoundCube|Mail address book task styles *****/
#abooktoolbar #abooktoolbar
{ {
position: absolute; position: absolute;
@ -18,7 +17,7 @@
{ {
position: absolute; position: absolute;
bottom: 16px; bottom: 16px;
left: 185px; left: 190px;
width: 240px; width: 240px;
height: 20px; height: 20px;
text-align: left; text-align: left;
@ -30,38 +29,63 @@
color: #333333; color: #333333;
} }
#directorylist, #addresslist, #importbox #mainscreen
{ {
position: absolute; position: absolute;
top: 85px; top: 85px;
right: 20px;
bottom: 40px; bottom: 40px;
border: 1px solid #999999; left: 200px;
background-color: #F9F9F9;
overflow: auto;
/* css hack for IE */ /* css hack for IE */
height: expression((parseInt(document.documentElement.clientHeight)-135)+'px'); width: expression((parseInt(document.documentElement.clientWidth)-220)+'px');
height: expression((parseInt(document.documentElement.clientHeight)-125)+'px');
} }
#directorylist #directorylist
{ {
position: absolute;
top: 85px;
bottom: 40px;
left: 20px; left: 20px;
width: 170px; width: 170px;
border: 1px solid #999999;
background-color: #F9F9F9;
overflow: hidden; overflow: hidden;
/* css hack for IE */
height: expression((parseInt(document.documentElement.clientHeight)-125)+'px');
} }
#addresslist #addresslist
{ {
left: 200px; position: absolute;
width: 340px; top: 0px;
bottom: 0px;
border: 1px solid #999999;
background-color: #F9F9F9;
overflow: auto;
/* css hack for IE */
height: expression(parseInt(this.parentNode.offsetHeight)+'px');
} }
#importbox #importbox
{ {
position: absolute;
top: 85px;
bottom: 40px;
left: 20px; left: 20px;
right: 40px; right: 20px;
height: auto; border: 1px solid #999999;
bottom: auto; background-color: #F9F9F9;
padding-bottom: 4ex; padding-bottom: 4ex;
overflow: auto;
/* css hack for IE */
height: expression((parseInt(document.documentElement.clientHeight)-135)+'px');
}
#addresslist
{
left: 0px;
width: 340px;
} }
#importbox a #importbox a
@ -129,30 +153,17 @@
#contacts-box #contacts-box
{ {
position: absolute; position: absolute;
top: 85px; top: 0px;
left: 555px; left: 555px;
right: 20px; right: 0px;
bottom: 40px; bottom: 0px;
border: 1px solid #999999; border: 1px solid #999999;
overflow: hidden; overflow: hidden;
/* css hack for IE */ /* css hack for IE */
width: expression((parseInt(document.documentElement.clientWidth)-45-document.getElementById('addresslist').offsetLeft-document.getElementById('addresslist').offsetWidth)+'px'); height: expression(parseInt(this.parentNode.offsetHeight)+'px');
height: expression((parseInt(document.documentElement.clientHeight)-135)+'px'); width: expression((parseInt(this.parentNode.offsetWidth)-555)+'px');
} }
#addressviewsplitter
{
background-position: 4px center;
}
#addressviewsplitter .splitterLine
{
margin-left: 3px;
width: 6px;
}
body.iframe, body.iframe,
#contact-frame #contact-frame
{ {

@ -194,6 +194,8 @@ a.button-logout
right: 200px; right: 200px;
z-index: 5000; z-index: 5000;
opacity: 0.85; opacity: 0.85;
/* IE */
filter: alpha(opacity=85);
} }
#message div #message div
@ -237,8 +239,10 @@ a.button-logout
.splitter .splitter
{ {
user-select: none;
-moz-user-select: none;
-khtml-user-select: none;
position: absolute; position: absolute;
padding: 2px;
background: url(images/dimple.png) center no-repeat; background: url(images/dimple.png) center no-repeat;
} }
@ -251,7 +255,7 @@ a.button-logout
.splitter-v .splitter-v
{ {
cursor: e-resize; cursor: e-resize;
background-position: 1px center; background-position: 2px center;
} }
.boxtitle .boxtitle

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

@ -146,6 +146,30 @@ td.formlinks a:visited
color: #333333; color: #333333;
} }
#mainscreen
{
position: absolute;
top: 85px;
right: 20px;
bottom: 40px;
left: 20px;
/* css hack for IE */
width: expression((parseInt(document.documentElement.clientWidth)-40)+'px');
height: expression((parseInt(document.documentElement.clientHeight)-125)+'px');
}
#mailrightcontainer
{
position: absolute;
top: 0px;
left: 170px;
bottom: 0px;
right: 0px;
/* css hack for IE */
width: expression((parseInt(this.parentNode.offsetWidth)-170)+'px');
height: expression(parseInt(this.parentNode.offsetHeight)+'px');
}
#messagepartcontainer #messagepartcontainer
{ {
position: absolute; position: absolute;
@ -161,42 +185,37 @@ td.formlinks a:visited
#mailcontframe #mailcontframe
{ {
position: absolute; position: absolute;
top: 85px; width: 100%;
left: 200px; top: 0px;
right: 20px; bottom: 0px;
bottom: 40px;
border: 1px solid #999999; border: 1px solid #999999;
background-color: #F9F9F9; background-color: #F9F9F9;
overflow: auto; overflow: auto;
/* css hack for IE */ /* css hack for IE */
width: expression((parseInt(document.documentElement.clientWidth)-220)+'px'); height: expression(parseInt(this.parentNode.offsetHeight)+'px');
height: expression((parseInt(document.documentElement.clientHeight)-125)+'px');
} }
#mailpreviewframe #mailpreviewframe
{ {
position: absolute; position: absolute;
top: 305px; width: 100%;
left: 200px; top: 205px;
right: 20px; bottom: 0px;
bottom: 40px;
border: 1px solid #999999; border: 1px solid #999999;
background-color: #F9F9F9; background-color: #F9F9F9;
/* css hack for IE */ /* css hack for IE */
width: expression((parseInt(document.documentElement.clientWidth)-220)+'px'); height: expression((parseInt(this.parentNode.offsetHeight)-205)+'px');
height: expression((parseInt(document.documentElement.clientHeight)-135-document.getElementById('mailcontframe').offsetHeight)+'px');
} }
#messagecontframe #messagecontframe
{ {
position: absolute; position: relative;
top: 0px; top: 0px;
left: 0px; left: 0px;
right: 0px; right: 0px;
bottom: 0px; bottom: 0px;
/* css hack for IE */ width: 100%;
width: expression((parseInt(document.documentElement.clientWidth)-220)+'px'); height: 100%;
height: expression((parseInt(document.documentElement.clientHeight)-135-document.getElementById('mailcontframe').offsetHeight)+'px');
} }
#messagepartframe #messagepartframe
@ -253,15 +272,15 @@ td.formlinks a:visited
#mailboxlist-container #mailboxlist-container
{ {
position: absolute; position: absolute;
top: 85px; top: 0px;
left: 20px; left: 0px;
width: 170px; width: 160px;
bottom: 40px; bottom: 0px;
border: 1px solid #999; border: 1px solid #999;
background-color: #F9F9F9; background-color: #F9F9F9;
overflow: auto; overflow: auto;
/* css hack for IE */ /* css hack for IE */
height: expression((parseInt(document.documentElement.clientHeight)-125)+'px'); height: expression(parseInt(this.parentNode.offsetHeight)+'px');
} }
#mailboxlist #mailboxlist
@ -599,15 +618,14 @@ html>body*#messagelist[id$="messagelist"]:not([class="none"]) { table-layout: au
#messageframe #messageframe
{ {
position: absolute; position: absolute;
top: 85px; top: 0px;
left: 200px; left: 0px;
right: 20px; right: 0px;
bottom: 40px; bottom: 0px;
border: 1px solid #999; border: 1px solid #999;
background-color: #FFF; background-color: #FFF;
overflow: auto; overflow: auto;
/* css hack for IE */ /* css hack for IE */
/* margin-bottom: 10px; */
width: expression((parseInt(document.documentElement.clientWidth)-220)+'px'); width: expression((parseInt(document.documentElement.clientWidth)-220)+'px');
height: expression((parseInt(document.documentElement.clientHeight)-125)+'px'); height: expression((parseInt(document.documentElement.clientHeight)-125)+'px');
} }
@ -641,7 +659,7 @@ table.headers-table tr td
table.headers-table td.header-title table.headers-table td.header-title
{ {
width: 80px; width: 85px;
color: #666666; color: #666666;
font-weight: bold; font-weight: bold;
text-align: right; text-align: right;
@ -651,10 +669,20 @@ table.headers-table td.header-title
table.headers-table tr td.subject table.headers-table tr td.subject
{ {
width: 95%; width: 90%;
font-weight: bold; font-weight: bold;
} }
table.headers-table tr td.all
{
width: 100%;
color: #666666;
text-align: left;
padding-right: 10px;
vertical-align: center;
text-align: center;
}
#attachment-list #attachment-list
{ {
margin: 0px; margin: 0px;
@ -949,3 +977,46 @@ div.message-htmlpart div.rcmBody
{ {
margin-top: 4px; margin-top: 4px;
} }
.more-headers
{
cursor: pointer;
width: 100%;
height: 6px;
}
.show-headers
{
background: url(images/icons/down_small.gif) no-repeat center;
}
.hide-headers
{
background: url(images/icons/up_small.gif) no-repeat center;
}
#all-headers
{
height: 150px;
display: none;
}
#headers-source
{
margin: 0 5px;
width: 100%;
height: 145px;
background: white;
overflow: auto;
font-size: 11px;
white-space: nowrap;
border: 1px solid #999999;
display: none;
text-align: left;
color: #666666;
}
font.bold
{
font-weight: bold;
}

@ -11,40 +11,48 @@ function rcube_splitter(attrib)
this.id = attrib.id ? attrib.id : this.p1id + '_' + this.p2id + '_splitter'; this.id = attrib.id ? attrib.id : this.p1id + '_' + this.p2id + '_splitter';
this.orientation = attrib.orientation; this.orientation = attrib.orientation;
this.horizontal = (this.orientation == 'horizontal' || this.orientation == 'h'); this.horizontal = (this.orientation == 'horizontal' || this.orientation == 'h');
this.offset_1 = bw.ie ? 0 : -1; this.offset = bw.ie6 ? 2 : 0;
this.offset_2 = bw.ie ? -2 : 1; this.pos = attrib.start ? attrib.start * 1 : 0;
this.pos = 0; this.relative = attrib.relative ? true : false;
this.drag_active = false;
this.init = function() this.init = function()
{ {
this.p1 = document.getElementById(this.p1id); this.p1 = document.getElementById(this.p1id);
this.p2 = document.getElementById(this.p2id); this.p2 = document.getElementById(this.p2id);
// create and position the handle for this splitter // create and position the handle for this splitter
this.p1pos = rcube_get_object_pos(this.p1); this.p1pos = rcube_get_object_pos(this.p1, this.relative);
this.p2pos = rcube_get_object_pos(this.p2); this.p2pos = rcube_get_object_pos(this.p2, this.relative);
var top = this.p1pos.y + this.p1.offsetHeight;
var height = this.p2pos.y - this.p1pos.y - this.p1.offsetHeight;
var left = this.p1pos.x + this.p1.offsetWidth;
var width = this.p2pos.x - this.p1pos.x - this.p1.offsetWidth;
if (this.horizontal) if (this.horizontal)
this.layer = new rcube_layer(this.id, {x: this.p1pos.x, y: top, height: height, width: this.p1.offsetWidth, vis: 1}); {
var top = this.p1pos.y + this.p1.offsetHeight;
this.layer = new rcube_layer(this.id, {x: 0, y: top, height: 10,
width: '100%', vis: 1, parent: this.p1.parentNode});
}
else else
this.layer = new rcube_layer(this.id, {x: left, y: this.p1pos.y, width: width, height: this.p1.offsetHeight, vis: 1}); {
var left = this.p1pos.x + this.p1.offsetWidth;
this.layer = new rcube_layer(this.id, {x: left, y: 0, width: 10,
height: '100%', vis: 1, parent: this.p1.parentNode});
}
this.elm = this.layer.elm; this.elm = this.layer.elm;
this.elm.className = 'splitter '+(this.horizontal ? 'splitter-h' : 'splitter-v'); this.elm.className = 'splitter '+(this.horizontal ? 'splitter-h' : 'splitter-v');
this.elm.unselectable = 'on';
// add the mouse event listeners // add the mouse event listeners
rcube_event.add_listener({element: this.elm, event:'mousedown', object:this, method:'onDragStart'}); rcube_event.add_listener({element: this.elm, event:'mousedown', object:this, method:'onDragStart'});
rcube_event.add_listener({element: window, event:'resize', object:this, method:'onResize'}); if (bw.ie)
rcube_event.add_listener({element: window, event:'resize', object:this, method:'onResize'});
// read saved position from cookie // read saved position from cookie
var cookie = bw.get_cookie(this.id); var cookie = bw.get_cookie(this.id);
if (cookie) if (cookie)
{ {
var param = cookie.split(':'); var param = cookie.split(':');
for (var i=0, p; i<param.length; i++) for (var i=0, p; i<param.length; i++)
{ {
p = param[i].split('='); p = param[i].split('=');
@ -53,6 +61,11 @@ function rcube_splitter(attrib)
this.resize(); this.resize();
} }
else if (this.pos)
{
this.resize();
this.set_cookie();
}
}; };
/** /**
@ -61,17 +74,22 @@ function rcube_splitter(attrib)
*/ */
this.resize = function() this.resize = function()
{ {
if (this.horizontal) if (this.horizontal)
{ {
this.p1.style.height = Math.floor(this.pos - this.p1pos.y - this.layer.height / 2 + this.offset_1) + 'px'; var lh = this.layer.height - this.offset * 2;
this.p2.style.top = Math.ceil(this.pos + (this.layer.height / 2 + this.offset_2)) + 'px'; this.p1.style.height = Math.floor(this.pos - this.p1pos.y - lh / 2) + 'px';
this.layer.move(this.layer.x, Math.round(this.pos - this.layer.height / 2 + 1)); this.p2.style.top = Math.ceil(this.pos + lh / 2) + 'px';
this.layer.move(this.layer.x, Math.round(this.pos - lh / 2 + 1));
if (bw.ie)
this.p2.style.height = (parseInt(this.p2.parentNode.offsetHeight) - parseInt(this.p2.style.top))+'px';
} }
else else
{ {
this.p1.style.width = Math.floor(this.pos - this.p1pos.x - this.layer.width / 2 + this.offset_1) + 'px'; this.p1.style.width = Math.floor(this.pos - this.p1pos.x - this.layer.width / 2) + 'px';
this.p2.style.left = Math.ceil(this.pos + this.layer.width / 2 + this.offset_2) + 'px'; this.p2.style.left = Math.ceil(this.pos + this.layer.width / 2) + 'px';
this.layer.move(Math.round(this.pos - this.layer.width / 2 + 1), this.layer.y); this.layer.move(Math.round(this.pos - this.layer.width / 2 + 1), this.layer.y);
if (bw.ie)
this.p2.style.width = (parseInt(this.p2.parentNode.offsetWidth) - parseInt(this.p2.style.left))+'px';
} }
}; };
@ -80,9 +98,10 @@ function rcube_splitter(attrib)
*/ */
this.onDragStart = function(e) this.onDragStart = function(e)
{ {
this.p1pos = rcube_get_object_pos(this.p1); this.p1pos = rcube_get_object_pos(this.p1, this.relative);
this.p2pos = rcube_get_object_pos(this.p2); this.p2pos = rcube_get_object_pos(this.p2, this.relative);
this.drag_active = true;
// start listening to mousemove events // start listening to mousemove events
rcube_event.add_listener({element:document, event:'mousemove', object:this, method:'onDrag'}); rcube_event.add_listener({element:document, event:'mousemove', object:this, method:'onDrag'});
rcube_event.add_listener({element:document, event:'mouseup', object:this, method:'onDragStop'}); rcube_event.add_listener({element:document, event:'mouseup', object:this, method:'onDragStop'});
@ -106,6 +125,7 @@ function rcube_splitter(attrib)
var s = this; var s = this;
var id = iframes[n].id; var id = iframes[n].id;
this.iframe_events[n] = function(e){ e._rc_pos_offset = rcube_get_object_pos(document.getElementById(id)); return s.onDrag(e); } this.iframe_events[n] = function(e){ e._rc_pos_offset = rcube_get_object_pos(document.getElementById(id)); return s.onDrag(e); }
if (iframedoc.addEventListener) if (iframedoc.addEventListener)
iframedoc.addEventListener('mousemove', this.iframe_events[n], false); iframedoc.addEventListener('mousemove', this.iframe_events[n], false);
else if (iframes[n].attachEvent) else if (iframes[n].attachEvent)
@ -124,12 +144,22 @@ function rcube_splitter(attrib)
this.onDrag = function(e) this.onDrag = function(e)
{ {
var pos = rcube_event.get_mouse_pos(e); var pos = rcube_event.get_mouse_pos(e);
if (!this.drag_active) return false;
if (e._rc_pos_offset) if (e._rc_pos_offset)
{ {
pos.x += e._rc_pos_offset.x; pos.x += e._rc_pos_offset.x;
pos.y += e._rc_pos_offset.y; pos.y += e._rc_pos_offset.y;
} }
if (this.relative)
{
var parent = rcube_get_object_pos(this.p1.parentNode);
pos.x -= parent.x;
pos.y -= parent.y;
}
if (this.horizontal) if (this.horizontal)
{ {
if (((pos.y - this.layer.height * 1.5) > this.p1pos.y) && ((pos.y + this.layer.height * 1.5) < (this.p2pos.y + this.p2.offsetHeight))) if (((pos.y - this.layer.height * 1.5) > this.p1pos.y) && ((pos.y + this.layer.height * 1.5) < (this.p2pos.y + this.p2.offsetHeight)))
@ -147,8 +177,8 @@ function rcube_splitter(attrib)
} }
} }
this.p1pos = rcube_get_object_pos(this.p1); this.p1pos = rcube_get_object_pos(this.p1, this.relative);
this.p2pos = rcube_get_object_pos(this.p2); this.p2pos = rcube_get_object_pos(this.p2, this.relative);
return false; return false;
}; };
@ -160,6 +190,8 @@ function rcube_splitter(attrib)
// cancel the listening for drag events // 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:'mousemove', object:this, method:'onDrag'});
rcube_event.remove_listener({element:document, event:'mouseup', object:this, method:'onDragStop'}); rcube_event.remove_listener({element:document, event:'mouseup', object:this, method:'onDragStop'});
this.drag_active = false;
var iframes = document.getElementsByTagName('IFRAME'); var iframes = document.getElementsByTagName('IFRAME');
for (var n in iframes) for (var n in iframes)
@ -176,39 +208,37 @@ function rcube_splitter(attrib)
if (this.iframe_events[n]) { if (this.iframe_events[n]) {
if (iframedoc.removeEventListener) if (iframedoc.removeEventListener)
iframedoc.removeEventListener('mousemove', this.iframe_events[n], false); iframedoc.removeEventListener('mousemove', this.iframe_events[n], false);
else if (iframedoc.detachEvent) else if (iframedoc.detachEvent)
iframedoc.detachEvent('onmousemove', this.iframe_events[n]); iframedoc.detachEvent('onmousemove', this.iframe_events[n]);
else else
iframedoc['onmousemove'] = null; iframedoc['onmousemove'] = null;
} }
rcube_event.remove_listener({element:iframedoc, event:'mouseup', object:this, method:'onDragStop'}); rcube_event.remove_listener({element:iframedoc, event:'mouseup', object:this, method:'onDragStop'});
} }
} }
// save state in cookie this.set_cookie();
var exp = new Date();
exp.setYear(exp.getFullYear() + 1);
bw.set_cookie(this.id, 'pos='+this.pos, exp);
// Firefox 3 will initiate its built in drag-and-drop on the divider
// widget if it already has focus when a second drag event starts
this.p1.focus();
this.p1.blur();
return bw.safari ? true : rcube_event.cancel(e); return bw.safari ? true : rcube_event.cancel(e);
}; };
/** /**
* Handler for window resize events * Handler for window resize events
*/ */
this.onResize = function(e) this.onResize = function(e)
{ {
this.p1pos = rcube_get_object_pos(this.p1); if (this.horizontal)
this.p2pos = rcube_get_object_pos(this.p2); this.p2.style.height = (parseInt(this.p2.parentNode.offsetHeight) - parseInt(this.p2.style.top))+'px';
var height = this.horizontal ? this.p2pos.y - this.p1pos.y - this.p1.offsetHeight : this.p1.offsetHeight; else
var width = this.horizontal ? this.p1.offsetWidth : this.p2pos.x - this.p1pos.x - this.p1.offsetWidth; this.p2.style.width = (parseInt(this.p2.parentNode.offsetWidth) - parseInt(this.p2.style.left))+'px';
this.layer.resize(width, height);
}; };
this.set_cookie = function()
{
// save state in cookie
var exp = new Date();
exp.setYear(exp.getFullYear() + 1);
bw.set_cookie(this.id, 'pos='+this.pos, exp);
}
} // end class rcube_splitter } // end class rcube_splitter

@ -24,26 +24,31 @@
</div> </div>
<roundcube:if condition="config:ldap_public" /> <roundcube:if condition="config:ldap_public" />
<div id="directorylist"> <div id="directorylist">
<div id="groups-title"><roundcube:label name="groups" /></div> <div id="groups-title"><roundcube:label name="groups" /></div>
<roundcube:object name="directorylist" id="directories-list" /> <roundcube:object name="directorylist" id="directories-list" />
</div> </div>
<roundcube:else /> <roundcube:else />
<style type="text/css"> <style type="text/css">
#addresslist { left:20px; width:440px } #abookcountbar { left: 20px;}
#contacts-box { left:475px } #mainscreen { left:20px; /* IE hack */ width:expression((parseInt(document.documentElement.clientWidth)-40)+'px') }
#abookcountbar { left:20px } #addresslist { width:245px }
#contacts-box { left:255px; /* IE hack */ width:expression((parseInt(mainscreen.offsetWidth)-255)+'px') }
</style> </style>
<roundcube:endif /> <roundcube:endif />
<div id="mainscreen">
<div id="addresslist"> <div id="addresslist">
<roundcube:object name="addresslist" id="contacts-table" class="records-table" cellspacing="0" summary="Contacts list" /> <roundcube:object name="addresslist" id="contacts-table" class="records-table" cellspacing="0" summary="Contacts list" />
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var addrviewsplit = new rcube_splitter({id:'addressviewsplitter', p1: 'addresslist', p2: 'contacts-box', orientation: 'v'}); var addrviewsplit = new rcube_splitter({id:'addressviewsplitter', p1: 'addresslist', p2: 'contacts-box', orientation: 'v', relative: true, start: 250});
rcmail.add_onload('addrviewsplit.init()'); rcmail.add_onload('addrviewsplit.init()');
</script> </script>
@ -51,6 +56,8 @@
<roundcube:object name="addressframe" id="contact-frame" width="100%" height="100%" frameborder="0" src="/watermark.html" /> <roundcube:object name="addressframe" id="contact-frame" width="100%" height="100%" frameborder="0" src="/watermark.html" />
</div> </div>
</div>
<div id="abookcountbar"> <div id="abookcountbar">
<roundcube:button command="firstpage" imageSel="/images/buttons/first_sel.png" imageAct="/images/buttons/first_act.png" imagePas="/images/buttons/first_pas.png" width="11" height="11" title="firstpage" /> <roundcube:button command="firstpage" imageSel="/images/buttons/first_sel.png" imageAct="/images/buttons/first_act.png" imagePas="/images/buttons/first_pas.png" width="11" height="11" title="firstpage" />
<roundcube:button command="previouspage" imageSel="/images/buttons/previous_sel.png" imageAct="/images/buttons/previous_act.png" imagePas="/images/buttons/previous_pas.png" width="11" height="11" title="previouspage" /> <roundcube:button command="previouspage" imageSel="/images/buttons/previous_sel.png" imageAct="/images/buttons/previous_act.png" imagePas="/images/buttons/previous_pas.png" width="11" height="11" title="previouspage" />

@ -47,17 +47,19 @@ body_keypress: function(evt, p)
<roundcube:include file="/includes/taskbar.html" /> <roundcube:include file="/includes/taskbar.html" />
<roundcube:include file="/includes/header.html" /> <roundcube:include file="/includes/header.html" />
<div id="mainscreen">
<div id="mailboxlist-container"> <div id="mailboxlist-container">
<h3 id="mailboxlist-header"><roundcube:label name="mailboxlist" /></h3> <h3 id="mailboxlist-header"><roundcube:label name="mailboxlist" /></h3>
<roundcube:object name="mailboxlist" id="mailboxlist" maxlength="16" /> <roundcube:object name="mailboxlist" id="mailboxlist" maxlength="16" />
</div> </div>
<div id="mailboxcontrols"> <script type="text/javascript">
<roundcube:label name="folder" />:&nbsp; var mailviewsplitv = new rcube_splitter({id:'mailviewsplitterv', p1: 'mailboxlist-container', p2: 'mailrightcontainer', orientation: 'v', relative: true, start: 165});
<roundcube:button command="expunge" label="compact" classAct="active" />&nbsp; rcmail.add_onload('mailviewsplitv.init()');
<roundcube:button command="purge" label="empty" classAct="active" />&nbsp; </script>
</div>
<div id="mailrightcontainer">
<div id="mailcontframe"> <div id="mailcontframe">
<roundcube:object name="messages" <roundcube:object name="messages"
@ -74,22 +76,33 @@ body_keypress: function(evt, p)
</div> </div>
<roundcube:if condition="config:preview_pane == true" /> <roundcube:if condition="config:preview_pane == true" />
<script type="text/javascript"> <script type="text/javascript">
var mailviewsplit = new rcube_splitter({id:'mailviewsplitter', p1: 'mailcontframe', p2: 'mailpreviewframe', orientation: 'h'}); var mailviewsplit = new rcube_splitter({id:'mailviewsplitter', p1: 'mailcontframe', p2: 'mailpreviewframe', orientation: 'h', relative: true, start: 200});
rcmail.add_onload('mailviewsplit.init()'); rcmail.add_onload('mailviewsplit.init()');
</script> </script>
<div id="mailpreviewframe"> <div id="mailpreviewframe">
<roundcube:object name="messagecontentframe" id="messagecontframe" width="100%" height="100%" frameborder="0" src="/watermark.html" /> <roundcube:object name="messagecontentframe" id="messagecontframe" width="100%" height="100%" frameborder="0" src="/watermark.html" />
</div> </div>
<style type="text/css"> <style type="text/css">
#mailcontframe { #mailcontframe { height: 195px; }
bottom: auto;
height: 208px;
}
</style> </style>
<roundcube:endif /> <roundcube:endif />
</div>
</div>
<div id="mailboxcontrols">
<roundcube:label name="folder" />:&nbsp;
<roundcube:button command="expunge" label="compact" classAct="active" />&nbsp;
<roundcube:button command="purge" label="empty" classAct="active" />&nbsp;
</div>
<div id="listcontrols"> <div id="listcontrols">
<roundcube:label name="select" />:&nbsp; <roundcube:label name="select" />:&nbsp;
<roundcube:button command="select-all" label="all" classAct="active" />&nbsp; <roundcube:button command="select-all" label="all" classAct="active" />&nbsp;
@ -100,6 +113,14 @@ body_keypress: function(evt, p)
<roundcube:endif /> <roundcube:endif />
</div> </div>
<div id="messagecountbar">
<roundcube:button command="firstpage" imageSel="/images/buttons/first_sel.png" imageAct="/images/buttons/first_act.png" imagePas="/images/buttons/first_pas.png" width="11" height="11" title="firstmessages" />
<roundcube:button command="previouspage" imageSel="/images/buttons/previous_sel.png" imageAct="/images/buttons/previous_act.png" imagePas="/images/buttons/previous_pas.png" width="11" height="11" title="previousmessages" />
&nbsp;<roundcube:object name="messageCountDisplay" />&nbsp;
<roundcube:button command="nextpage" imageSel="/images/buttons/next_sel.png" imageAct="/images/buttons/next_act.png" imagePas="/images/buttons/next_pas.png" width="11" height="11" title="nextmessages" />
<roundcube:button command="lastpage" imageSel="/images/buttons/last_sel.png" imageAct="/images/buttons/last_act.png" imagePas="/images/buttons/last_pas.png" width="11" height="11" title="lastmessages" />
</div>
<div id="messagetoolbar"> <div id="messagetoolbar">
<roundcube:button command="checkmail" imageSel="/images/buttons/inbox_sel.png" imageAct="/images/buttons/inbox_act.png" imagePas="/images/buttons/inbox_pas.png" width="32" height="32" title="checkmail" /> <roundcube:button command="checkmail" imageSel="/images/buttons/inbox_sel.png" imageAct="/images/buttons/inbox_act.png" imagePas="/images/buttons/inbox_pas.png" width="32" height="32" title="checkmail" />
<roundcube:button command="compose" imageSel="/images/buttons/compose_sel.png" imageAct="/images/buttons/compose_act.png" imagePas="/images/buttons/compose_pas.png" width="32" height="32" title="writenewmessage" /> <roundcube:button command="compose" imageSel="/images/buttons/compose_sel.png" imageAct="/images/buttons/compose_act.png" imagePas="/images/buttons/compose_pas.png" width="32" height="32" title="writenewmessage" />
@ -124,14 +145,6 @@ body_keypress: function(evt, p)
<roundcube:object name="searchform" type="search" results="5" id="quicksearchbox" /><roundcube:button command="reset-search" id="searchreset" image="/images/icons/reset.gif" title="resetsearch" /> <roundcube:object name="searchform" type="search" results="5" id="quicksearchbox" /><roundcube:button command="reset-search" id="searchreset" image="/images/icons/reset.gif" title="resetsearch" />
</div> </div>
<div id="messagecountbar">
<roundcube:button command="firstpage" imageSel="/images/buttons/first_sel.png" imageAct="/images/buttons/first_act.png" imagePas="/images/buttons/first_pas.png" width="11" height="11" title="firstmessages" />
<roundcube:button command="previouspage" imageSel="/images/buttons/previous_sel.png" imageAct="/images/buttons/previous_act.png" imagePas="/images/buttons/previous_pas.png" width="11" height="11" title="previousmessages" />
&nbsp;<roundcube:object name="messageCountDisplay" />&nbsp;
<roundcube:button command="nextpage" imageSel="/images/buttons/next_sel.png" imageAct="/images/buttons/next_act.png" imagePas="/images/buttons/next_pas.png" width="11" height="11" title="nextmessages" />
<roundcube:button command="lastpage" imageSel="/images/buttons/last_sel.png" imageAct="/images/buttons/last_act.png" imagePas="/images/buttons/last_pas.png" width="11" height="11" title="lastmessages" />
</div>
<script type="text/javascript"> <script type="text/javascript">
var rcmailUI = new rcube_mail_ui(); var rcmailUI = new rcube_mail_ui();

@ -4,6 +4,7 @@
<title><roundcube:object name="pagetitle" /></title> <title><roundcube:object name="pagetitle" /></title>
<roundcube:include file="/includes/links.html" /> <roundcube:include file="/includes/links.html" />
<link rel="stylesheet" type="text/css" href="/mail.css" /> <link rel="stylesheet" type="text/css" href="/mail.css" />
<script type="text/javascript" src="/splitter.js"></script>
</head> </head>
<body> <body>
@ -30,6 +31,8 @@
<roundcube:object name="mailboxlist" type="select" noSelection="moveto" maxlength="25" onchange="rcmail.command('moveto', this.options[this.selectedIndex].value)" class="mboxlist" /> <roundcube:object name="mailboxlist" type="select" noSelection="moveto" maxlength="25" onchange="rcmail.command('moveto', this.options[this.selectedIndex].value)" class="mboxlist" />
</div> </div>
<div id="mainscreen">
<div id="mailboxlist-container"> <div id="mailboxlist-container">
<div id="mailboxlist-header"><roundcube:label name="mailboxlist" /></div> <div id="mailboxlist-header"><roundcube:label name="mailboxlist" /></div>
<roundcube:object name="mailboxlist" id="mailboxlist" maxlength="16" /> <roundcube:object name="mailboxlist" id="mailboxlist" maxlength="16" />
@ -45,5 +48,12 @@
</div> </div>
</div>
<script type="text/javascript">
var mailviewsplitv = new rcube_splitter({id:'mailviewsplitterv', p1: 'mailboxlist-container', p2: 'messageframe', orientation: 'v', relative: true, start: 165});
rcmail.add_onload('mailviewsplitv.init()');
</script>
</body> </body>
</html> </html>

Loading…
Cancel
Save