mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 04:29:21 +03:00
Remove #1737
This commit is contained in:
parent
ef724b4b4a
commit
ba85eda7f0
5 changed files with 12 additions and 530 deletions
|
|
@ -320,28 +320,12 @@ class NextcloudCalendarsPopupView extends rl.pluginPopupView {
|
|||
}
|
||||
|
||||
onBuild(dom) {
|
||||
let modalObj = this
|
||||
this.tree = dom.querySelector('#sm-nc-calendars');
|
||||
this.tree.addEventListener('click', event => {
|
||||
let el = event.target;
|
||||
if (el.matches('button')) {
|
||||
this.select = el.href;
|
||||
let VEVENT = this.VEVENT
|
||||
|
||||
rl.nextcloud.calendarPut(this.select, this.VEVENT, (response) => {
|
||||
if (response.status != 201 && response.status != 204) {
|
||||
InvitesPopupView.showModal([
|
||||
rl.i18n('MESSAGE/EVENT_ADDITION_FAILURE_TITLE'),
|
||||
rl.i18n('MESSAGE/EVENT_ADDITION_FAILURE_BODY', {eventName: VEVENT.SUMMARY}),
|
||||
() => {modalObj.close()}
|
||||
])
|
||||
}
|
||||
InvitesPopupView.showModal([
|
||||
rl.i18n('MESSAGE/EVENT_ADDED_TITLE'),
|
||||
rl.i18n('MESSAGE/EVENT_ADDED_BODY', {eventName: VEVENT.SUMMARY}),
|
||||
() => {modalObj.close()}
|
||||
])
|
||||
})
|
||||
this.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -391,10 +375,9 @@ class NextcloudCalendarsPopupView extends rl.pluginPopupView {
|
|||
treeElement.appendChild(li);
|
||||
}
|
||||
// Happens after showModal()
|
||||
beforeShow(fResolve, VEVENT) {
|
||||
beforeShow(fResolve) {
|
||||
this.select = '';
|
||||
this.fResolve = fResolve;
|
||||
this.VEVENT = VEVENT
|
||||
this.tree.innerHTML = '';
|
||||
davFetch('calendars', '/', {
|
||||
method: 'PROPFIND',
|
||||
|
|
@ -449,15 +432,14 @@ close() {}
|
|||
}
|
||||
|
||||
rl.nextcloud = {
|
||||
selectCalendar: (VEVENT) =>
|
||||
selectCalendar: () =>
|
||||
new Promise(resolve => {
|
||||
NextcloudCalendarsPopupView.showModal([
|
||||
href => resolve(href),
|
||||
VEVENT
|
||||
]);
|
||||
}),
|
||||
|
||||
calendarPut: (path, event, callback) => {
|
||||
calendarPut: (path, event) => {
|
||||
davFetch('calendars', path + '/' + event.UID + '.ics', {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
|
|
@ -481,8 +463,6 @@ rl.nextcloud = {
|
|||
// response.text().then(text => console.error({status:response.status, body:text}));
|
||||
Promise.reject(new Error({ response }));
|
||||
}
|
||||
|
||||
callback && callback(response)
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -520,27 +500,3 @@ function getElementsInNamespaces(xmlDocument, tagName) {
|
|||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
|
||||
class InvitesPopupView extends rl.pluginPopupView {
|
||||
constructor() {
|
||||
super('NextcloudInvites')
|
||||
}
|
||||
|
||||
onBuild(dom) {
|
||||
this.title = dom.querySelector('#sm-invites-popup-title')
|
||||
this.body = dom.querySelector('#sm-invites-popup-body')
|
||||
}
|
||||
|
||||
beforeShow(title, body, onHide_) {
|
||||
this.title.innerHTML = title
|
||||
this.body.innerHTML = body
|
||||
this.onHide_ = onHide_
|
||||
}
|
||||
|
||||
onHide() {
|
||||
if (this.onHide_) {
|
||||
this.onHide_()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue