-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat : add functionality to send a message later with a scheduled send
- Loading branch information
1 parent
05b410c
commit da0c4c9
Showing
11 changed files
with
325 additions
and
568 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
function handleNexterDateAction(e) { | ||
let reload_and_redirect = function () { | ||
Hm_Folders.reload_folders(true); | ||
let path = hm_list_parent() ? hm_list_parent() : hm_list_path(); | ||
window.location.replace('?page=message_list&list_path=' + path); | ||
}; | ||
|
||
let collectCheckedIds = function () { | ||
let ids = []; | ||
$('input[type=checkbox]').each(function () { | ||
if (this.checked && this.id.search('imap') !== -1) { | ||
let parts = this.id.split('_'); | ||
ids.push(parts[1] + '_' + parts[2] + '_' + parts[3]); | ||
} | ||
}); | ||
if (ids.length === 0) { | ||
return; | ||
} | ||
return ids; | ||
}; | ||
|
||
setupNexterDate(function () { | ||
let ids = collectCheckedIds(); | ||
|
||
Hm_Ajax.request( | ||
[ | ||
{ 'name': 'hm_ajax_hook', 'value': 'ajax_re_schedule_message_sending' }, | ||
{ 'name': 'scheduled_msg_ids', 'value': ids }, | ||
{ 'name': 'schedule_date', 'value': $(this).val() } | ||
], | ||
function (res) { | ||
if (res.scheduled_msg_count > 0) { | ||
reload_and_redirect(); | ||
} | ||
} | ||
); | ||
}); | ||
|
||
setupNexterDateSnooze(function () { | ||
let ids = collectCheckedIds(); | ||
|
||
Hm_Ajax.request( | ||
[ | ||
{ 'name': 'hm_ajax_hook', 'value': 'ajax_imap_snooze' }, | ||
{ 'name': 'imap_snooze_ids', 'value': ids }, | ||
{ 'name': 'imap_snooze_until', 'value': $(this).val() } | ||
], | ||
function (res) { | ||
if (res.snoozed_messages > 0) { | ||
reload_and_redirect(); | ||
} | ||
} | ||
); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.