diff options
author | alecpl <alec@alec.pl> | 2008-09-12 12:13:13 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2008-09-12 12:13:13 +0000 |
commit | e5686f4a011ea0110bf49ae1d56aa749c75ffc76 (patch) | |
tree | 899339efcde33e6839fcaa0910e44004716543fe | |
parent | 3e8bd7af5947761bf27d018fc02dab9840f7051f (diff) |
- 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
-rw-r--r-- | CHANGELOG | 6 | ||||
-rw-r--r-- | program/include/rcube_imap.php | 17 | ||||
-rwxr-xr-x | program/include/rcube_template.php | 4 | ||||
-rw-r--r-- | program/js/app.js | 58 | ||||
-rw-r--r-- | program/js/common.js | 26 | ||||
-rw-r--r-- | program/localization/en_GB/labels.inc | 2 | ||||
-rw-r--r-- | program/localization/en_US/labels.inc | 2 | ||||
-rw-r--r-- | program/steps/mail/func.inc | 10 | ||||
-rw-r--r-- | program/steps/mail/headers.inc | 39 | ||||
-rw-r--r-- | skins/default/addresses.css | 71 | ||||
-rw-r--r-- | skins/default/common.css | 8 | ||||
-rw-r--r-- | skins/default/images/icons/down_small.gif | bin | 0 -> 106 bytes | |||
-rw-r--r-- | skins/default/images/icons/up_small.gif | bin | 0 -> 106 bytes | |||
-rw-r--r-- | skins/default/mail.css | 127 | ||||
-rw-r--r-- | skins/default/splitter.js | 112 | ||||
-rw-r--r-- | skins/default/templates/addressbook.html | 15 | ||||
-rw-r--r-- | skins/default/templates/mail.html | 49 | ||||
-rw-r--r-- | skins/default/templates/message.html | 10 |
18 files changed, 415 insertions, 141 deletions
@@ -1,6 +1,12 @@ 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) ---------- - Refactor drag & drop functionality. Don't rely on browser events anymore (#1484453) diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php index 8a7ad2c9b..1b5ec1670 100644 --- a/program/include/rcube_imap.php +++ b/program/include/rcube_imap.php @@ -1371,6 +1371,23 @@ class rcube_imap 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; + } /** diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php index 9f94194c4..1b61770c0 100755 --- a/program/include/rcube_template.php +++ b/program/include/rcube_template.php @@ -320,9 +320,9 @@ class rcube_template extends rcube_html_page // add debug console 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> - <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); diff --git a/program/js/app.js b/program/js/app.js index 36072e384..b724287ef 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -159,7 +159,7 @@ function rcube_webmail() 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) { this.enable_command('nextmessage', true); @@ -510,7 +510,6 @@ function rcube_webmail() return false; } - // process command switch (command) { @@ -554,6 +553,11 @@ function rcube_webmail() break; + case 'load-headers': + this.load_headers(obj); + break; + + case 'sort': // get the type of sorting 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 *********/ @@ -3760,7 +3812,7 @@ function rcube_webmail() } if (request_obj.__lock) - this.set_busy(false); + this.set_busy(false); console.log(request_obj.get_text()); diff --git a/program/js/common.js b/program/js/common.js index 209ce1070..063657f89 100644 --- a/program/js/common.js +++ b/program/js/common.js @@ -253,23 +253,28 @@ function rcube_layer(id, attributes) var obj; obj = document.createElement('DIV'); + with(obj) { id = this.name; with(style) { - position = 'absolute'; + position = 'absolute'; visibility = (vis) ? (vis==2) ? 'inherit' : 'visible' : 'hidden'; left = l+'px'; top = t+'px'; - if(w) width = w+'px'; - if(h) height = h+'px'; + if (w) + width = w.toString().match(/\%$/) ? w : w+'px'; + if (h) + height = h.toString().match(/\%$/) ? h : h+'px'; if(z) zIndex = z; - } + } } - - if(parent) parent.appendChild(obj); - else document.body.appendChild(obj); + + if (parent) + parent.appendChild(obj); + else + document.body.appendChild(obj); this.elm = obj; }; @@ -496,7 +501,7 @@ function rcube_find_object(id, d) // 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') obj = rcube_find_object(obj); @@ -506,7 +511,7 @@ function rcube_get_object_pos(obj) var iX = (bw.layers) ? obj.x : obj.offsetLeft; var iY = (bw.layers) ? obj.y : obj.offsetTop; - if(bw.ie || bw.mz) + if(!relative && (bw.ie || bw.mz)) { var elm = obj.offsetParent; while(elm && elm!=null) @@ -598,8 +603,9 @@ function rcube_console() this.log = function(msg) { box = rcube_find_object('console'); + if (box) - if (msg[msg.length-1]=='\n') + if (msg.charAt(msg.length-1)=='\n') box.value += msg+'--------------------------------------\n'; else box.value += msg+'\n--------------------------------------\n'; diff --git a/program/localization/en_GB/labels.inc b/program/localization/en_GB/labels.inc index 75ffea521..82d06b090 100644 --- a/program/localization/en_GB/labels.inc +++ b/program/localization/en_GB/labels.inc @@ -128,7 +128,7 @@ $labels['quicksearch'] = 'Quick search'; $labels['resetsearch'] = 'Reset search'; $labels['compose'] = 'Compose a message'; $labels['savemessage'] = 'Save this draft'; -$labels['sendmessage'] = 'Send the message now'; +$labels['sendmessage'] = 'Send now'; $labels['addattachment'] = 'Attach a file'; $labels['charset'] = 'Charset'; $labels['editortype'] = 'Editor type'; diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc index 565cdc47a..6b503ff4c 100644 --- a/program/localization/en_US/labels.inc +++ b/program/localization/en_US/labels.inc @@ -164,7 +164,7 @@ $labels['resetsearch'] = 'Reset search'; // message compose $labels['compose'] = 'Compose a message'; $labels['savemessage'] = 'Save this draft'; -$labels['sendmessage'] = 'Send the message now'; +$labels['sendmessage'] = 'Send now'; $labels['addattachment'] = 'Attach a file'; $labels['charset'] = 'Charset'; $labels['editortype'] = 'Editor type'; diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 54abb24fe..7de78a1ef 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -740,7 +740,7 @@ function rcmail_message_headers($attrib, $headers=NULL) // show these headers $standard_headers = array('subject', 'from', 'organization', 'to', 'cc', 'bcc', 'replyto', 'date'); - + foreach ($standard_headers as $hkey) { if (!$headers[$hkey]) @@ -771,6 +771,14 @@ function rcmail_message_headers($attrib, $headers=NULL) $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"; return $header_count ? $out : ''; diff --git a/program/steps/mail/headers.inc b/program/steps/mail/headers.inc new file mode 100644 index 000000000..653fb9647 --- /dev/null +++ b/program/steps/mail/headers.inc @@ -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/', ' ', $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; + +?> diff --git a/skins/default/addresses.css b/skins/default/addresses.css index 8ae298781..051b0a099 100644 --- a/skins/default/addresses.css +++ b/skins/default/addresses.css @@ -1,6 +1,5 @@ /***** RoundCube|Mail address book task styles *****/ - #abooktoolbar { position: absolute; @@ -18,7 +17,7 @@ { position: absolute; bottom: 16px; - left: 185px; + left: 190px; width: 240px; height: 20px; text-align: left; @@ -30,38 +29,63 @@ color: #333333; } -#directorylist, #addresslist, #importbox +#mainscreen { position: absolute; top: 85px; + right: 20px; bottom: 40px; - border: 1px solid #999999; - background-color: #F9F9F9; - overflow: auto; + left: 200px; /* 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 { + position: absolute; + top: 85px; + bottom: 40px; left: 20px; width: 170px; + border: 1px solid #999999; + background-color: #F9F9F9; overflow: hidden; + /* css hack for IE */ + height: expression((parseInt(document.documentElement.clientHeight)-125)+'px'); } #addresslist { - left: 200px; - width: 340px; + position: absolute; + 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 { + position: absolute; + top: 85px; + bottom: 40px; left: 20px; - right: 40px; - height: auto; - bottom: auto; + right: 20px; + border: 1px solid #999999; + background-color: #F9F9F9; padding-bottom: 4ex; + overflow: auto; + /* css hack for IE */ + height: expression((parseInt(document.documentElement.clientHeight)-135)+'px'); +} + +#addresslist +{ + left: 0px; + width: 340px; } #importbox a @@ -129,30 +153,17 @@ #contacts-box { position: absolute; - top: 85px; + top: 0px; left: 555px; - right: 20px; - bottom: 40px; + right: 0px; + bottom: 0px; border: 1px solid #999999; overflow: hidden; /* css hack for IE */ - width: expression((parseInt(document.documentElement.clientWidth)-45-document.getElementById('addresslist').offsetLeft-document.getElementById('addresslist').offsetWidth)+'px'); - height: expression((parseInt(document.documentElement.clientHeight)-135)+'px'); + height: expression(parseInt(this.parentNode.offsetHeight)+'px'); + width: expression((parseInt(this.parentNode.offsetWidth)-555)+'px'); } - -#addressviewsplitter -{ - background-position: 4px center; -} - -#addressviewsplitter .splitterLine -{ - margin-left: 3px; - width: 6px; -} - - body.iframe, #contact-frame { diff --git a/skins/default/common.css b/skins/default/common.css index c9a641fa7..a5b73b002 100644 --- a/skins/default/common.css +++ b/skins/default/common.css @@ -194,6 +194,8 @@ a.button-logout right: 200px; z-index: 5000; opacity: 0.85; + /* IE */ + filter: alpha(opacity=85); } #message div @@ -237,8 +239,10 @@ a.button-logout .splitter { + user-select: none; + -moz-user-select: none; + -khtml-user-select: none; position: absolute; - padding: 2px; background: url(images/dimple.png) center no-repeat; } @@ -251,7 +255,7 @@ a.button-logout .splitter-v { cursor: e-resize; - background-position: 1px center; + background-position: 2px center; } .boxtitle diff --git a/skins/default/images/icons/down_small.gif b/skins/default/images/icons/down_small.gif Binary files differnew file mode 100644 index 000000000..f865893f4 --- /dev/null +++ b/skins/default/images/icons/down_small.gif diff --git a/skins/default/images/icons/up_small.gif b/skins/default/images/icons/up_small.gif Binary files differnew file mode 100644 index 000000000..40deb891f --- /dev/null +++ b/skins/default/images/icons/up_small.gif diff --git a/skins/default/mail.css b/skins/default/mail.css index 7807ca231..7f76ed85b 100644 --- a/skins/default/mail.css +++ b/skins/default/mail.css @@ -146,6 +146,30 @@ td.formlinks a:visited 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 { position: absolute; @@ -161,42 +185,37 @@ td.formlinks a:visited #mailcontframe { position: absolute; - top: 85px; - left: 200px; - right: 20px; - bottom: 40px; + width: 100%; + top: 0px; + bottom: 0px; border: 1px solid #999999; background-color: #F9F9F9; overflow: auto; /* css hack for IE */ - width: expression((parseInt(document.documentElement.clientWidth)-220)+'px'); - height: expression((parseInt(document.documentElement.clientHeight)-125)+'px'); + height: expression(parseInt(this.parentNode.offsetHeight)+'px'); } #mailpreviewframe { position: absolute; - top: 305px; - left: 200px; - right: 20px; - bottom: 40px; + width: 100%; + top: 205px; + bottom: 0px; border: 1px solid #999999; background-color: #F9F9F9; /* css hack for IE */ - width: expression((parseInt(document.documentElement.clientWidth)-220)+'px'); - height: expression((parseInt(document.documentElement.clientHeight)-135-document.getElementById('mailcontframe').offsetHeight)+'px'); + height: expression((parseInt(this.parentNode.offsetHeight)-205)+'px'); } #messagecontframe { - position: absolute; + position: relative; top: 0px; left: 0px; right: 0px; bottom: 0px; - /* css hack for IE */ - width: expression((parseInt(document.documentElement.clientWidth)-220)+'px'); - height: expression((parseInt(document.documentElement.clientHeight)-135-document.getElementById('mailcontframe').offsetHeight)+'px'); + width: 100%; + height: 100%; } #messagepartframe @@ -253,15 +272,15 @@ td.formlinks a:visited #mailboxlist-container { position: absolute; - top: 85px; - left: 20px; - width: 170px; - bottom: 40px; + top: 0px; + left: 0px; + width: 160px; + bottom: 0px; border: 1px solid #999; background-color: #F9F9F9; overflow: auto; /* css hack for IE */ - height: expression((parseInt(document.documentElement.clientHeight)-125)+'px'); + height: expression(parseInt(this.parentNode.offsetHeight)+'px'); } #mailboxlist @@ -599,15 +618,14 @@ html>body*#messagelist[id$="messagelist"]:not([class="none"]) { table-layout: au #messageframe { position: absolute; - top: 85px; - left: 200px; - right: 20px; - bottom: 40px; + top: 0px; + left: 0px; + right: 0px; + bottom: 0px; border: 1px solid #999; background-color: #FFF; overflow: auto; /* css hack for IE */ - /* margin-bottom: 10px; */ width: expression((parseInt(document.documentElement.clientWidth)-220)+'px'); height: expression((parseInt(document.documentElement.clientHeight)-125)+'px'); } @@ -641,7 +659,7 @@ table.headers-table tr td table.headers-table td.header-title { - width: 80px; + width: 85px; color: #666666; font-weight: bold; text-align: right; @@ -651,10 +669,20 @@ table.headers-table td.header-title table.headers-table tr td.subject { - width: 95%; + width: 90%; 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 { margin: 0px; @@ -949,3 +977,46 @@ div.message-htmlpart div.rcmBody { 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; +} diff --git a/skins/default/splitter.js b/skins/default/splitter.js index 31862ce84..4391ae9fe 100644 --- a/skins/default/splitter.js +++ b/skins/default/splitter.js @@ -11,40 +11,48 @@ function rcube_splitter(attrib) this.id = attrib.id ? attrib.id : this.p1id + '_' + this.p2id + '_splitter'; this.orientation = attrib.orientation; this.horizontal = (this.orientation == 'horizontal' || this.orientation == 'h'); - this.offset_1 = bw.ie ? 0 : -1; - this.offset_2 = bw.ie ? -2 : 1; - this.pos = 0; + this.offset = bw.ie6 ? 2 : 0; + this.pos = attrib.start ? attrib.start * 1 : 0; + this.relative = attrib.relative ? true : false; + this.drag_active = false; this.init = function() { this.p1 = document.getElementById(this.p1id); this.p2 = document.getElementById(this.p2id); - + // create and position the handle for this splitter - this.p1pos = rcube_get_object_pos(this.p1); - this.p2pos = rcube_get_object_pos(this.p2); - 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; + this.p1pos = rcube_get_object_pos(this.p1, this.relative); + this.p2pos = rcube_get_object_pos(this.p2, this.relative); 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 - 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.className = 'splitter '+(this.horizontal ? 'splitter-h' : 'splitter-v'); + this.elm.unselectable = 'on'; // add the mouse event listeners 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 var cookie = bw.get_cookie(this.id); if (cookie) { var param = cookie.split(':'); + for (var i=0, p; i<param.length; i++) { p = param[i].split('='); @@ -53,6 +61,11 @@ function rcube_splitter(attrib) this.resize(); } + else if (this.pos) + { + this.resize(); + this.set_cookie(); + } }; /** @@ -61,17 +74,22 @@ function rcube_splitter(attrib) */ 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'; - this.p2.style.top = Math.ceil(this.pos + (this.layer.height / 2 + this.offset_2)) + 'px'; - this.layer.move(this.layer.x, Math.round(this.pos - this.layer.height / 2 + 1)); + var lh = this.layer.height - this.offset * 2; + this.p1.style.height = Math.floor(this.pos - this.p1pos.y - lh / 2) + 'px'; + 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 { - this.p1.style.width = Math.floor(this.pos - this.p1pos.x - this.layer.width / 2 + this.offset_1) + 'px'; - this.p2.style.left = Math.ceil(this.pos + this.layer.width / 2 + this.offset_2) + '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) + 'px'; 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.p1pos = rcube_get_object_pos(this.p1); - this.p2pos = rcube_get_object_pos(this.p2); - + this.p1pos = rcube_get_object_pos(this.p1, this.relative); + this.p2pos = rcube_get_object_pos(this.p2, this.relative); + this.drag_active = true; + // start listening to mousemove events rcube_event.add_listener({element:document, event:'mousemove', object:this, method:'onDrag'}); rcube_event.add_listener({element:document, event:'mouseup', object:this, method:'onDragStop'}); @@ -106,6 +125,7 @@ function rcube_splitter(attrib) var s = this; 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); } + if (iframedoc.addEventListener) iframedoc.addEventListener('mousemove', this.iframe_events[n], false); else if (iframes[n].attachEvent) @@ -124,12 +144,22 @@ function rcube_splitter(attrib) this.onDrag = function(e) { var pos = rcube_event.get_mouse_pos(e); + + if (!this.drag_active) return false; + if (e._rc_pos_offset) { pos.x += e._rc_pos_offset.x; 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 (((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.p2pos = rcube_get_object_pos(this.p2); + this.p1pos = rcube_get_object_pos(this.p1, this.relative); + this.p2pos = rcube_get_object_pos(this.p2, this.relative); return false; }; @@ -160,6 +190,8 @@ function rcube_splitter(attrib) // 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'}); + this.drag_active = false; + var iframes = document.getElementsByTagName('IFRAME'); for (var n in iframes) @@ -176,39 +208,37 @@ function rcube_splitter(attrib) if (this.iframe_events[n]) { if (iframedoc.removeEventListener) iframedoc.removeEventListener('mousemove', this.iframe_events[n], false); - else if (iframedoc.detachEvent) + 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); - - // 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(); + this.set_cookie(); 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); + if (this.horizontal) + this.p2.style.height = (parseInt(this.p2.parentNode.offsetHeight) - parseInt(this.p2.style.top))+'px'; + else + this.p2.style.width = (parseInt(this.p2.parentNode.offsetWidth) - parseInt(this.p2.style.left))+'px'; }; + 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 diff --git a/skins/default/templates/addressbook.html b/skins/default/templates/addressbook.html index 3f8e460a5..df5f20a02 100644 --- a/skins/default/templates/addressbook.html +++ b/skins/default/templates/addressbook.html @@ -24,26 +24,31 @@ </div> <roundcube:if condition="config:ldap_public" /> + <div id="directorylist"> <div id="groups-title"><roundcube:label name="groups" /></div> <roundcube:object name="directorylist" id="directories-list" /> </div> <roundcube:else /> + <style type="text/css"> -#addresslist { left:20px; width:440px } -#contacts-box { left:475px } -#abookcountbar { left:20px } +#abookcountbar { left: 20px;} +#mainscreen { left:20px; /* IE hack */ width:expression((parseInt(document.documentElement.clientWidth)-40)+'px') } +#addresslist { width:245px } +#contacts-box { left:255px; /* IE hack */ width:expression((parseInt(mainscreen.offsetWidth)-255)+'px') } </style> <roundcube:endif /> +<div id="mainscreen"> + <div id="addresslist"> <roundcube:object name="addresslist" id="contacts-table" class="records-table" cellspacing="0" summary="Contacts list" /> </div> <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()'); </script> @@ -51,6 +56,8 @@ <roundcube:object name="addressframe" id="contact-frame" width="100%" height="100%" frameborder="0" src="/watermark.html" /> </div> +</div> + <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="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" /> diff --git a/skins/default/templates/mail.html b/skins/default/templates/mail.html index 7b6037b31..3d2068d91 100644 --- a/skins/default/templates/mail.html +++ b/skins/default/templates/mail.html @@ -47,17 +47,19 @@ body_keypress: function(evt, p) <roundcube:include file="/includes/taskbar.html" /> <roundcube:include file="/includes/header.html" /> +<div id="mainscreen"> + <div id="mailboxlist-container"> <h3 id="mailboxlist-header"><roundcube:label name="mailboxlist" /></h3> <roundcube:object name="mailboxlist" id="mailboxlist" maxlength="16" /> </div> -<div id="mailboxcontrols"> -<roundcube:label name="folder" />: -<roundcube:button command="expunge" label="compact" classAct="active" /> -<roundcube:button command="purge" label="empty" classAct="active" /> -</div> +<script type="text/javascript"> + var mailviewsplitv = new rcube_splitter({id:'mailviewsplitterv', p1: 'mailboxlist-container', p2: 'mailrightcontainer', orientation: 'v', relative: true, start: 165}); + rcmail.add_onload('mailviewsplitv.init()'); +</script> +<div id="mailrightcontainer"> <div id="mailcontframe"> <roundcube:object name="messages" @@ -74,22 +76,33 @@ body_keypress: function(evt, p) </div> <roundcube:if condition="config:preview_pane == true" /> + <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()'); </script> + <div id="mailpreviewframe"> <roundcube:object name="messagecontentframe" id="messagecontframe" width="100%" height="100%" frameborder="0" src="/watermark.html" /> </div> <style type="text/css"> -#mailcontframe { - bottom: auto; - height: 208px; -} +#mailcontframe { height: 195px; } </style> + <roundcube:endif /> +</div> + +</div> + +<div id="mailboxcontrols"> +<roundcube:label name="folder" />: +<roundcube:button command="expunge" label="compact" classAct="active" /> +<roundcube:button command="purge" label="empty" classAct="active" /> +</div> + + <div id="listcontrols"> <roundcube:label name="select" />: <roundcube:button command="select-all" label="all" classAct="active" /> @@ -100,6 +113,14 @@ body_keypress: function(evt, p) <roundcube:endif /> </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" /> + <roundcube:object name="messageCountDisplay" /> +<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"> <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" /> @@ -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" /> </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" /> - <roundcube:object name="messageCountDisplay" /> -<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"> var rcmailUI = new rcube_mail_ui(); diff --git a/skins/default/templates/message.html b/skins/default/templates/message.html index dc8dab7da..ccd23eb71 100644 --- a/skins/default/templates/message.html +++ b/skins/default/templates/message.html @@ -4,6 +4,7 @@ <title><roundcube:object name="pagetitle" /></title> <roundcube:include file="/includes/links.html" /> <link rel="stylesheet" type="text/css" href="/mail.css" /> +<script type="text/javascript" src="/splitter.js"></script> </head> <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" /> </div> +<div id="mainscreen"> + <div id="mailboxlist-container"> <div id="mailboxlist-header"><roundcube:label name="mailboxlist" /></div> <roundcube:object name="mailboxlist" id="mailboxlist" maxlength="16" /> @@ -45,5 +48,12 @@ </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> </html> |