From 195229198e437de9aa6534473050fec4b2f1c4ea Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Thu, 20 Apr 2023 08:14:28 -0400 Subject: add cal keyboard hotkeys --- radicale_infcloud/web/main.js | 51 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) (limited to 'radicale_infcloud/web/main.js') diff --git a/radicale_infcloud/web/main.js b/radicale_infcloud/web/main.js index 95f4ec3..a84afb5 100644 --- a/radicale_infcloud/web/main.js +++ b/radicale_infcloud/web/main.js @@ -1,4 +1,5 @@ /* +vim: set noet: InfCloud - the open source CalDAV/CardDAV Web Client Copyright (C) 2011-2015 Jan Mate @@ -179,7 +180,7 @@ var globalActiveApp=''; var globalAvailableAppsArray=new Array(); var globalEnableAppSwitch=true; var globalAppName='Calendar'; -var globalVersion='0.13.5.1stackrpms' +var globalVersion='0.13.5.2stackrpms' var globalBuildNo=1660329731; var globalXMLCache=null; var globalVersionCheckURL=(location.protocol=='file:' ? 'http:' : location.protocol)+'//www.inf-it.com/versioncheck/'+globalAppName+'/?v='+globalVersion; @@ -1598,6 +1599,7 @@ function isEachResourceLoaded() window.onload=globalMain; excluded_types = ['input','textarea']; +var maxi = 4; window.onkeydown=function(event) { @@ -1630,6 +1632,53 @@ window.onkeydown=function(event) if($('#ResourceCardDAVToggle').is(':visible')){ $('#ResourceCardDAVToggle').trigger('click');}; } break; + /* ref: https://www.freecodecamp.org/news/javascript-keycode-list-keypress-event-key-codes/ */ + case 84: /* t */ + case 36: /* Home */ + if((excluded_types.indexOf(event.target.tagName.toLowerCase()) === -1) + && (globalActiveApp=='CalDavZAP' && !$('#CAEvent').is(':visible'))) + $('.fc-button-today').trigger('click'); + break; + case 33: /* PageUp */ + if((excluded_types.indexOf(event.target.tagName.toLowerCase()) === -1) + && (globalActiveApp=='CalDavZAP' && !$('#CAEvent').is(':visible'))) { + maxi = 1; + if(event.shiftKey) { maxi = 4; } + for (let i=0; i