From 969ff01ac8f1712540f4f05d116618b028c7af27 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 6 Jul 2012 10:10:30 +0200 Subject: There's a case (reason unknown) when destroy() is called with empty session key. Handle this case properly to prevent from PHP error: Memcache::delete(): Key cannot be empty. Conflicts: program/include/rcube_session.php --- program/include/rcube_session.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/program/include/rcube_session.php b/program/include/rcube_session.php index 4ac395472..6916e2ba8 100644 --- a/program/include/rcube_session.php +++ b/program/include/rcube_session.php @@ -221,13 +221,14 @@ class rcube_session * Handler for session_destroy() * * @param string Session ID + * * @return boolean True on success */ public function db_destroy($key) { - $this->db->query( - sprintf("DELETE FROM %s WHERE sess_id = ?", get_table_name('session')), - $key); + if ($key) { + $this->db->query(sprintf("DELETE FROM %s WHERE sess_id = ?", get_table_name('session')), $key); + } return true; } @@ -308,11 +309,16 @@ class rcube_session * Handler for session_destroy() with memcache backend * * @param string Session ID + * * @return boolean True on success */ public function mc_destroy($key) { - return $this->memcache->delete($key); + if ($key) { + $this->memcache->delete($key); + } + + return true; } -- cgit v1.2.3 From 8fdb332a20fec1988a6ec76fc83c3a4eb28ed1c8 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Fri, 6 Jul 2012 11:10:26 +0200 Subject: Fix connection error alerts when page unloads (#1488547) --- CHANGELOG | 1 + program/js/app.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 268baa7e9..e3b3949de 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Fix 'no connection' errors on page unloads (#1488547) - Plugin API: Add 'unauthenticated' hook (#1488138) - Show explicit error message when provided hostname is invalid (#1488550) - Fix wrong compose screen elements focus in IE9 (#1488541) diff --git a/program/js/app.js b/program/js/app.js index 8d02f6f39..ae9f4e972 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -60,6 +60,8 @@ function rcube_webmail() beforeSend: function(xmlhttp){ xmlhttp.setRequestHeader('X-Roundcube-Request', ref.env.request_token); } }); + $(window).bind('beforeunload', function() { rcmail.unload = true; }); + // set environment variable(s) this.set_env = function(p, value) { @@ -6129,6 +6131,10 @@ function rcube_webmail() this.set_busy(false, null, lock); request.abort(); + // don't display error message on page unload (#1488547) + if (this.unload) + return; + if (request.status && errmsg) this.display_message(this.get_label('servererror') + ' (' + errmsg + ')', 'error'); else if (status == 'timeout') -- cgit v1.2.3 From de485f883e25fcac75203264e336a3945db0d690 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Fri, 6 Jul 2012 11:34:35 +0200 Subject: Suppress error message popups on login screen --- skins/larry/ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skins/larry/ui.js b/skins/larry/ui.js index 7c66e01ae..6cc4d1d7e 100644 --- a/skins/larry/ui.js +++ b/skins/larry/ui.js @@ -265,7 +265,7 @@ function rcube_mail_ui() function message_displayed(p) { // show a popup dialog on errors - if (p.type == 'error') { + if (p.type == 'error' && rcmail.env.task != 'login') { if (!me.messagedialog) { me.messagedialog = $('
').addClass('popupdialog'); } -- cgit v1.2.3 From af32a2f5ece250427aa753b236e48784ffa07aba Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Fri, 6 Jul 2012 12:53:07 +0200 Subject: Improve iframe form buttons display: fix iframe heights and make footer buttons float if scrolling is active --- skins/larry/images/overflowshadow.png | Bin 0 -> 1163 bytes skins/larry/styles.css | 29 ++++++++++++++++++++++++----- skins/larry/templates/addressbook.html | 4 +++- skins/larry/templates/contactedit.html | 4 ++-- skins/larry/templates/folderedit.html | 2 -- skins/larry/templates/folders.html | 4 +++- skins/larry/templates/identities.html | 4 +++- skins/larry/templates/identityedit.html | 2 -- skins/larry/templates/settings.html | 6 ++++-- skins/larry/templates/settingsedit.html | 4 +--- skins/larry/ui.js | 15 +++++++++++++++ 11 files changed, 55 insertions(+), 19 deletions(-) create mode 100644 skins/larry/images/overflowshadow.png diff --git a/skins/larry/images/overflowshadow.png b/skins/larry/images/overflowshadow.png new file mode 100644 index 000000000..54dfdafce Binary files /dev/null and b/skins/larry/images/overflowshadow.png differ diff --git a/skins/larry/styles.css b/skins/larry/styles.css index e793fabbb..85372d5c8 100644 --- a/skins/larry/styles.css +++ b/skins/larry/styles.css @@ -1036,8 +1036,8 @@ body.iframe { margin: 38px 0 10px 0; } -body.iframe.footerbuttons { - margin-bottom: 42px; +body.iframe.floatingbuttons { + margin-bottom: 40px; } body.iframe.fullheight { @@ -1064,14 +1064,25 @@ body.iframe .boxtitle { z-index: 100; } -body.iframe .footerbuttons { +body.iframe .footerleft.floating { position: fixed; left: 0; bottom: 0; width: 100%; z-index: 110; background: #fff; - padding: 8px; + padding-top: 8px; + padding-bottom: 12px; +} + +body.iframe .footerleft.floating:before { + content: " "; + position: absolute; + top: -6px; + left: 0; + width: 100%; + height: 6px; + background: url(images/overflowshadow.png) top center no-repeat; } .boxcontent { @@ -1087,8 +1098,16 @@ body.iframe .footerbuttons { overflow: auto; } +.iframebox { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 28px; +} + .footerleft { - padding: 0 12px 10px 12px; + padding: 0 12px 4px 12px; } .propform fieldset { diff --git a/skins/larry/templates/addressbook.html b/skins/larry/templates/addressbook.html index b379609f5..ee92ff4dc 100644 --- a/skins/larry/templates/addressbook.html +++ b/skins/larry/templates/addressbook.html @@ -67,7 +67,9 @@
- +
+ +
diff --git a/skins/larry/templates/contactedit.html b/skins/larry/templates/contactedit.html index 39d48440b..2f0c1111b 100644 --- a/skins/larry/templates/contactedit.html +++ b/skins/larry/templates/contactedit.html @@ -4,7 +4,7 @@ <roundcube:object name="pagetitle" /> - +

@@ -35,7 +35,7 @@ -
+
diff --git a/skins/larry/templates/folderedit.html b/skins/larry/templates/folderedit.html index cfc8bc3d4..18d246942 100644 --- a/skins/larry/templates/folderedit.html +++ b/skins/larry/templates/folderedit.html @@ -12,14 +12,12 @@
-
" class="button" onclick="history.back()" /> 
-
diff --git a/skins/larry/templates/folders.html b/skins/larry/templates/folders.html index ab4e46ce1..988ff952c 100644 --- a/skins/larry/templates/folders.html +++ b/skins/larry/templates/folders.html @@ -28,7 +28,9 @@
- +
+ +
diff --git a/skins/larry/templates/identities.html b/skins/larry/templates/identities.html index 061088ea5..d9270b68a 100644 --- a/skins/larry/templates/identities.html +++ b/skins/larry/templates/identities.html @@ -25,7 +25,9 @@

- +
+ +
diff --git a/skins/larry/templates/identityedit.html b/skins/larry/templates/identityedit.html index 3ef41319a..8d5e62290 100644 --- a/skins/larry/templates/identityedit.html +++ b/skins/larry/templates/identityedit.html @@ -12,11 +12,9 @@ -
-
diff --git a/skins/larry/templates/settings.html b/skins/larry/templates/settings.html index 88b6b96b2..427e0a4f5 100644 --- a/skins/larry/templates/settings.html +++ b/skins/larry/templates/settings.html @@ -21,8 +21,10 @@
- - +
+ +
+
diff --git a/skins/larry/templates/settingsedit.html b/skins/larry/templates/settingsedit.html index ada5b57ee..1a80f58e9 100644 --- a/skins/larry/templates/settingsedit.html +++ b/skins/larry/templates/settingsedit.html @@ -12,10 +12,8 @@ -
- -
+
diff --git a/skins/larry/ui.js b/skins/larry/ui.js index 6cc4d1d7e..1022ee53e 100644 --- a/skins/larry/ui.js +++ b/skins/larry/ui.js @@ -220,6 +220,7 @@ function rcube_mail_ui() // don't use $(window).resize() due to some unwanted side-effects window.onresize = resize; + resize(); } /** @@ -257,6 +258,20 @@ function rcube_mail_ui() if (rcmail.env.task == 'mail' && rcmail.env.action == 'compose') { layout_composeview(); } + + // make iframe footer buttons float if scrolling is active + $('body.iframe .footerleft').each(function(){ + var footer = $(this), + body = $(document.body), + floating = footer.hasClass('floating'), + overflow = body.outerHeight(true) > $(window).height(); + if (overflow != floating) { + var action = overflow ? 'addClass' : 'removeClass'; + footer[action]('floating'); + body[action]('floatingbuttons'); + } + }) + } /** -- cgit v1.2.3 From 84dfbf541f66a552e9f2d21dbc717df493f0a3b2 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 9 Jul 2012 12:19:38 +0200 Subject: - Don't add attachments content into reply/forward/draft message body (#1488557) --- CHANGELOG | 1 + program/include/rcube_message.php | 26 ++++++++++++++++++++++++++ program/steps/mail/compose.inc | 3 ++- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index e3b3949de..f155a0c38 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Don't add attachments content into reply/forward/draft message body (#1488557) - Fix 'no connection' errors on page unloads (#1488547) - Plugin API: Add 'unauthenticated' hook (#1488138) - Show explicit error message when provided hostname is invalid (#1488550) diff --git a/program/include/rcube_message.php b/program/include/rcube_message.php index 8f1432fb8..745019e18 100644 --- a/program/include/rcube_message.php +++ b/program/include/rcube_message.php @@ -277,6 +277,32 @@ class rcube_message } + /** + * Checks if part of the message is an attachment (or part of it) + * + * @param rcube_message_part $part Message part + * + * @return bool True if the part is an attachment part + */ + public function is_attachment($part) + { + foreach ($this->attachments as $att_part) { + if ($att_part->mime_id == $part->mime_id) { + return true; + } + + // check if the part is a subpart of another attachment part (message/rfc822) + if ($att_part->mimetype == 'message/rfc822') { + if (in_array($part, (array)$att_part->parts)) { + return true; + } + } + } + + return false; + } + + /** * Read the message structure returend by the IMAP server * and build flat lists of content parts and attachments diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 8152f5dca..8a4715715 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -632,7 +632,8 @@ function rcmail_prepare_message_body() if (!empty($MESSAGE->parts)) { foreach ($MESSAGE->parts as $part) { - if ($part->type != 'content' || !$part->size) { + // skip no-content and attachment parts (#1488557) + if ($part->type != 'content' || !$part->size || $MESSAGE->is_attachment($part)) { continue; } -- cgit v1.2.3 From c4c9e8cdfce1c5734d9d75c79b9cec012bca57ad Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Wed, 11 Jul 2012 15:34:49 +0200 Subject: Put separated toolbars back together again; add min. width to mail view --- skins/larry/includes/mailtoolbar.html | 13 ++++--------- skins/larry/mail.css | 10 +++++++--- skins/larry/styles.css | 17 +++++++++++++++++ skins/larry/templates/compose.html | 5 ++++- skins/larry/templates/mail.html | 14 +++++++++----- skins/larry/templates/message.html | 16 ++++++++++------ 6 files changed, 51 insertions(+), 24 deletions(-) diff --git a/skins/larry/includes/mailtoolbar.html b/skins/larry/includes/mailtoolbar.html index fbc2e5e64..f750e061a 100644 --- a/skins/larry/includes/mailtoolbar.html +++ b/skins/larry/includes/mailtoolbar.html @@ -1,15 +1,11 @@ -
- - - - - + + - - + + @@ -20,7 +16,6 @@ -
    diff --git a/skins/larry/mail.css b/skins/larry/mail.css index 3804d80f4..28fcb0bb1 100644 --- a/skins/larry/mail.css +++ b/skins/larry/mail.css @@ -18,6 +18,7 @@ left: 0; width: 220px; bottom: 0; + z-index: 2; } #mailview-right { @@ -26,6 +27,7 @@ left: 232px; right: 0; bottom: 0; + z-index: 3; } #mailview-top { @@ -338,7 +340,6 @@ a.iconbutton.threadmode.selected { width: 100%; } -#mailboxtoolbar, #messagetoolbar { position: absolute; top: -6px; @@ -346,14 +347,17 @@ a.iconbutton.threadmode.selected { left: 0; height: 40px; white-space: nowrap; + z-index: 10; } #messagetoolbar.fullwidth { right: 0; } -#mailboxtoolbar { - right: 0; +#messagetoolbar .toolbarselect { + position: absolute; + bottom: 6px; + right: 3px; } #messagesearchtools { diff --git a/skins/larry/styles.css b/skins/larry/styles.css index 85372d5c8..341de9008 100644 --- a/skins/larry/styles.css +++ b/skins/larry/styles.css @@ -654,6 +654,15 @@ a.iconlink.upload { background: #fff; } +.minwidth { + position: absolute; + top: 0; + left: 0; + bottom: 0; + width: 100%; + min-width: 1150px; +} + .scroller { overflow: auto; } @@ -1328,6 +1337,13 @@ ul.proplist li { /*** toolbar ***/ +.toolbar .spacer { + display: inline-block; + width: 24px; + height: 40px; + padding: 0; +} + .toolbar a.button { text-align: center; font-size: 10px; @@ -1971,6 +1987,7 @@ ul.toolbarmenu li span.conversation { margin-bottom: 12px; padding-top: 15px; height: 27px; + white-space: nowrap; } .tabsbar .tablink { diff --git a/skins/larry/templates/compose.html b/skins/larry/templates/compose.html index a71e82043..de371b36a 100644 --- a/skins/larry/templates/compose.html +++ b/skins/larry/templates/compose.html @@ -7,8 +7,9 @@ - + +
    @@ -169,6 +170,8 @@
    +
    +
    diff --git a/skins/larry/templates/mail.html b/skins/larry/templates/mail.html index 404a8ad32..e8d89824d 100644 --- a/skins/larry/templates/mail.html +++ b/skins/larry/templates/mail.html @@ -11,20 +11,23 @@ - + +
    -
    - -
    +
    + +
    +
    +
    @@ -45,7 +48,6 @@
    -
    @@ -128,6 +130,8 @@
    +
    +
    • diff --git a/skins/larry/templates/message.html b/skins/larry/templates/message.html index 2509662fe..b66d82140 100644 --- a/skins/larry/templates/message.html +++ b/skins/larry/templates/message.html @@ -10,8 +10,17 @@
      + +
      + + + +
      + +
      +
      +
      -
      @@ -24,11 +33,6 @@
      - -
      - -
      -

      -- cgit v1.2.3