Skip to content

Commit

Permalink
Added EXDATE feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian1998 authored and DeepDiver1975 committed Jun 12, 2018
1 parent 8494037 commit 92bbdf5
Show file tree
Hide file tree
Showing 10 changed files with 472 additions and 47 deletions.
411 changes: 411 additions & 0 deletions css/app/angularBootstrap.css

Large diffs are not rendered by default.

23 changes: 0 additions & 23 deletions css/app/calendarlist.css
Original file line number Diff line number Diff line change
Expand Up @@ -471,29 +471,6 @@ li.calendar-share-item span {
white-space: nowrap;
}

ul.dropdown-menu {
max-height: 200px;
overflow-y: scroll;
overflow-x: hidden;
border: 1px #ddd solid;
border-radius: 0 0 4px 4px;
margin-top: -7px;
margin-left: 6px;
width: 89%;
}

ul.dropdown-menu li:last-child {
border-bottom: none !important;
}

#app-navigation ul.dropdown-menu a {
padding: 6px;
}

ul.dropdown-menu li > a:hover {
background-color: grey !important;
}

/* Fullcalendar modifications */

.fc th,
Expand Down
22 changes: 2 additions & 20 deletions css/app/eventdialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
width: 450px;
background: #fff;
box-shadow: 0 0 3px #999;
overflow: hidden;
overflow: visible;
margin-left: 0 !important;
padding-bottom: 12px;
}
Expand All @@ -74,7 +74,7 @@

.events .events--fieldset textarea {
height: 4.5em;
width: 96%;
width: 97% !important;
resize: vertical;
}

Expand Down Expand Up @@ -309,25 +309,7 @@ button.delete:focus {
display: inline;
}

.dropdown-menu,
.attendeename {
width: 100%;
max-width: 470px;
}

.dropdown-menu li {
border-bottom: 1px solid #ddd;
background: #f8f8f8;
}

.dropdown-menu li a {
display: block;
padding: 5px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.dropdown-menu li a:hover {
background: #eee;
}
22 changes: 22 additions & 0 deletions js/app/controllers/calcontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,25 @@ app.controller('CalController', ['$scope', 'Calendar', 'CalendarService', 'VEven
});
}

function deleteOccurence(vevent, fcEvent) {
var exdate = fcEvent.event.getFirstProperty('exdate');
if(exdate !== null) {
exdate = exdate.getValues();
}
else {
exdate = [];
}
exdate.push(ICAL.Time.fromJSDate(fcEvent.start.toDate(), true));
const exdateProp = new ICAL.Property('exdate', fcEvent.event);
exdateProp.setValues(exdate);

fcEvent.event.removeAllProperties('exdate');
fcEvent.event.addProperty(exdateProp);
VEventService.update(vevent).then(function() {
fc.elm.fullCalendar('refetchEventSources', vevent.calendar.fcEventSource);
});
}

