summaryrefslogtreecommitdiffstats
path: root/apps/calendar
diff options
context:
space:
mode:
authorGeorg Ehrke <ownclouddev@georgswebsite.de>2011-12-29 19:16:33 +0100
committerGeorg Ehrke <ownclouddev@georgswebsite.de>2011-12-29 19:16:33 +0100
commit3bb11db943490e3f9cc1643c30f23f81ee976319 (patch)
treeed4f03ea809a9091fe43b3daeb541c80a50cce77 /apps/calendar
parentffa835c56f4575b3e6e40a1d2247f7b374fdc892 (diff)
parented2ba4e8e40b6877f71c1205ff9a7bd2b46f30e0 (diff)
downloadnextcloud-server-3bb11db943490e3f9cc1643c30f23f81ee976319.tar.gz
nextcloud-server-3bb11db943490e3f9cc1643c30f23f81ee976319.zip
Merge branch 'master' into calendar
Diffstat (limited to 'apps/calendar')
-rw-r--r--apps/calendar/css/style.css2
-rw-r--r--apps/calendar/export.php22
-rw-r--r--apps/calendar/js/calendar.js23
-rwxr-xr-xapps/calendar/templates/calendar.php1
4 files changed, 37 insertions, 11 deletions
diff --git a/apps/calendar/css/style.css b/apps/calendar/css/style.css
index 0204f2fc12f..6555c25a767 100644
--- a/apps/calendar/css/style.css
+++ b/apps/calendar/css/style.css
@@ -17,6 +17,8 @@
#editentry_dialog {display: none;}
#parsingfail_dialog{display: none;}
+#loading { display: none; left: 40%; position: fixed; top: 4.4em; z-index: 100; }
+
#calendar_holder {position: relative;bottom: 0; right: 0; left: 0; top: 3em;}
.fc-content{padding:2px 4px;}
#listview {margin: 0; padding: 10px; background: #EEEEEE;}
diff --git a/apps/calendar/export.php b/apps/calendar/export.php
index 9b3ea5005d6..ce1a4aa046f 100644
--- a/apps/calendar/export.php
+++ b/apps/calendar/export.php
@@ -6,25 +6,25 @@
* See the COPYING-README file.
*/
-require_once ("../../lib/base.php");
+require_once ('../../lib/base.php');
OC_Util::checkLoggedIn();
OC_Util::checkAppEnabled('calendar');
-$cal = isset($_GET["calid"]) ? $_GET["calid"] : NULL;
-$event = isset($_GET["eventid"]) ? $_GET["eventid"] : NULL;
+$cal = isset($_GET['calid']) ? $_GET['calid'] : NULL;
+$event = isset($_GET['eventid']) ? $_GET['eventid'] : NULL;
if(isset($cal)){
$calendar = OC_Calendar_App::getCalendar($cal);
$calobjects = OC_Calendar_Object::all($cal);
- header("Content-Type: text/Calendar");
- header("Content-Disposition: inline; filename=calendar.ics");
+ header('Content-Type: text/Calendar');
+ header('Content-Disposition: inline; filename=' . $calendar['displayname'] . '.ics');
foreach($calobjects as $calobject){
- echo $calobject["calendardata"] . "\n";
+ echo $calobject['calendardata'] . '\n';
}
}elseif(isset($event)){
- $data = OC_Calendar_App::getEventObject($_GET["eventid"]);
- $calendarid = $data["calendarid"];
+ $data = OC_Calendar_App::getEventObject($_GET['eventid']);
+ $calendarid = $data['calendarid'];
$calendar = OC_Calendar_App::getCalendar($calendarid);
- header("Content-Type: text/Calendar");
- header("Content-Disposition: inline; filename=" . $data["summary"] . ".ics");
- echo $data["calendardata"];
+ header('Content-Type: text/Calendar');
+ header('Content-Disposition: inline; filename=' . $data['summary'] . '.ics');
+ echo $data['calendardata'];
}
?>
diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js
index 892dbd79e42..d776f5c3fb5 100644
--- a/apps/calendar/js/calendar.js
+++ b/apps/calendar/js/calendar.js
@@ -8,7 +8,15 @@
Calendar={
UI:{
+ loading: function(isLoading){
+ if (isLoading){
+ $('#loading').show();
+ }else{
+ $('#loading').hide();
+ }
+ },
startEventDialog:function(){
+ Calendar.UI.loading(false);
$('.tipsy').remove();
$('#calendar_holder').fullCalendar('unselect');
Calendar.UI.lockTime();
@@ -54,6 +62,7 @@ Calendar={
// TODO: save event
$('#event').dialog('destroy').remove();
}else{
+ Calendar.UI.loading(true);
$('#dialog_holder').load(OC.filePath('calendar', 'ajax', 'neweventform.php'), {start:start, end:end, allday:allday?1:0}, Calendar.UI.startEventDialog);
}
},
@@ -63,13 +72,16 @@ Calendar={
// TODO: save event
$('#event').dialog('destroy').remove();
}else{
+ Calendar.UI.loading(true);
$('#dialog_holder').load(OC.filePath('calendar', 'ajax', 'editeventform.php') + '?id=' + id, Calendar.UI.startEventDialog);
}
},
submitDeleteEventForm:function(url){
var post = $( '#event_form' ).serialize();
$('#errorbox').empty();
+ Calendar.UI.loading(true);
$.post(url, post, function(data){
+ Calendar.UI.loading(false);
if(data.status == 'success'){
$('#calendar_holder').fullCalendar('removeEvents', $('#event_form input[name=id]').val());
$('#event').dialog('destroy').remove();
@@ -82,8 +94,10 @@ Calendar={
validateEventForm:function(url){
var post = $( "#event_form" ).serialize();
$("#errorbox").empty();
+ Calendar.UI.loading(true);
$.post(url, post,
function(data){
+ Calendar.UI.loading(false);
if(data.status == "error"){
var output = missing_field + ": <br />";
if(data.title == "true"){
@@ -120,8 +134,10 @@ Calendar={
},
moveEvent:function(event, dayDelta, minuteDelta, allDay, revertFunc){
$('.tipsy').remove();
+ Calendar.UI.loading(true);
$.post(OC.filePath('calendar', 'ajax', 'moveevent.php'), { id: event.id, dayDelta: dayDelta, minuteDelta: minuteDelta, allDay: allDay?1:0, lastmodified: event.lastmodified},
function(data) {
+ Calendar.UI.loading(false);
if (data.status == 'success'){
event.lastmodified = data.lastmodified;
console.log("Event moved successfully");
@@ -133,8 +149,10 @@ Calendar={
},
resizeEvent:function(event, dayDelta, minuteDelta, revertFunc){
$('.tipsy').remove();
+ Calendar.UI.loading(true);
$.post(OC.filePath('calendar', 'ajax', 'resizeevent.php'), { id: event.id, dayDelta: dayDelta, minuteDelta: minuteDelta, lastmodified: event.lastmodified},
function(data) {
+ Calendar.UI.loading(false);
if (data.status == 'success'){
event.lastmodified = data.lastmodified;
console.log("Event resized successfully");
@@ -329,6 +347,7 @@ Calendar={
if($('#choosecalendar_dialog').dialog('isOpen') == true){
$('#choosecalendar_dialog').dialog('moveToTop');
}else{
+ Calendar.UI.loading(true);
$('#dialog_holder').load(OC.filePath('calendar', 'ajax', 'choosecalendar.php'), function(){
$('#choosecalendar_dialog').dialog({
width : 600,
@@ -336,13 +355,16 @@ Calendar={
$(this).dialog('destroy').remove();
}
});
+ Calendar.UI.loading(false);
});
}
},
activation:function(checkbox, calendarid)
{
+ Calendar.UI.loading(true);
$.post(OC.filePath('calendar', 'ajax', 'activation.php'), { calendarid: calendarid, active: checkbox.checked?1:0 },
function(data) {
+ Calendar.UI.loading(false);
if (data.status == 'success'){
checkbox.checked = data.active == 1;
if (data.active == 1){
@@ -639,6 +661,7 @@ $(document).ready(function(){
}
});
},
+ loading: Calendar.UI.loading,
eventSources: eventSources
});
$('#oneweekview_radio').click(function(){
diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php
index 2003b7efc49..13bc8bc1bb1 100755
--- a/apps/calendar/templates/calendar.php
+++ b/apps/calendar/templates/calendar.php
@@ -19,6 +19,7 @@
var missing_field_dberror = '<?php echo $l->t('There was a database fail') ?>';
var totalurl = '<?php echo OC_Helper::linkTo('apps/calendar', 'caldav.php', null, true); ?>/calendars';
</script>
+ <div id="loading"><img src="<?php echo OC_Helper::imagePath('core', 'loading.gif'); ?>" /></div>
<div id="controls">
<div>
<form>