Skip to content

Commit

Permalink
Merge pull request #1232 from josaphatim/fixed-some-elements-ui
Browse files Browse the repository at this point in the history
Removed some styling not necessary after bootstrap 5 integration that break themes
  • Loading branch information
marclaporte authored and josaphatim committed Sep 11, 2024
2 parents a5f8215 + 9cd7ec8 commit ad3afe4
Show file tree
Hide file tree
Showing 31 changed files with 102 additions and 38 deletions.
2 changes: 2 additions & 0 deletions language/az.php
Original file line number Diff line number Diff line change
Expand Up @@ -636,4 +636,6 @@
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
'Please pick a valid date/time' => false,
'Snoozing messages...' => false,
);
2 changes: 2 additions & 0 deletions language/de.php
Original file line number Diff line number Diff line change
Expand Up @@ -633,4 +633,6 @@
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
'Please pick a valid date/time' => false,
'Snoozing messages...' => false,
);
2 changes: 2 additions & 0 deletions language/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -651,4 +651,6 @@
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
'Please pick a valid date/time' => false,
'Snoozing messages...' => false,
);
2 changes: 2 additions & 0 deletions language/es.php
Original file line number Diff line number Diff line change
Expand Up @@ -633,4 +633,6 @@
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
'Please pick a valid date/time' => false,
'Snoozing messages...' => false,
);
2 changes: 2 additions & 0 deletions language/et.php
Original file line number Diff line number Diff line change
Expand Up @@ -641,4 +641,6 @@
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
'Please pick a valid date/time' => false,
'Snoozing messages...' => false,
);
2 changes: 2 additions & 0 deletions language/fa.php
Original file line number Diff line number Diff line change
Expand Up @@ -685,4 +685,6 @@
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
'Please pick a valid date/time' => false,
'Snoozing messages...' => false,
);
2 changes: 2 additions & 0 deletions language/fr.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,4 +632,6 @@
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
'Please pick a valid date/time' => false,
'Snoozing messages...' => false,
);
2 changes: 2 additions & 0 deletions language/hu.php
Original file line number Diff line number Diff line change
Expand Up @@ -633,4 +633,6 @@
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
'Please pick a valid date/time' => false,
'Snoozing messages...' => false,
);
2 changes: 2 additions & 0 deletions language/id.php
Original file line number Diff line number Diff line change
Expand Up @@ -640,4 +640,6 @@
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
'Please pick a valid date/time' => false,
'Snoozing messages...' => false,
);
2 changes: 2 additions & 0 deletions language/it.php
Original file line number Diff line number Diff line change
Expand Up @@ -633,4 +633,6 @@
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
'Please pick a valid date/time' => false,
'Snoozing messages...' => false,
);
2 changes: 2 additions & 0 deletions language/ja.php
Original file line number Diff line number Diff line change
Expand Up @@ -633,4 +633,6 @@
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
'Please pick a valid date/time' => false,
'Snoozing messages...' => false,
);
2 changes: 2 additions & 0 deletions language/nl.php
Original file line number Diff line number Diff line change
Expand Up @@ -633,4 +633,6 @@
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
'Please pick a valid date/time' => false,
'Snoozing messages...' => false,
);
2 changes: 2 additions & 0 deletions language/pt-BR.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,4 +632,6 @@
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
'Please pick a valid date/time' => false,
'Snoozing messages...' => false,
);
2 changes: 2 additions & 0 deletions language/ro.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,4 +632,6 @@
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
'Please pick a valid date/time' => false,
'Snoozing messages...' => false,
);
2 changes: 2 additions & 0 deletions language/ru.php
Original file line number Diff line number Diff line change
Expand Up @@ -634,4 +634,6 @@
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
'Please pick a valid date/time' => false,
'Snoozing messages...' => false,
);
2 changes: 2 additions & 0 deletions language/zh-Hans.php
Original file line number Diff line number Diff line change
Expand Up @@ -654,4 +654,6 @@
'Server capabilities' => false,
'Capabilities' => false,
'Screen %s first emails' => false,
'Please pick a valid date/time' => false,
'Snoozing messages...' => false,
);
2 changes: 2 additions & 0 deletions language/zh-TW.php
Original file line number Diff line number Diff line change
Expand Up @@ -650,4 +650,6 @@
'No tags available yet.' => '尚無可用標籤。',
'Server capabilities' => '伺服器功能',
'Capabilities' => '功能',
'Please pick a valid date/time' => false,
'Snoozing messages...' => false,
);
2 changes: 2 additions & 0 deletions modules/core/output_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ class Hm_Output_header_css extends Hm_Output_Module {
protected function output() {
$res = '';
$mods = $this->get('router_module_list');
$res .= '<link href="' . WEB_ROOT . 'third_party/flatpickr.min.css?v=' . CACHE_ID . '" media="all" rel="stylesheet" type="text/css" />';
if (! $this->get('theme')) {
$res .= '<link href="' . WEB_ROOT . 'modules/themes/assets/default/css/default.css?v=' . CACHE_ID . '" media="all" rel="stylesheet" type="text/css" />';
}
Expand Down Expand Up @@ -543,6 +544,7 @@ protected function output() {
$res = '';
$js_lib = '<script type="text/javascript" src="'.WEB_ROOT.'vendor/twbs/bootstrap/dist/js/bootstrap.bundle.min.js"></script>';
$js_lib .= '<script type="text/javascript" src="'.WEB_ROOT.'third_party/cash.min.js"></script>';
$js_lib .= '<script type="text/javascript" src="'.WEB_ROOT.'third_party/flatpickr.min.js"></script>';
$js_lib .= '<script type="text/javascript" src="'.WEB_ROOT.'third_party/resumable.min.js"></script>';
$js_lib .= '<script type="text/javascript" src="'.WEB_ROOT.'third_party/ays-beforeunload-shim.js"></script>';
$js_lib .= '<script type="text/javascript" src="'.WEB_ROOT.'third_party/jquery.are-you-sure.js"></script>';
Expand Down
10 changes: 9 additions & 1 deletion modules/core/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ button {
.inner_list li {
padding: 4px;
padding-left: 10px;
color: #555;
padding-bottom: 0px;
margin: 2px;
white-space: nowrap;
Expand Down Expand Up @@ -1366,3 +1365,12 @@ div.unseen,
.mobile .credentials-container .form-floating {
margin-bottom: 7px;
}
.centered-calendar {
position: fixed;
top: 50% !important;
left: 50% !important;
transform: translate(-50%, -50%);
z-index: 1000 !important; /* Ensure it appears above other content */
background: white;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}
2 changes: 2 additions & 0 deletions modules/core/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -718,10 +718,12 @@ function Message_List() {
if ($('input[type=checkbox]', $('.message_table')).filter(function() {return this.checked; }).length > 0) {
$('.msg_controls').addClass('d-flex');
$('.msg_controls').removeClass('d-none');
$('.mailbox_list_title').addClass('hide');
}
else {
$('.msg_controls').removeClass('d-flex');
$('.msg_controls').addClass('d-none');
$('.mailbox_list_title').removeClass('hide');
}
};

Expand Down
6 changes: 3 additions & 3 deletions modules/imap/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1449,15 +1449,15 @@ function snooze_dropdown($output, $unsnooze = false) {
$values = snooze_formats();

$txt = '<div class="dropdown d-inline-block">
<button type="button" class="btn btn-outline-success btn-sm dropdown-toggle" id="dropdownMenuSnooze" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="true">'.$output->trans('Snooze').'</button>
<button type="button" class="btn btn-outline-success btn-sm dropdown-toggle" id="dropdownMenuSnooze" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="true" data-bs-auto-close="outside">'.$output->trans('Snooze').'</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuSnooze">';
foreach ($values as $format) {
$labels = get_snooze_date($format, true);
$txt .= '<li><a href="#" class="snooze_helper dropdown-item d-flex justify-content-between gap-5" data-value="'.$format.'"><span>'.$output->trans($labels[0]).'</span> <span class="text-end">'.$labels[1].'</span></a></li>';
}
$txt .= '<li><hr class="dropdown-divider"></li>';
$txt .= '<li><label for="snooze_input_date" class="snooze_date_picker dropdown-item cursor-pointer">'.$output->trans('Pick a date').'</label>';
$txt .= '<input id="snooze_input_date" type="datetime-local" min="'.date('Y-m-d\Th:m').'" class="snooze_input_date" style="visibility: hidden; position: absolute; height: 0;">';
$txt .= '<li><span class="snooze_date_picker dropdown-item cursor-pointer">'.$output->trans('Pick a date').'</span>';
$txt .= '<input id="snooze_input_date" type="text" class="snooze_input_date d-none">';
$txt .= '<input class="snooze_input" style="display:none;"></li>';
if ($unsnooze) {
$txt .= '<a href="#" data-value="unsnooze" class="unsnooze snooze_helper dropdown-item"">'.$output->trans('Unsnooze').'</a>';
Expand Down
38 changes: 21 additions & 17 deletions modules/imap/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -1135,28 +1135,31 @@ var imap_setup_tags = function() {
}

var imap_setup_snooze = function() {
flatpickr('.snooze_input_date', {
enableTime: true,
dateFormat: 'Y-m-d H:i',
time_24hr: true,
minDate: 'today',
appendTo: document.body,
onOpen: function(selectedDates, dateStr, instance) {
instance.calendarContainer.classList.add('centered-calendar');
},
onClose: function(selectedDates, dateStr, instance) {
if (dateStr && new Date().getTime() < new Date(dateStr).getTime()) {
$('.snooze_input').val(dateStr).trigger('change');
} else {
Hm_Utils.add_sys_message(hm_trans('Please pick a valid date/time'));
}
}
});
$(document).on('click', '.snooze_date_picker', function(e) {
document.querySelector('.snooze_input_date').showPicker();
$('.snooze_input_date').trigger('click');
$(this).closest('.dropdown-menu').removeClass('show');
});
$(document).on('click', '.snooze_helper', function(e) {
e.preventDefault();
$('.snooze_input').val($(this).attr('data-value')).trigger('change');
});
$(document).on('input', '.snooze_input_date', function(e) {
var now = new Date();
now.setMinutes(now.getMinutes() + 1);
$(this).attr('min', now.toJSON().slice(0, 16));
if (new Date($(this).val()).getTime() <= now.getTime()) {
$('.snooze_date_picker').css('border', '1px solid red');
} else {
$('.snooze_date_picker').css({'border': 'unset', 'border-top': '1px solid #ddd'});
}
});
$(document).on('change', '.snooze_input_date', function(e) {
if ($(this).val() && new Date().getTime() < new Date($(this).val()).getTime()) {
$('.snooze_input').val($(this).val()).trigger('change');
}
});
$(document).on('change', '.snooze_input', function(e) {
$('.snooze_dropdown').hide();
var ids = [];
Expand All @@ -1174,6 +1177,7 @@ var imap_setup_snooze = function() {
return;
};
}
Hm_Utils.add_sys_message(hm_trans('Snoozing messages...'));
Hm_Ajax.request(
[{'name': 'hm_ajax_hook', 'value': 'ajax_imap_snooze'},
{'name': 'imap_snooze_ids', 'value': ids},
Expand Down Expand Up @@ -1257,7 +1261,7 @@ $(function() {

if ($('.imap_move').length > 0) {
check_select_for_imap();
$('.toggle_link').on("click", function() { $('.mailbox_list_title').toggleClass('hide'); setTimeout(search_selected_for_imap, 100); });
$('.toggle_link').on("click", function() { setTimeout(search_selected_for_imap, 100); });
Hm_Ajax.add_callback_hook('ajax_imap_folder_display', check_select_for_imap);
Hm_Message_List.callbacks.push(check_select_for_imap);
$('.imap_move').on("click", function() { return false; });
Expand Down
2 changes: 1 addition & 1 deletion modules/imap_folders/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/* .sp_description { padding-bottom: 20px; } */
#draft_val, #sent_val, #trash_val, #junk_val { padding-left: 20px; }
.manage_folder_icon { vertical-align: -3px; opacity: .3 }
.manage_folder_link { color: #999 !important; }
.manage_folder_link { opacity: 0.6; }

.folder_subscription_btn { position: absolute; right: 20px; top: 20px; }
.folders_subscription { padding-left: 10px; width: 100%; display: inline-block; }
Expand Down
12 changes: 6 additions & 6 deletions modules/sievefilters/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ function get_classic_filter_modal_content()
<h5 class="mt-0">Conditions</h5>
</div>
<div class="flex-grow-1 text-end">
<button class="sieve_add_condition_modal_button btn btn-sm border bg-white">Add Condition</button>
<button class="sieve_add_condition_modal_button btn btn-sm border btn-primary">Add Condition</button>
</div>
</div>
<div class="d-block mt-3">
<table class="sieve_list_conditions_modal">
<div class="d-block mt-3 table-responsive">
<table class="sieve_list_conditions_modal table">
</table>
</div>
</div>
Expand All @@ -79,11 +79,11 @@ function get_classic_filter_modal_content()
<h5 class="mt-0">Actions</h5>
</div>
<div class="flex-grow-1 text-end">
<button class="filter_modal_add_action_btn btn btn-sm border bg-white">Add Action</button>
<button class="filter_modal_add_action_btn btn btn-sm border btn-primary">Add Action</button>
</div>
</div>
<div class="d-block mt-3">
<table class="filter_actions_modal_table">
<div class="d-block mt-3 table-responsive">
<table class="filter_actions_modal_table table">
</table>
</div>
</div>
Expand Down
3 changes: 0 additions & 3 deletions modules/sievefilters/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@
margin: 0;
padding: 0;
width: 100%;
table-layout: fixed;
}


Expand All @@ -277,7 +276,6 @@ table.sieve_list_conditions_modal caption {
}

table.sieve_list_conditions_modal tr {
background-color: #f8f8f8;
border: 1px solid #ddd;
padding: .35em;
}
Expand Down Expand Up @@ -332,7 +330,6 @@ table.filter_actions_modal_table caption {
}

table.filter_actions_modal_table tr {
background-color: #f8f8f8;
border: 1px solid #ddd;
padding: .35em;
}
Expand Down
4 changes: 2 additions & 2 deletions modules/sievefilters/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ $(function () {
' <input type="text" name="sieve_selected_option_value[]" class="form-control form-control-sm" />' +
' </td>' +
' <td class="col-sm-1 text-end align-middle">' +
' <a href="#" class="delete_condition_modal_button">Delete</a>' +
' <a href="#" class="delete_condition_modal_button btn btn-sm btn-secondary">Delete</a>' +
' </td>' +
' </tr>'
);
Expand Down Expand Up @@ -686,7 +686,7 @@ $(function () {
' <input type="hidden" name="sieve_selected_action_value[]" value="">' +
' </input>' +
' <td class="col-sm-1 text-end align-middle">' +
' <a href="#" class="delete_action_modal_button">Delete</a>' +
' <a href="#" class="delete_action_modal_button btn btn-sm btn-secondary">Delete</a>' +
' </td>' +
'</tr>'
);
Expand Down
1 change: 1 addition & 0 deletions scripts/config_gen.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ function combine_includes($js, $js_compress, $css, $css_compress, $settings) {
$mods = get_modules($settings);
$js_lib = file_get_contents(VENDOR_PATH . "twbs/bootstrap/dist/js/bootstrap.bundle.min.js");
$js_lib .= file_get_contents("third_party/cash.min.js");
$js_lib .= file_get_contents("third_party/flatpickr.min.js");
if (in_array('desktop_notifications', $mods, true)) {
$js_lib .= file_get_contents("third_party/push.min.js");
}
Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/modules/core/output_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ public function test_header_content() {
public function test_header_css() {
$test = new Output_Test('header_css', 'core');
$res = $test->run();
$this->assertEquals(array('<link href="modules/themes/assets/default/css/default.css?v=asdf" media="all" rel="stylesheet" type="text/css" /><link href="site.css?v=asdf" media="all" rel="stylesheet" type="text/css" /><style type="text/css">@font-face {font-family:"Behdad";src:url("modules/core/assets/fonts/Behdad/Behdad-Regular.woff2") format("woff2"),url("modules/core/assets/fonts/Behdad/Behdad-Regular.woff") format("woff");</style>'), $res->output_response);
$this->assertEquals(array('<link href="third_party/flatpickr.min.css?v=asdf" media="all" rel="stylesheet" type="text/css" /><link href="modules/themes/assets/default/css/default.css?v=asdf" media="all" rel="stylesheet" type="text/css" /><link href="site.css?v=asdf" media="all" rel="stylesheet" type="text/css" /><style type="text/css">@font-face {font-family:"Behdad";src:url("modules/core/assets/fonts/Behdad/Behdad-Regular.woff2") format("woff2"),url("modules/core/assets/fonts/Behdad/Behdad-Regular.woff") format("woff");</style>'), $res->output_response);
}
/**
* @preserveGlobalState disabled
Expand All @@ -406,7 +406,7 @@ public function test_header_css_integrity() {
$test = new Output_Test('header_css', 'core');
$test->handler_response = array('router_module_list', array('core'));
$res = $test->run();
$this->assertEquals(array('<link href="modules/themes/assets/default/css/default.css?v=asdf" media="all" rel="stylesheet" type="text/css" /><link href="site.css?v=asdf" integrity="foo" media="all" rel="stylesheet" type="text/css" /><style type="text/css">@font-face {font-family:"Behdad";src:url("modules/core/assets/fonts/Behdad/Behdad-Regular.woff2") format("woff2"),url("modules/core/assets/fonts/Behdad/Behdad-Regular.woff") format("woff");</style>'), $res->output_response);
$this->assertEquals(array('<link href="third_party/flatpickr.min.css?v=asdf" media="all" rel="stylesheet" type="text/css" /><link href="modules/themes/assets/default/css/default.css?v=asdf" media="all" rel="stylesheet" type="text/css" /><link href="site.css?v=asdf" integrity="foo" media="all" rel="stylesheet" type="text/css" /><style type="text/css">@font-face {font-family:"Behdad";src:url("modules/core/assets/fonts/Behdad/Behdad-Regular.woff2") format("woff2"),url("modules/core/assets/fonts/Behdad/Behdad-Regular.woff") format("woff");</style>'), $res->output_response);
}
/**
* @preserveGlobalState disabled
Expand Down
Loading

0 comments on commit ad3afe4

Please sign in to comment.