-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement browser history API based navigation, preventing page reloa…
…ds between routings (#1266)
- Loading branch information
1 parent
91ab250
commit 86be642
Showing
54 changed files
with
2,614 additions
and
1,537 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 |
---|---|---|
|
@@ -29,3 +29,4 @@ lib/hm3/users/ | |
/data/ | ||
/docker/data/ | ||
/docker/site/ | ||
venv |
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
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,58 @@ | ||
function applyServersPageHandlers() { | ||
$('.server_section').on("click", function() { return Hm_Utils.toggle_page_section($(this).data('target')); }); | ||
$('.edit_server_connection').on('click', imap_smtp_edit_action); | ||
// NUX | ||
expand_server_settings(); | ||
$('.nux_next_button').on("click", nux_service_select); | ||
$('#service_select').on("change", function() { | ||
if ($(this).val() == 'all-inkl') { | ||
add_extra_fields(this, 'all_inkl_login', 'Login', hm_trans('Your All-inkl Login')); | ||
} else { | ||
$('.nux_extra_fields_container').remove(); | ||
} | ||
}); | ||
|
||
// Optional modules | ||
if (window.feedServersPageHandler) feedServersPageHandler(); | ||
if (window.githubServersPageHandler) githubServersPageHandler(); | ||
if (window.nasaServersPageHandler) nasaServersPageHandler(); | ||
if (window.smtpServersPageHandler) smtpServersPageHandler(); | ||
if (window.wpServersPageHandler) wpServersPageHandler(); | ||
} | ||
|
||
function applySettingsPageHandlers() { | ||
Hm_Utils.expand_core_settings(); | ||
$('.settings_subtitle').on("click", function() { return Hm_Utils.toggle_page_section($(this).data('target')); }); | ||
$('.reset_default_value_checkbox').on("click", reset_default_value_checkbox); | ||
$('.reset_default_value_select').on("click", reset_default_value_select); | ||
$('.reset_default_value_input').on("click", reset_default_value_input); | ||
$('.reset_default_timezone').on("click", reset_default_timezone); | ||
|
||
if (window.expand_feed_settings) expand_feed_settings(); | ||
if (window.smtpSettingsPageHandler) smtpSettingsPageHandler(); | ||
} | ||
|
||
function applySearchPageHandlers(routeParams) { | ||
Hm_Message_List.select_combined_view(); | ||
sortHandlerForMessageListAndSearchPage(); | ||
$('.search_reset').on("click", Hm_Utils.reset_search_form); | ||
|
||
if (window.inlineMessageMessageListAndSearchPageHandler) inlineMessageMessageListAndSearchPageHandler(routeParams); | ||
if (window.savedSearchesSearchPageHandler) savedSearchesSearchPageHandler(); | ||
} | ||
|
||
function applyHomePageHandlers() { | ||
$('.pw_update').on("click", function() { update_password($(this).data('id')); }); | ||
} | ||
|
||
function applyInfoPageHandlers() { | ||
const timer = setTimeout(() => { | ||
imap_status_update(); | ||
if (window.feed_status_update) feed_status_update(); | ||
if (window.github_repo_update) github_repo_update(); | ||
}, 100); | ||
|
||
return () => { | ||
clearTimeout(timer); | ||
} | ||
} |
Oops, something went wrong.