diff options
author | Aleksander Machniak <alec@alec.pl> | 2014-05-30 10:53:19 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2014-05-30 10:53:19 +0200 |
commit | b408e0bc532e6023248c6671c5cef52d1c06f3f3 (patch) | |
tree | 70f578f0e0850d8cc2e91d3371dfd2a01b12e580 /program | |
parent | 37dfc4bc0572a598e99ce0fa646648b22bf62415 (diff) |
Display a warning if popup window was blocked (#1489618)
Diffstat (limited to 'program')
-rw-r--r-- | program/include/rcmail.php | 3 | ||||
-rw-r--r-- | program/js/app.js | 10 | ||||
-rw-r--r-- | program/localization/en_US/messages.inc | 1 |
3 files changed, 10 insertions, 4 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php index 9639422ed..a6ba18312 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -428,7 +428,8 @@ class rcmail extends rcube } // add some basic labels to client - $this->output->add_label('loading', 'servererror', 'connerror', 'requesttimedout', 'refreshing'); + $this->output->add_label('loading', 'servererror', 'connerror', 'requesttimedout', + 'refreshing', 'windowopenerror'); return $this->output; } diff --git a/program/js/app.js b/program/js/app.js index 914bb0278..cd0737e6d 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -685,9 +685,6 @@ function rcube_webmail() form.target = win.name; form.submit(); } - else { - // this.display_message(this.get_label('windowopenerror'), 'error'); - } } else { this.open_window(this.env.permaurl, true); @@ -1780,6 +1777,13 @@ function rcube_webmail() +(toolbar ? ',toolbar=yes,menubar=yes,status=yes' : ',toolbar=no,menubar=no,status=no')); } + // detect popup blocker (#1489618) + // don't care this might not work with all browsers + if (!extwin || extwin.closed) { + this.display_message(this.get_label('windowopenerror'), 'warning'); + return; + } + // write loading... message to empty windows if (!url && extwin.document) { extwin.document.write('<html><body>' + this.get_label('loading') + '</body></html>'); diff --git a/program/localization/en_US/messages.inc b/program/localization/en_US/messages.inc index 0d0a6916c..d4fbd6148 100644 --- a/program/localization/en_US/messages.inc +++ b/program/localization/en_US/messages.inc @@ -26,6 +26,7 @@ $messages['servererror'] = 'Server Error!'; $messages['servererrormsg'] = 'Server Error: $msg'; $messages['connerror'] = 'Connection Error (Failed to reach the server)!'; $messages['dberror'] = 'Database Error!'; +$messages['windowopenerror'] = 'The popup window was blocked!'; $messages['requesttimedout'] = 'Request timed out'; $messages['errorreadonly'] = 'Unable to perform operation. Folder is read-only.'; $messages['errornoperm'] = 'Unable to perform operation. Permission denied.'; |