diff options
-rw-r--r-- | program/include/rcmail_output_html.php | 2 | ||||
-rw-r--r-- | program/js/app.js | 18 | ||||
-rw-r--r-- | program/lib/Roundcube/rcube_html2text.php | 7 |
3 files changed, 25 insertions, 2 deletions
diff --git a/program/include/rcmail_output_html.php b/program/include/rcmail_output_html.php index 05904e58b..88af550ed 100644 --- a/program/include/rcmail_output_html.php +++ b/program/include/rcmail_output_html.php @@ -380,7 +380,7 @@ class rcmail_output_html extends rcmail_output // unlock interface after iframe load $unlock = preg_replace('/[^a-z0-9]/i', '', $_REQUEST['_unlock']); if ($this->framed) { - array_unshift($this->js_commands, array('set_busy', false, null, $unlock)); + array_unshift($this->js_commands, array('iframe_loaded', $unlock)); } else if ($unlock) { array_unshift($this->js_commands, array('hide_message', $unlock)); diff --git a/program/js/app.js b/program/js/app.js index b9fe9f60f..13f1378f4 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -3113,6 +3113,13 @@ function rcube_webmail() form._draft.value = draft ? '1' : ''; form.action = this.add_url(form.action, '_unlock', msgid); form.action = this.add_url(form.action, '_lang', lang); + + // register timer to notify about connection timeout + this.submit_timer = setTimeout(function(){ + ref.set_busy(false, null, msgid); + ref.display_message(ref.get_label('requesttimedout'), 'error'); + }, this.env.request_timeout * 1000); + form.submit(); }; @@ -6339,7 +6346,7 @@ function rcube_webmail() // redirect to url specified in location header if not empty var location_url = request.getResponseHeader("Location"); - if (location_url) + if (location_url && this.env.action != 'compose') // don't redirect on compose screen, contents might get lost (#1488926) this.redirect(location_url); // re-send keep-alive requests after 30 seconds @@ -6347,6 +6354,15 @@ function rcube_webmail() setTimeout(function(){ ref.keep_alive(); ref.start_keepalive(); }, 30000); }; + // callback when an iframe finished loading + this.iframe_loaded = function(unlock) + { + this.set_busy(false, null, unlock); + + if (this.submit_timer) + clearTimeout(this.submit_timer); + }; + // post the given form to a hidden iframe this.async_upload_form = function(form, action, onload) { diff --git a/program/lib/Roundcube/rcube_html2text.php b/program/lib/Roundcube/rcube_html2text.php index 3d32fe766..9b248a3a8 100644 --- a/program/lib/Roundcube/rcube_html2text.php +++ b/program/lib/Roundcube/rcube_html2text.php @@ -597,9 +597,16 @@ class rcube_html2text // get blockquote content $body = trim(substr($text, $startpos, $end - $startpos)); + // adjust text wrapping width + $p_width = $this->width; + if ($this->width > 0) $this->width -= 2; + // replace content with inner blockquotes $this->_converter($body); + // resore text width + $this->width = $p_width; + // Add citation markers and create <pre> block $body = preg_replace_callback('/((?:^|\n)>*)([^\n]*)/', array($this, 'blockquote_citation_ballback'), trim($body)); $body = '<pre>' . htmlspecialchars($body) . '</pre>'; |