Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: elastic skin: allow to force reply all with html format clicking related menu item from button toolbar #7587

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions program/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,14 @@ function rcube_webmail()

this.set_button_titles();

this.env.message_commands = ['show', 'reply', 'reply-all', 'reply-list',
this.env.message_commands = ['show', 'reply', 'reply-all', 'reply-all-as-html', 'reply-list',
'move', 'copy', 'delete', 'open', 'mark', 'edit', 'viewsource', 'bounce',
'print', 'load-attachment', 'download-attachment', 'show-headers', 'hide-headers', 'download',
'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);
this.enable_command('reply-all-as-html', this.env.html_message);
this.enable_command('reply-list', this.env.list_post);

if (this.env.action == 'show') {
Expand Down Expand Up @@ -420,6 +421,7 @@ function rcube_webmail()
if (this.env.is_message) {
this.enable_command('reply', 'reply-all', 'edit', 'viewsource',
'forward', 'forward-inline', 'forward-attachment', 'bounce', true);
this.enable_command('reply-all-as-html', this.env.html_message);
if (this.env.list_post)
this.enable_command('reply-list', true);
}
Expand Down Expand Up @@ -1295,13 +1297,14 @@ function rcube_webmail()
break;

case 'reply-all':
case 'reply-all-as-html':
case 'reply-list':
case 'reply':
if (uid = this.get_single_uid()) {
url = {_reply_uid: uid, _mbox: this.get_message_mailbox(uid), _search: this.env.search_request};
if (command == 'reply-all')
if (command == 'reply-all' || command == 'reply-all-as-html')
// do reply-list, when list is detected and popup menu wasn't used
url._all = (!props && this.env.reply_all_mode == 1 && this.commands['reply-list'] ? 'list' : 'all');
url._all = (!props && this.env.reply_all_mode == 1 && this.commands['reply-list'] ? 'list' : (command = 'reply-all' ? 'all' : 'html'));
else if (command == 'reply-list')
url._all = 'list';

Expand Down Expand Up @@ -1953,10 +1956,11 @@ function rcube_webmail()
if (selected) {
// Hide certain command buttons when Drafts folder is selected
if (this.get_message_mailbox(selected) == this.env.drafts_mailbox)
this.enable_command('reply', 'reply-all', 'reply-list', 'forward', 'forward-attachment', 'forward-inline', false);
this.enable_command('reply', 'reply-all', 'reply-list', 'reply-all-as-html', 'forward', 'forward-attachment', 'forward-inline', false);
// Disable reply-list when List-Post header is not set
else {
var msg = this.env.messages[selected];
this.enable_command('reply-all-as-html', msg.ctype !== 'text/plain');
if (!msg.ml)
this.enable_command('reply-list', false);
}
Expand Down Expand Up @@ -9190,6 +9194,7 @@ function rcube_webmail()
this.enable_command(this.env.message_commands, true);
if (!this.env.list_post)
this.enable_command('reply-list', false);
this.enable_command('reply-all-as-html', this.env.html_message);
}
else if (this.task == 'addressbook') {
this.triggerEvent('listupdate', { list:this.contact_list, folder:this.env.source, rowcount:this.contact_list.rowcount });
Expand Down
1 change: 1 addition & 0 deletions program/localization/pl_PL/labels.inc
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ $labels['reply'] = 'Odpowiedz';
$labels['replytomessage'] = 'Odpowiedz nadawcy';
$labels['replytoallmessage'] = 'Odpowiedz wszystkim';
$labels['replyall'] = 'Odpowiedz wszystkim';
$labels['replyallashtml'] = 'Odpowiedz wszystkim w HTML';
$labels['replylist'] = 'Odpowiedz na listę';
$labels['forward'] = 'Przekaż';
$labels['forwardinline'] = 'Prześlij w treści';
Expand Down
2 changes: 1 addition & 1 deletion program/steps/mail/compose.inc
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ function rcmail_compose_editor_mode()
$useHtml = rcmail_message_is_html();
}
else if ($compose_mode == rcmail_sendmail::MODE_REPLY) {
$useHtml = $html_editor == 1 || ($html_editor >= 2 && rcmail_message_is_html());
$useHtml = $html_editor == 1 || $COMPOSE['param']['all'] == 'html' || ($html_editor >= 2 && rcmail_message_is_html());
}
else if ($compose_mode == rcmail_sendmail::MODE_FORWARD) {
$useHtml = $html_editor == 1 || $html_editor == 4
Expand Down
4 changes: 4 additions & 0 deletions program/steps/mail/show.inc
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ if ($uid) {
$OUTPUT->set_env('delimiter', $RCMAIL->storage->get_hierarchy_delimiter());
$OUTPUT->set_env('mimetypes', $CLIENT_MIMETYPES = rcmail_supported_mimetypes());


if ($MESSAGE->headers->get('list-post', false)) {
$OUTPUT->set_env('list_post', true);
}
Expand All @@ -97,6 +98,9 @@ if ($uid) {
if ($MESSAGE->has_html_part()) {
$prefer_html = $RCMAIL->config->get('prefer_html');
$OUTPUT->set_env('optional_format', $prefer_html ? 'text' : 'html');
$OUTPUT->set_env('html_message', true);
} else {
$OUTPUT->set_env('html_message', false);
}

if (!$OUTPUT->ajax_call) {
Expand Down
1 change: 1 addition & 0 deletions skins/elastic/templates/includes/mail-menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ <h3 id="aria-label-forward-menu" class="voice"><roundcube:label name="arialabelf
<h3 id="aria-label-replyall-menu" class="voice"><roundcube:label name="arialabelreplyalloptions" /></h3>
<ul class="menu listing" role="menu" aria-labelledby="aria-label-replyall-menu">
<roundcube:button type="link-menuitem" command="reply-all" label="replyall" prop="sub" class="reply all disabled" classAct="reply all active" />
<roundcube:button type="link-menuitem" command="reply-all-as-html" label="replyallashtml" prop="sub" class="reply html disabled" classAct="reply html active" />
<roundcube:button type="link-menuitem" command="reply-list" label="replylist" prop="sub" class="reply list disabled" classAct="reply list active" />
<roundcube:container name="replyallmenu" id="replyall-menu" />
</ul>
Expand Down