diff --git a/modules/desktop_notifications/site.js b/modules/desktop_notifications/site.js
index c10203118..095f3eafd 100644
--- a/modules/desktop_notifications/site.js
+++ b/modules/desktop_notifications/site.js
@@ -27,6 +27,7 @@ $(function() {
setInterval(() => {
// undefined_undefined: load with no filter and no keyword
new Hm_MessagesStore('unread', getParam('list_page') || 1, 'undefined_undefined').load(true, true).then((store) => {
+
store.newMessages.forEach((messageRow) => {
triggerNewMessageEvent($(messageRow).data('uid'), $(messageRow)[0]);
});
diff --git a/modules/imap/site.js b/modules/imap/site.js
index 628e4c24f..6dfb65e54 100644
--- a/modules/imap/site.js
+++ b/modules/imap/site.js
@@ -480,7 +480,7 @@ var setup_imap_folder_page = async function(listPath, listPage = 1) {
e.preventDefault();
$('#imap_filter_form').trigger('submit');
});
-
+
// try to fetch from cache but also reload messages, so user don't wait 60 seconds to see the new list (useful for read/unread UI and other updates)
await select_imap_folder(listPath, listPage, true);
handleMessagesDragAndDrop();
diff --git a/modules/sievefilters/functions.php b/modules/sievefilters/functions.php
index 8d45ed881..406b06c82 100644
--- a/modules/sievefilters/functions.php
+++ b/modules/sievefilters/functions.php
@@ -34,57 +34,44 @@ function get_script_modal_content()
function get_classic_filter_modal_content()
{
return '
-
-
General
- Input a name and order for your filter. In filters, the order of execution is important. You can define an order value (or priority value) for your filter. Filters will run from lowest to highest priority value.
-
-
+
+ Input the name for your filter.
-
+
-
-
-
-
-
-
-
Conditions & Actions
- Filters must have at least one action and one condition
+ In filters, the order of execution is important. Filters will run from lowest to highest priority value.
-
Conditions
-
-
-
+
Conditions
-
+
+
+
+
-
Actions
-
-
-
+
Actions
-
+
+
+
+
@@ -97,10 +84,14 @@ function get_classic_filter_modal_content()
+
+ Filters must have at least one action and one condition.
+
';
}
}
+
if (!hm_exists('get_mailbox_filters')) {
function get_mailbox_filters($mailbox, $site_config, $user_config)
{
diff --git a/modules/sievefilters/site.css b/modules/sievefilters/site.css
index 124080c0b..bfa5b739f 100644
--- a/modules/sievefilters/site.css
+++ b/modules/sievefilters/site.css
@@ -1,3 +1,9 @@
+.sortable-ghost {
+ background-color: var(--bs-secondary-bg-subtle);
+ border: 2px dashed var(--bs-secondary);
+ opacity: 0.6;
+}
+
.tingle-modal * {
box-sizing: border-box
}
@@ -265,6 +271,7 @@
border: 1px solid #ccc;
border-collapse: collapse;
margin: 0;
+ margin-bottom: 1rem;
padding: 0;
width: 100%;
}
diff --git a/modules/sievefilters/site.js b/modules/sievefilters/site.js
index b189bbabb..9d022c561 100644
--- a/modules/sievefilters/site.js
+++ b/modules/sievefilters/site.js
@@ -10,56 +10,56 @@ var hm_sieve_condition_fields = function() {
description: 'Subject',
type: 'string',
selected: true,
- options: ['Contains', 'Matches', 'Regex']
+ options: ['Contains', 'Matches', 'Regex'],
},
{
name: 'body',
- description: 'Body',
+ description: 'Message body',
type: 'string',
- options: ['Contains', 'Matches', 'Regex']
+ options: ['Contains', 'Matches', 'Regex'],
},
{
name: 'size',
description: 'Size (KB)',
type: 'int',
- options: ['Over', 'Under']
- }
+ options: ['Over', 'Under'],
+ },
],
- 'Header': [
+ Header: [
{
name: 'to',
- description: 'To',
+ description: 'Recipient (To)',
type: 'string',
extra_option: false,
- options: ['Contains', 'Matches', 'Regex']
+ options: ['Contains', 'Matches', 'Regex'],
},
{
name: 'from',
- description: 'From',
+ description: 'Sender (From)',
type: 'string',
extra_option: false,
- options: ['Contains', 'Matches', 'Regex']
+ options: ['Contains', 'Matches', 'Regex'],
},
{
name: 'cc',
- description: 'CC',
+ description: 'Copied recipient (CC)',
type: 'string',
extra_option: false,
- options: ['Contains', 'Matches', 'Regex']
+ options: ['Contains', 'Matches', 'Regex'],
},
{
name: 'to_or_cc',
- description: 'To or CC',
+ description: 'Recipient (To or CC)',
type: 'string',
extra_option: false,
- options: ['Contains', 'Matches', 'Regex']
+ options: ['Contains', 'Matches', 'Regex'],
},
{
name: 'bcc',
- description: 'BCC',
+ description: 'Blind copied recipient (BCC)',
type: 'string',
extra_option: false,
- options: ['Contains', 'Matches', 'Regex']
+ options: ['Contains', 'Matches', 'Regex'],
},
{
name: 'custom',
@@ -67,9 +67,9 @@ var hm_sieve_condition_fields = function() {
type: 'string',
extra_option: true,
extra_option_description: 'Field Name',
- options: ['Contains', 'Matches', 'Regex']
- }
- ]
+ options: ['Contains', 'Matches', 'Regex'],
+ },
+ ],
};
};
@@ -400,6 +400,31 @@ function sieveFiltersPageHandler() {
/**************************************************************************************
* FUNCTIONS
**************************************************************************************/
+
+ function showErrorMsg(msg, parentClass, fadeTime = null) {
+ let $parent = $(parentClass);
+
+ if (!$parent.data("highlight-added")) {
+ $parent.data("highlight-added", true);
+ $parent.addClass("highlight-active border border-info rounded p-2 bg-light");
+ }
+
+ let $msg = $('').text(msg);
+
+ $parent.append($msg).show();
+
+ if (fadeTime !== null) {
+ setTimeout(function () {
+ $msg.remove();
+
+ if ($parent.data("highlight-added") && $parent.find("small").length === 0) {
+ $parent.removeClass("highlight-active border border-info rounded p-2 bg-light");
+ $parent.removeData("highlight-added");
+ }
+ }, fadeTime);
+ }
+ }
+
function save_filter(imap_account, gen_script = false) {
let validation_failed = false
let conditions_parsed = []
@@ -422,7 +447,11 @@ function sieveFiltersPageHandler() {
let idx = 0;
if (conditions.length === 0) {
- Hm_Notices.show('You must provide at least one condition', 'warning');
+ showErrorMsg(
+ "You must provide at least one condition",
+ ".sieve-filter-conditions-block",
+ 10000
+ );
return false;
}
@@ -431,7 +460,11 @@ function sieveFiltersPageHandler() {
let order = ordinal_number(key + 1);
let previous_messages = $('.sys_messages').html();
previous_messages += previous_messages ? ' ': '';
- Hm_Notices.show('The ' + order + ' condition (' + elem + ') must be provided', 'warning');
+ showErrorMsg(
+ "The " + order + " condition (" + elem + ") must be provided",
+ ".sieve-filter-conditions-block",
+ 10000
+ );
validation_failed = true;
}
conditions_parsed.push(
@@ -460,7 +493,7 @@ function sieveFiltersPageHandler() {
}).get();
if (actions_type.length === 0) {
- Hm_Notices.show('You must provide at least one action', 'warning');
+ showErrorMsg('You must provide at least one action', '.sieve-filter-actions-block', 10000);
return false;
}
@@ -471,7 +504,11 @@ function sieveFiltersPageHandler() {
let order = ordinal_number(key + 1);
let previous_messages = $('.sys_messages').html();
previous_messages += previous_messages ? ' ': '';
- Hm_Notices.show('The ' + order + ' action (' + elem + ') must be provided', 'waring');
+ showErrorMsg(
+ "The " + order + " action (" + elem + ") must be provided",
+ ".sieve-filter-actions-block",
+ 10000
+ );
validation_failed = true;
}
actions_parsed.push(
@@ -496,7 +533,7 @@ function sieveFiltersPageHandler() {
)
}
if ($('.modal_sieve_filter_name').val() == "") {
- Hm_Notices.show('Filter name is required', 'danger');
+ showErrorMsg("Filter name is required", ".sieve-filter-name-group");
return false;
}
@@ -630,7 +667,7 @@ function sieveFiltersPageHandler() {
});
let extra_options = '