From 6f7c7d63c7d24f026395880ba5d921b268d76e3c Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Wed, 4 Jan 2023 14:39:23 -0500 Subject: add left-bracket to toggle left sidebar --- radicale_infcloud/web/main.js | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/radicale_infcloud/web/main.js b/radicale_infcloud/web/main.js index b8b8ffe..2c62b00 100644 --- a/radicale_infcloud/web/main.js +++ b/radicale_infcloud/web/main.js @@ -739,10 +739,10 @@ function run() return false; } - /* stackrpms,4 disable version check + /* stackrpms,4 disable version check if(typeof globalNewVersionNotifyUsers=='undefined' || globalNewVersionNotifyUsers!=null) netVersionCheck(); - */ + */ document.title+=' ['+globalAccountSettings[0].userAuth.userName+']'; // Automatically detect crossDomain settings @@ -1597,19 +1597,21 @@ function isEachResourceLoaded() window.onload=globalMain; +excluded_types = ['input','textarea']; + window.onkeydown=function(event) { switch(event.which) { - case 10: - /* case 10 is for Mac or possibly Chrome compatibility. https://stackoverflow.com/a/9343095 */ - if(globalActiveApp=='CalDavZAP' && $('#event_details_template').is(':visible') && $('#saveButton').is(':visible') && event.ctrlKey) - $('#saveButton').trigger('click'); - break; + case 10: + /* case 10 is for Mac or possibly Chrome compatibility. https://stackoverflow.com/a/9343095 */ + if(globalActiveApp=='CalDavZAP' && $('#event_details_template').is(':visible') && $('#saveButton').is(':visible') && event.ctrlKey) + $('#saveButton').trigger('click'); + break; case 13: if(!isUserLogged) $('#Login').find('[data-type="system_login"]').trigger('click'); - if(globalActiveApp=='CalDavZAP' && $('#event_details_template').is(':visible') && $('#saveButton').is(':visible') && event.ctrlKey) - $('#saveButton').trigger('click'); + if(globalActiveApp=='CalDavZAP' && $('#event_details_template').is(':visible') && $('#saveButton').is(':visible') && event.ctrlKey) + $('#saveButton').trigger('click'); break; case 27: if(globalActiveApp=='CalDavZAP' && $('#CAEvent').is(':visible') && $('#EventDisabler').is(':hidden')) @@ -1619,6 +1621,15 @@ window.onkeydown=function(event) if($('.sp-container').is(':visible')) $('html').trigger('click'); break; + case 219: + /* left-bracket to close the sidebar thing */ + /* if not in a input or textarea, */ + if(excluded_types.indexOf(event.target.tagName.toLowerCase()) === -1) { + if($('#ResourceCalDAVToggle').is(':visible')){ $('#ResourceCalDAVToggle').trigger('click');}; + if($('#ResourceCalDAVTODOToggle').is(':visible')){ $('#ResourceCalDAVTODOToggle').trigger('click');}; + if($('#ResourceCardDAVToggle').is(':visible')){ $('#ResourceCardDAVToggle').trigger('click');}; + } + break; default: break; } -- cgit