mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-29 05:16:34 +02:00
New: iCal calendar feed.
This commit is contained in:
@@ -2,15 +2,24 @@
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
], function (Marionette) {
|
||||
'System/StatusModel',
|
||||
'Mixins/CopyToClipboard'
|
||||
], function (Marionette, StatusModel) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'Calendar/CalendarFeedViewTemplate',
|
||||
|
||||
onRender: function() {
|
||||
// hackish way to determine the correct url, as using urlBase seems to only work for reverse proxies or so
|
||||
var ics = '//' + window.location.host + '/feed/calendar/NzbDrone.ics';
|
||||
this.$('#ical-url').val(window.location.protocol + ics);
|
||||
this.$('#ical-subscribe-button').attr('href', 'webcal:' + ics);
|
||||
}
|
||||
|
||||
ui: {
|
||||
icalUrl : '.x-ical-url',
|
||||
icalCopy : '.x-ical-copy'
|
||||
},
|
||||
|
||||
templateHelpers: {
|
||||
icalHttpUrl : window.location.protocol + '//' + window.location.host + StatusModel.get('urlBase') + '/feed/calendar/NzbDrone.ics',
|
||||
icalWebCalUrl : 'webcal://' + window.location.host + StatusModel.get('urlBase') + '/feed/calendar/NzbDrone.ics'
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
this.ui.icalCopy.copyToClipboard(this.ui.icalUrl);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user