$scope.$watchCollection('calendars', function(newCalendars, oldCalendars) {
newCalendars.filter(function(calendar) {
return oldCalendars.indexOf(calendar) === -1;
Expand Down Expand Up @@ -239,6 +258,9 @@ app.controller('CalController', ['$scope', 'Calendar', 'CalendarService', 'VEven
if (reason === 'delete') {
deleteAndRemoveEvent(vevent, fcEvent);
}
else if(reason === 'deleteOccurrence') {
deleteOccurence(vevent, fcEvent);
}
});
},
eventResize: function (fcEvent, delta, revertFunc) {
Expand Down
8 changes: 8 additions & 0 deletions js/app/controllers/editorcontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ app.controller('EditorController', ['$scope', 'TimezoneService', 'AutoCompletion
});
};

$scope.isRecurring = function() {
return $scope.properties.repeating;
};

$scope.cancel = function() {
$uibModalInstance.dismiss('cancel');
};
Expand All @@ -157,6 +161,10 @@ app.controller('EditorController', ['$scope', 'TimezoneService', 'AutoCompletion
$uibModalInstance.dismiss('delete');
};

$scope.deleteOccurrence = function() {
$uibModalInstance.dismiss('deleteOccurrence');
};

$scope.export = function() {
$window.open($scope.oldCalendar.url + vevent.uri);
};
Expand Down
2 changes: 2 additions & 0 deletions js/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"name": "nextcloud-calendar",
"dependencies": {
"angular": "1.6.4",
"angular-animate": "1.6.4",
"angular-sanitize": "1.6.4",
"angular-bootstrap": "2.5.0",
"jquery-timepicker": "883bb2cd94",
"jstzdetect": "https://github.com/georgehrke/jstimezonedetect.git",
Expand Down
2 changes: 2 additions & 0 deletions js/config/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@
*/

var app = angular.module('Calendar', [
'ngAnimate',
'ngSanitize',
'ui.bootstrap'
]);
2 changes: 2 additions & 0 deletions js/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ const cssSources = [
];
const vendorSources = [
'vendor/angular/angular.js',
'vendor/angular-animate/angular-animate.js',
'vendor/angular-sanitize/angular-sanitize.js',
'vendor/angular-bootstrap/ui-bootstrap-tpls.js',
'vendor/fullcalendar/dist/fullcalendar.js',
'vendor/fullcalendar/dist/locale-all.js',
Expand Down
13 changes: 11 additions & 2 deletions templates/editor.popover.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,20 @@ class="checkbox"
<label for="alldayeventcheckbox"><?php p($l->t('All day Event'))?></label>
</div>
</fieldset>

<fieldset class="events--fieldset pull-left" ng-if="!readOnly">
<button ng-click="delete()" ng-if="!is_new" class="events--button button btn delete" type="button" tabindex="110">
<button ng-click="delete()" ng-if="!is_new && !isRecurring()" class="events--button button btn delete" type="button" tabindex="110">
<?php p($l->t('Delete')); ?>
</button>
<div class="btn-group" uib-dropdown ng-if="!is_new && isRecurring()">
<button id="single-button" type="button" class="btn delete" tabindex="110" uib-dropdown-toggle>
<?php p($l->t('Delete')); ?>
<span class="caret"></span>
</button>
<ul class="dropdown-menu" uib-dropdown-menu role="menu" aria-labelledby="single-button">
<li role="menuitem"><a ng-click="delete()" href="#"><?php p($l->t('Delete all')); ?></a></li>
<li role="menuitem"><a ng-click="deleteOccurrence()" href="#"><?php p($l->t('Delete just occurrence')); ?></a></li>
</ul>
</div>
<button ng-click="cancel()" class="events--button button btn" type="button" tabindex="111">
<?php p($l->t('Cancel')); ?>
</button>
Expand Down
14 changes: 12 additions & 2 deletions templates/editor.sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,23 @@ class="checkbox"
<button
class="events--button button btn delete btn-half pull-left"
ng-click="delete()"
ng-if="!is_new"
ng-if="!is_new && !isRecurring()"
type="button"
tabindex="280">
<?php p($l->t('Delete')); ?>
</button>
<div class="btn-group btn-half pull-left" uib-dropdown ng-if="!is_new && isRecurring()">
<button id="single-button" type="button" class="events--button button btn delete single-button-sidebar" tabindex="280" uib-dropdown-toggle>
<?php p($l->t('Delete')); ?>
<span class="caret"></span>
</button>
<ul class="dropdown-menu" uib-dropdown-menu role="menu" aria-labelledby="single-button">
<li role="menuitem"><a ng-click="delete()" href="#"><?php p($l->t('Delete all')); ?></a></li>
<li role="menuitem"><a ng-click="deleteOccurrence()" href="#"><?php p($l->t('Delete just occurrence')); ?></a></li>
</ul>
</div>
<button
class="evens--button button btn btn-half pull-right"
class="evens--button button btn btn-half pull-right cancel-button-sidebar"
ng-click="cancel()"
ng-if="!is_new"
type="button"
Expand Down

0 comments on commit 92bbdf5

Please sign in to comment.