aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-04-20 08:14:28 -0400
committerB. Stack <bgstack15@gmail.com>2023-04-20 08:14:28 -0400
commit195229198e437de9aa6534473050fec4b2f1c4ea (patch)
tree2f3565b997e674f4746b929697fffe512f0ad5d1
parentversion 0.13.5.1 (diff)
downloadradicaleinfcloud-195229198e437de9aa6534473050fec4b2f1c4ea.tar.gz
radicaleinfcloud-195229198e437de9aa6534473050fec4b2f1c4ea.tar.bz2
radicaleinfcloud-195229198e437de9aa6534473050fec4b2f1c4ea.zip
add cal keyboard hotkeys
-rw-r--r--radicale_infcloud/web/main.js51
1 files changed, 50 insertions, 1 deletions
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 <jan.mate@inf-it.com>
@@ -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<maxi; i++) { $('.fc-button-prev').trigger('click'); }
+ }
+ break;
+ case 34: /* PageDown */
+ /* IMPROVE FIXME WORKHERE: this shift counter could be a variable set somewhere,
+ either in the js or perhaps in the browser session data, like the
+ username or password?
+ */
+ 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<maxi; i++) { $('.fc-button-next').trigger('click'); }
+ }
+ break;
+ case 49: /* 1 with Ctrl */
+ if((excluded_types.indexOf(event.target.tagName.toLowerCase()) === -1)
+ && (globalActiveApp=='CalDavZAP' && !$('#CAEvent').is(':visible'))
+ && event.ctrlKey) { $('.fc-button-month').trigger('click'); }
+ break;
+ case 50: /* 2 with Ctrl */
+ if((excluded_types.indexOf(event.target.tagName.toLowerCase()) === -1)
+ && (globalActiveApp=='CalDavZAP' && !$('#CAEvent').is(':visible'))
+ && event.ctrlKey) { $('.fc-button-multiWeek').trigger('click'); }
+ break;
+ case 51: /* 3 with Ctrl */
+ if((excluded_types.indexOf(event.target.tagName.toLowerCase()) === -1)
+ && (globalActiveApp=='CalDavZAP' && !$('#CAEvent').is(':visible'))
+ && event.ctrlKey) { $('.fc-button-agendaWeek').trigger('click'); }
+ break;
+ case 52: /* 4 with Ctrl */
+ if((excluded_types.indexOf(event.target.tagName.toLowerCase()) === -1)
+ && (globalActiveApp=='CalDavZAP' && !$('#CAEvent').is(':visible'))
+ && event.ctrlKey) { $('.fc-button-agendaDay').trigger('click'); }
+ break;
default:
break;
}
bgstack15