From e8e32f7a1194baabd6e158805f40396c667e6c56 Mon Sep 17 00:00:00 2001 From: Unrud Date: Fri, 10 Mar 2017 23:02:35 +0100 Subject: Add InfCloud --- radicale_web/web/infcloud/forms.js | 3307 ++++++++++++++++++++++++++++++++++++ 1 file changed, 3307 insertions(+) create mode 100644 radicale_web/web/infcloud/forms.js (limited to 'radicale_web/web/infcloud/forms.js') diff --git a/radicale_web/web/infcloud/forms.js b/radicale_web/web/infcloud/forms.js new file mode 100644 index 0000000..b169df3 --- /dev/null +++ b/radicale_web/web/infcloud/forms.js @@ -0,0 +1,3307 @@ +/* +InfCloud - the open source CalDAV/CardDAV Web Client +Copyright (C) 2011-2015 + Jan Mate + Andrej Lezo + Matej Mihalik + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . +*/ + +function updateTodoFormDimensions(setHeight) +{ + $('#CATodo').css('width',''); + $('#CATodo').css('width',$('#todo_details_template').css('width')); + + if(setHeight) + { + $('#CATodo').css('height',''); + $('#CATodo').css('height',$('#todo_details_template').css('height')); + } +} + +function updateEventFormDimensions(setHeight) +{ + $('#CAEvent').css('width',''); + $('#CAEvent').css('width',$('#event_details_template').css('width')); + + if(setHeight) + { + $('#CAEvent').css('height',''); + $('#CAEvent').css('height',$('#event_details_template').css('height')); + } +} + +function setFormPosition(jsEvent, confirmRepeat) +{ + var position_x, + position_y, + dist_x, + dist_y; + + $('#event_details_template').css('max-height',''); + + if(jsEvent) + { + if(jsEvent.pageX<=($('#main').width()/2)) + { + position_v='left'; + dist_x=jsEvent.pageX; + } + else + { + position_v='right'; + dist_x=$('body').width()-jsEvent.pageX; + } + + /*if(jsEvent.pageY<=($('#main').height()/2)) + { + position_h='top'; + dist_y=jsEvent.pageY; + } + else + { + position_h='top'; + dist_y=jsEvent.pageY-$('#event_details_template').height(); + }*/ + position_h='top'; + dist_y=Math.max(29, jsEvent.pageY-(confirmRepeat ? $('#CAEvent').height() : $('#event_details_template').height())); + } + else + { + position_v='right'; + position_h='top'; + dist_x=25; + dist_y=29; + } + + $('#CAEvent').css('left',''); + $('#CAEvent').css('right',''); + $('#CAEvent').css('top',''); + $('#CAEvent').css('bottom',''); + $('#CAEvent').css(position_v, dist_x); + $('#CAEvent').css(position_h, dist_y); + $('#event_details_template').css('max-height', $('#main').height()-dist_y+20+'px'); + $('#CAEvent').css('max-height', $('#main').height()-dist_y+20+'px'); +} + +function setTodoPosition(jsEvent) +{ + var dist, + pointY=0; + $('#todo_details_template').css('max-height',''); + $('#CATodo').css('max-height',''); + + if(jsEvent!=undefined) + { + if(jsEvent.pageY!=undefined) + pointY=jsEvent.pageY; + else + pointY=jsEvent.clientY; + } + + if(jsEvent) + { + /*if((pointY)+$('#todo_details_template').height()<$(window).height()) + dist=jsEvent.pageY; + else + dist=pointY-$('#todo_details_template').height();*/ + dist=Math.max(25, jsEvent.pageY-$('#todo_details_template').height()); + } + else + dist=25; + + $('#CATodo').css('left',''); + $('#CATodo').css('right',''); + $('#CATodo').css('top',''); + $('#CATodo').css('bottom',''); + $('#CATodo').css('top', dist); + $('#todo_details_template').css('right', 0); + $('#CATodo').css('right', 25); + $('#todo_details_template').css('max-height', $('#main').height()-dist+20+'px'); + $('#CATodo').css('max-height', $('#main').height()-dist+20+'px'); +} + +function showTimezones(selTimezone, todoSelector) +{ + if(!globalSettings.timezonesupport.value) + return false; + + var select=$('#timezone'+todoSelector); + select.empty(); + var isFirst=false; + for(var izone in timezoneKeys) + { + if(timeZonesEnabled.indexOf(timezoneKeys[izone])==-1) + continue; + if(!isNaN(izone)) + { + var tmp=null; + if(!isFirst) + { + tmp=$('