From 7dfa020e44b033bd15b9b90578379d721000e0d0 Mon Sep 17 00:00:00 2001 From: Josaphat Imani Date: Wed, 7 Feb 2024 18:35:39 +0200 Subject: [PATCH] Fixed move and copy buttons not working and others improvements on buttons --- modules/core/message_list_functions.php | 4 ++-- modules/core/output_modules.php | 2 +- modules/imap/functions.php | 18 +++++++++--------- modules/imap/output_modules.php | 6 +++--- modules/imap/site.css | 6 +++--- modules/imap/site.js | 8 ++++---- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/modules/core/message_list_functions.php b/modules/core/message_list_functions.php index cc12fad359..7d82670342 100644 --- a/modules/core/message_list_functions.php +++ b/modules/core/message_list_functions.php @@ -350,8 +350,8 @@ function icon_callback($vals, $style, $output_mod) { */ if (!hm_exists('message_controls')) { function message_controls($output_mod) { - $res = ''. - '
'. + $res = ''. + '
'. ''.$output_mod->trans('Read').''. ''.$output_mod->trans('Unread').''. ''.$output_mod->trans('Flag').''. diff --git a/modules/core/output_modules.php b/modules/core/output_modules.php index 4538ceb1db..a4c6352273 100644 --- a/modules/core/output_modules.php +++ b/modules/core/output_modules.php @@ -1833,7 +1833,7 @@ protected function output() { } $res = ''; $res .= '
'; - $res .= '
' . message_controls($this).'
'. + $res .= '
' . message_controls($this).'
'. implode('>', array_map( function($v) { return $this->trans($v); }, $this->get('mailbox_list_title', array()))).'
'; if (!$this->get('is_mobile') && substr((string) $this->get('list_path'), 0, 5) != 'imap_') { diff --git a/modules/imap/functions.php b/modules/imap/functions.php index c447bcd0bd..326189562f 100644 --- a/modules/imap/functions.php +++ b/modules/imap/functions.php @@ -118,7 +118,7 @@ function format_imap_folder_section($folders, $id, $output_mod) { $folder_name = bin2hex($folder_name); $results .= '
  • '; if ($folder['children']) { - $results .= '+'; + $results .= ''; } else { $results .= ' '; @@ -144,7 +144,7 @@ function format_imap_folder_section($folders, $id, $output_mod) { $results .= '
  • '; } if ($manage) { - $results .= '
  • '.$output_mod->trans('Manage Folders').''; + $results .= '
  • '.$output_mod->trans('Manage Folders').''; } $results .= ''; return $results; @@ -1386,21 +1386,21 @@ function snooze_formats() { function snooze_dropdown($output, $unsnooze = false) { $values = snooze_formats(); - $txt = '
    + $txt = ''; + $txt .= '
    '; return $txt; }} diff --git a/modules/imap/output_modules.php b/modules/imap/output_modules.php index 67557ea85d..7b1dbd241d 100644 --- a/modules/imap/output_modules.php +++ b/modules/imap/output_modules.php @@ -785,13 +785,13 @@ protected function output() { class Hm_Output_move_copy_controls extends Hm_Output_Module { protected function output() { if ($this->get('move_copy_controls', false)) { - $res = ' '.$this->trans('Copy').''; + $res = ' '; $this->concat('msg_controls_extra', $res); } } diff --git a/modules/imap/site.css b/modules/imap/site.css index 0ec1032ed5..93a65a54e7 100644 --- a/modules/imap/site.css +++ b/modules/imap/site.css @@ -23,7 +23,7 @@ .header_links { padding-top: 10px !important; } .overlay {position: fixed; height: 100%; width: 100%; z-index: 100; background-color: #ccc; opacity: .7; } .account_row { cursor: pointer; } -.expand_link { display: block; width: 16px; height: 16px; float: left; margin-right: 0px; margin-left: 0px; font-size: 16px; text-align: left; } +.expand_link { margin-right: 0px; margin-left: 0px; font-size: 16px; text-align: left; } .header_subject th { font-size: 1.3em; padding-top: 10px; } .header_subject th div img { margin-right: 10px; margin-left: 11px; } .msg_parts { table-layout: fixed; border-top: solid 1px #ddd; padding-top: 20px; padding-left: 20px; width: 100%; padding-bottom: 40px; } @@ -56,9 +56,9 @@ .jmap_section, .sent_setting, .imap_section { display: none; } .imap_server_setup .content_title { cursor: pointer; } .ctr_divider { padding-left: 5px; padding-right: 5px; color: #eee; vertical-align: 2px; font-weight: normal; font-size: 90%; } -.move_to_location { text-transform: none; z-index: 50; position: absolute; display: none; background-color: #fff; padding: 10px; border: solid 1px #ede8e6; font-weight: normal; padding-right: 25px; padding-left: 0px; font-size: 80%; top: 34px; min-width: 55px; right: 2px; border-top: none; padding-top: 0px; } +.move_to_location { top: 35px; } .move_to_location a { border: none; font-size: 100%; } -.move_to_title { padding: 5px; padding-top: 10px; padding-left: 10px; background-color: #fff; border-bottom: solid 1px #ede8e6; margin-right: -25px; } +.move_to_title { padding: 5px 10px; background-color: #fff; border-bottom: solid 1px #ede8e6; } .move_to_title span { float: right; font-size: 90%; } .msg_move_to .move_to_location { font-size: 100%; left: auto; right: 0px; top: 33px; font-variant: normal; } .msg_move_to { width: auto !important; position: relative; display: inline-block; } diff --git a/modules/imap/site.js b/modules/imap/site.js index 351b3029a3..45a08d519b 100644 --- a/modules/imap/site.js +++ b/modules/imap/site.js @@ -535,7 +535,7 @@ var expand_imap_folders = function(path) { var detail = Hm_Utils.parse_folder_path(path, 'imap'); var list = $('.imap_'+detail.server_id+'_'+Hm_Utils.clean_selector(detail.folder), $('.email_folders')); if ($('li', list).length === 0) { - $('.expand_link', list).html('-'); + $('.expand_link', list).html(''); if (detail) { Hm_Ajax.request( [{'name': 'hm_ajax_hook', 'value': 'ajax_imap_folder_expand'}, @@ -549,7 +549,7 @@ var expand_imap_folders = function(path) { } } else { - $('.expand_link', list).html('+'); + $('.expand_link', list).html(''); $('ul', list).remove(); Hm_Folders.save_folder_list(); } @@ -887,7 +887,7 @@ var unselect_non_imap_messages = function() { var imap_move_copy = function(e, action, context) { var move_to; - if (!e.target || e.target.className == 'imap_move') { + if (!e.target || e.target.classList.contains('imap_move')) { move_to = $('.msg_controls .move_to_location'); } else { @@ -907,7 +907,7 @@ var imap_move_copy = function(e, action, context) { else { label = $('.move_to_string2').val(); } - folders.prepend('
    '+label+'X
    '); + folders.prepend('
    '+label+'
    '); move_to.html(folders.html()); $('.imap_move_folder_link', move_to).on("click", function() { return expand_imap_move_to_folders($(this).data('target'), context); }); $('a', move_to).not('.imap_move_folder_link').not('.close_move_to').off('click');