summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-03-15 10:30:53 +0100
committerAleksander Machniak <alec@alec.pl>2013-03-15 10:30:53 +0100
commita02c77c584906f629d382409e76f0df4d2cfaf01 (patch)
treead7fdd393e02b4be1dc2d49db3cfe59614b97049 /program/js
parent0ef894ec2949100aee8624701edbf38087ea9047 (diff)
Add ability to toggle between view as HTML and text while viewing a message (#1486939)
Diffstat (limited to 'program/js')
-rw-r--r--program/js/app.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 637d6f5d8..d3c319ecd 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -229,7 +229,7 @@ function rcube_webmail()
this.env.message_commands = ['show', 'reply', 'reply-all', 'reply-list',
'moveto', 'copy', 'delete', 'open', 'mark', 'edit', 'viewsource',
'print', 'load-attachment', 'download-attachment', 'show-headers', 'hide-headers', 'download',
- 'forward', 'forward-inline', 'forward-attachment'];
+ 'forward', 'forward-inline', 'forward-attachment', 'change-format'];
if (this.env.action == 'show' || this.env.action == 'preview') {
this.enable_command(this.env.message_commands, this.env.uid);
@@ -608,6 +608,17 @@ function rcube_webmail()
}
break;
+ case 'change-format':
+ url = this.env.permaurl + '&_format=' + props;
+
+ if (this.env.action == 'preview')
+ url = url.replace(/_action=show/, '_action=preview') + '&_framed=1';
+ if (this.env.extwin)
+ url += '&_extwin=1';
+
+ location.href = url;
+ break;
+
case 'menu-open':
if (props && props.menu == 'attachmentmenu') {
var mimetype = this.env.attachments[props.id];