Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added possibility to share multiple calendars #865

Closed
wants to merge 0 commits into from
Closed

Added possibility to share multiple calendars #865

wants to merge 0 commits into from

Conversation

haug-den-lucas
Copy link

This PR implements a function requested in #708
You can pass multiple share tokens split by a . to embed multiple calendars.
All calendars are shown in the default color at the moment. This may be impoved.

}

$scope.integration = function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you move this here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved here, because otherwise the embed code will only contain one of the public sharing tokens.

var tokens = constants.publicSharingToken.split(".");
var finished = 0;
tokens.forEach(function(token){
$scope.calendarsPromise = CalendarService.getPublicCalendar(token).then(function(calendar) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ident with tabs instead of spaces

$scope.$apply();
}
}).catch((reason) => {
angular.element('#header-right').css('display', 'none');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error handling needs to be adapted.
You don't want to show the empty-container error page if one out of ten calendars fail.
You would want some kind of Notification though. You can use OC.Notification.show() for that.

}

$scope.integration = function () {
return '<iframe width="400" height="215" src="' + $scope.$parent.root + 'embed/' + constants.publicSharingToken + '"></iframe>';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if angular handles escaping here.
What if you pass html as a parameter for constants.publicSharingToken?

This might result in an html injection.

Can you please check if its properly escaped?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will check

@haug-den-lucas
Copy link
Author

I messed up commits, which automatically closed this PR.
Had to create a new one, see #870

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants