forked from cypht-org/cypht
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Hm_MessagesStore to the core module, and move some remanants cod…
…e previously handled by hm_list_path() and hm_page_name() to the new navigation module. There are still a few occurences to move
- Loading branch information
1 parent
c0041b2
commit 477e6b1
Showing
22 changed files
with
503 additions
and
460 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
function applyAdvancedSearchPageHandlers() { | ||
globals.close_html = '<i class="bi bi-x-circle-fill cursor-pointer"></i>'; | ||
|
||
$('.settings_subtitle').on("click", function() { return Hm_Utils.toggle_page_section($(this).data('target')); }); | ||
$('.adv_folder_select').on("click", function() { adv_select_imap_folder(this); }); | ||
$('.new_time').on("click", function() { add_remove_times(this); }); | ||
$('.new_target').on("click", function() { add_remove_targets(this); }); | ||
$('.new_term').on("click", function() { add_remove_terms(this); }); | ||
$('.adv_expand_all').on("click", function() { adv_expand_sections(); }); | ||
$('.adv_collapse_all').on("click", function() { adv_collapse(); }); | ||
$('#adv_search').on("click", function() { process_advanced_search(); }); | ||
$('.toggle_link').on("click", function() { return Hm_Message_List.toggle_rows(); }); | ||
$('.adv_reset').on("click", function() { adv_reset_page(); }); | ||
$('.combined_sort').on("change", function() { Hm_Message_List.sort($(this).val()); }); | ||
|
||
apply_saved_search(); | ||
var data = Hm_Utils.get_from_local_storage('formatted_advanced_search_data'); | ||
if (data && data.length) { | ||
adv_collapse(); | ||
Hm_Utils.tbody().html(data); | ||
$('.adv_controls').show(); | ||
$('.core_msg_control').off('click'); | ||
$('.core_msg_control').on("click", function() { return Hm_Message_List.message_action($(this).data('action')); }); | ||
Hm_Message_List.set_checkbox_callback(); | ||
if (typeof check_select_for_imap !== 'undefined') { | ||
check_select_for_imap(); | ||
} | ||
} | ||
Hm_Message_List.check_empty_list(); | ||
} |
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,15 @@ | ||
function applyCalendarPageHandlers() { | ||
$('.event_delete').on("click", function() { | ||
if (hm_delete_prompt()) { | ||
$(this).parent().submit(); | ||
} | ||
}); | ||
$('.cal_title').on("click", function(e) { | ||
e.preventDefault(); | ||
$('.event_details').hide(); | ||
$('.event_details', $(this).parent()).show(); | ||
$('.event_details').on("click", function() { | ||
$(this).hide(); | ||
}); | ||
}); | ||
} |
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 |
---|---|---|
@@ -1,18 +1 @@ | ||
'use strict'; | ||
|
||
$(function() { | ||
if (hm_page_name() == 'calendar') { | ||
$('.event_delete').on("click", function() { | ||
if (hm_delete_prompt()) { | ||
$(this).parent().submit(); | ||
} | ||
}); | ||
$('.cal_title').on("click", function() { | ||
$('.event_details').hide(); | ||
$('.event_details', $(this).parent()).show(); | ||
$('.event_details').on("click", function() { | ||
$(this).hide(); | ||
}); | ||
}); | ||
} | ||
}); |
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,33 @@ | ||
function applyContactsPageHandlers() { | ||
$('.delete_contact').on("click", function() { | ||
delete_contact($(this).data('id'), $(this).data('source'), $(this).data('type')); | ||
return false; | ||
}); | ||
$('.show_contact').on("click", function() { | ||
$('#'+$(this).data('id')).toggle(); | ||
return false; | ||
}); | ||
$('.reset_contact').on("click", function() { | ||
Hm_Utils.redirect('?page=contacts'); | ||
}); | ||
$('.server_title').on("click", function() { | ||
$(this).next().toggle(); | ||
}); | ||
$('#contact_phone').on("keyup", function() { | ||
let contact_phone = $('#contact_phone').val(); | ||
const regex_number = new RegExp('^\\d+$'); | ||
const allowed_characters = ['+','-','(',')']; | ||
for (let chain_counter = 0; chain_counter < contact_phone.length; chain_counter++) { | ||
if(!(regex_number.test(contact_phone[chain_counter])) && !(allowed_characters.indexOf(contact_phone[chain_counter]) > -1)){ | ||
Hm_Notices.show([hm_trans("This phone number appears to contain invalid character (s).\nIf you are sure ignore this warning and continue!")]); | ||
$(this).off(); | ||
} | ||
} | ||
|
||
}); | ||
$('.source_link').on("click", function () { | ||
$('.list_actions').toggle(); $('#list_controls_menu').hide(); | ||
return false; | ||
}); | ||
contact_import_pagination(); | ||
} |
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
File renamed without changes.
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 |
---|---|---|
@@ -1,22 +1,69 @@ | ||
ROUTES = [ | ||
/* | ||
NOTE: Handlers are registered as strings instead of functions because some modules might not be enabled, making their pages' handler functions unaccessible. | ||
*/ | ||
const modulesRoutes = [ | ||
{ | ||
page: 'message_list', | ||
handler: applyImapMessageListPageHandlers | ||
handler: 'applyImapMessageListPageHandlers' | ||
}, | ||
{ | ||
page: 'message', | ||
handler: applyImapMessageContentPageHandlers | ||
handler: 'applyImapMessageContentPageHandlers' | ||
}, | ||
{ | ||
page: 'compose', | ||
handler: applySmtpPageHandlers | ||
handler: 'applyComposePageHandlers' | ||
}, | ||
{ | ||
page: 'servers', | ||
handler: applyServersPageHandlers | ||
handler: 'applyServersPageHandlers' | ||
}, | ||
{ | ||
page: 'settings', | ||
handler: applySettingsPageHandlers | ||
handler: 'applySettingsPageHandlers' | ||
}, | ||
{ | ||
page: 'search', | ||
handler: 'applySearchPageHandlers' | ||
}, | ||
{ | ||
page: 'home', | ||
handler: 'applyHomePageHandlers' | ||
}, | ||
{ | ||
page: 'info', | ||
handler: 'applyInfoPageHandlers' | ||
}, | ||
{ | ||
page: 'calendar', | ||
handler: 'applyCalendarPageHandlers' | ||
}, | ||
{ | ||
page: 'advanced_search', | ||
handler: 'applyAdvancedSearchPageHandlers' | ||
}, | ||
{ | ||
page: 'contacts', | ||
handler: 'applyContactsPageHandlers' | ||
}, | ||
{ | ||
page: 'history', | ||
handler: 'applyHistoryPageHandlers' | ||
}, | ||
{ | ||
page: 'folders', | ||
handler: 'applyFoldersPageHandlers' | ||
}, | ||
{ | ||
page: 'folders_subscription', | ||
handler: 'applyFoldersSubscriptionPageHandlers' | ||
} | ||
] | ||
] | ||
|
||
/* | ||
Now let's validate and use handlers that are given. | ||
*/ | ||
ROUTES = modulesRoutes.filter(route => typeof(window[route.handler]) === 'function').map(route => ({ | ||
...route, | ||
handler: window[route.handler] | ||
})) |
Oops, something went wrong.