From 019a5024f9776e942aecd1362bc6b4a72f1e0053 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Tue, 3 Oct 2023 09:46:03 -0700 Subject: [PATCH 1/4] Change of class position createCalendarListItem --- plugins/nextcloud/js/webdav.js | 83 +++++++++++++++++----------------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/plugins/nextcloud/js/webdav.js b/plugins/nextcloud/js/webdav.js index 0b788c9a4..b6e66fa4d 100644 --- a/plugins/nextcloud/js/webdav.js +++ b/plugins/nextcloud/js/webdav.js @@ -286,6 +286,47 @@ class NextcloudFilesPopupView extends rl.pluginPopupView { } }); } + // Happens after showModal() + beforeShow(files, fResolve) { + this.select = ''; + this.files(!!files); + this.fResolve = fResolve; + + this.tree.innerHTML = ''; + fetchFiles('/').then(items => { + buildTree(this, this.tree, items, '/'); + }).catch(err => console.error(err)) + } + + onHide() { + this.fResolve(this.select); + } +/* +beforeShow() {} // Happens before showModal() +onShow() {} // Happens after showModal() +afterShow() {} // Happens after showModal() animation transitionend +onHide() {} // Happens before animation transitionend +afterHide() {} // Happens after animation transitionend +close() {} +*/ +} + +class NextcloudCalendarsPopupView extends rl.pluginPopupView { + constructor() { + super('NextcloudCalendars'); + } + + onBuild(dom) { + this.tree = dom.querySelector('#sm-nc-calendars'); + this.tree.addEventListener('click', event => { + let el = event.target; + if (el.matches('button')) { + this.select = el.href; + this.close(); + } + }); + } + createCalendarListItem(calendarData, treeElement) { const { displayName, @@ -331,47 +372,7 @@ class NextcloudFilesPopupView extends rl.pluginPopupView { treeElement.appendChild(li); } - // Happens after showModal() - beforeShow(files, fResolve) { - this.select = ''; - this.files(!!files); - this.fResolve = fResolve; - - this.tree.innerHTML = ''; - fetchFiles('/').then(items => { - buildTree(this, this.tree, items, '/'); - }).catch(err => console.error(err)) - } - - onHide() { - this.fResolve(this.select); - } -/* -beforeShow() {} // Happens before showModal() -onShow() {} // Happens after showModal() -afterShow() {} // Happens after showModal() animation transitionend -onHide() {} // Happens before animation transitionend -afterHide() {} // Happens after animation transitionend -close() {} -*/ -} - -class NextcloudCalendarsPopupView extends rl.pluginPopupView { - constructor() { - super('NextcloudCalendars'); - } - - onBuild(dom) { - this.tree = dom.querySelector('#sm-nc-calendars'); - this.tree.addEventListener('click', event => { - let el = event.target; - if (el.matches('button')) { - this.select = el.href; - this.close(); - } - }); - } - + // Happens after showModal() beforeShow(fResolve) { this.select = ''; From 8e485c3cab7837586d1aca4568aaf614c5b58015 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Tue, 3 Oct 2023 09:47:57 -0700 Subject: [PATCH 2/4] Change of class position createCalendarListItem --- plugins/nextcloud/js/webdav.js | 83 +++++++++++++++++----------------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/plugins/nextcloud/js/webdav.js b/plugins/nextcloud/js/webdav.js index b6e66fa4d..0b788c9a4 100644 --- a/plugins/nextcloud/js/webdav.js +++ b/plugins/nextcloud/js/webdav.js @@ -286,47 +286,6 @@ class NextcloudFilesPopupView extends rl.pluginPopupView { } }); } - // Happens after showModal() - beforeShow(files, fResolve) { - this.select = ''; - this.files(!!files); - this.fResolve = fResolve; - - this.tree.innerHTML = ''; - fetchFiles('/').then(items => { - buildTree(this, this.tree, items, '/'); - }).catch(err => console.error(err)) - } - - onHide() { - this.fResolve(this.select); - } -/* -beforeShow() {} // Happens before showModal() -onShow() {} // Happens after showModal() -afterShow() {} // Happens after showModal() animation transitionend -onHide() {} // Happens before animation transitionend -afterHide() {} // Happens after animation transitionend -close() {} -*/ -} - -class NextcloudCalendarsPopupView extends rl.pluginPopupView { - constructor() { - super('NextcloudCalendars'); - } - - onBuild(dom) { - this.tree = dom.querySelector('#sm-nc-calendars'); - this.tree.addEventListener('click', event => { - let el = event.target; - if (el.matches('button')) { - this.select = el.href; - this.close(); - } - }); - } - createCalendarListItem(calendarData, treeElement) { const { displayName, @@ -372,7 +331,47 @@ class NextcloudCalendarsPopupView extends rl.pluginPopupView { treeElement.appendChild(li); } - + // Happens after showModal() + beforeShow(files, fResolve) { + this.select = ''; + this.files(!!files); + this.fResolve = fResolve; + + this.tree.innerHTML = ''; + fetchFiles('/').then(items => { + buildTree(this, this.tree, items, '/'); + }).catch(err => console.error(err)) + } + + onHide() { + this.fResolve(this.select); + } +/* +beforeShow() {} // Happens before showModal() +onShow() {} // Happens after showModal() +afterShow() {} // Happens after showModal() animation transitionend +onHide() {} // Happens before animation transitionend +afterHide() {} // Happens after animation transitionend +close() {} +*/ +} + +class NextcloudCalendarsPopupView extends rl.pluginPopupView { + constructor() { + super('NextcloudCalendars'); + } + + onBuild(dom) { + this.tree = dom.querySelector('#sm-nc-calendars'); + this.tree.addEventListener('click', event => { + let el = event.target; + if (el.matches('button')) { + this.select = el.href; + this.close(); + } + }); + } + // Happens after showModal() beforeShow(fResolve) { this.select = ''; From 5200917e0a3e9e6000bc74ea1fcb38a8f5a2539a Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Tue, 3 Oct 2023 09:48:22 -0700 Subject: [PATCH 3/4] Change of class position createCalendarListItem --- plugins/nextcloud/js/webdav.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/nextcloud/js/webdav.js b/plugins/nextcloud/js/webdav.js index 0b788c9a4..55942a35a 100644 --- a/plugins/nextcloud/js/webdav.js +++ b/plugins/nextcloud/js/webdav.js @@ -409,7 +409,7 @@ class NextcloudCalendarsPopupView extends rl.pluginPopupView { }; // Call the function to create and append the list item - this.createCalendarListItem(calendarData, this.tree); + // this.createCalendarListItem(calendarData, this.tree); } } }) From f0d90db640382c122f026caf1e22247f6fcebdb9 Mon Sep 17 00:00:00 2001 From: Ronak Patel Date: Tue, 3 Oct 2023 09:49:03 -0700 Subject: [PATCH 4/4] Change of class position createCalendarListItem --- plugins/nextcloud/js/webdav.js | 84 +++++++++++++++++----------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/plugins/nextcloud/js/webdav.js b/plugins/nextcloud/js/webdav.js index 55942a35a..c146bda3d 100644 --- a/plugins/nextcloud/js/webdav.js +++ b/plugins/nextcloud/js/webdav.js @@ -286,6 +286,47 @@ class NextcloudFilesPopupView extends rl.pluginPopupView { } }); } + + // Happens after showModal() + beforeShow(files, fResolve) { + this.select = ''; + this.files(!!files); + this.fResolve = fResolve; + + this.tree.innerHTML = ''; + fetchFiles('/').then(items => { + buildTree(this, this.tree, items, '/'); + }).catch(err => console.error(err)) + } + + onHide() { + this.fResolve(this.select); + } +/* +beforeShow() {} // Happens before showModal() +onShow() {} // Happens after showModal() +afterShow() {} // Happens after showModal() animation transitionend +onHide() {} // Happens before animation transitionend +afterHide() {} // Happens after animation transitionend +close() {} +*/ +} + +class NextcloudCalendarsPopupView extends rl.pluginPopupView { + constructor() { + super('NextcloudCalendars'); + } + + onBuild(dom) { + this.tree = dom.querySelector('#sm-nc-calendars'); + this.tree.addEventListener('click', event => { + let el = event.target; + if (el.matches('button')) { + this.select = el.href; + this.close(); + } + }); + } createCalendarListItem(calendarData, treeElement) { const { displayName, @@ -331,47 +372,6 @@ class NextcloudFilesPopupView extends rl.pluginPopupView { treeElement.appendChild(li); } - // Happens after showModal() - beforeShow(files, fResolve) { - this.select = ''; - this.files(!!files); - this.fResolve = fResolve; - - this.tree.innerHTML = ''; - fetchFiles('/').then(items => { - buildTree(this, this.tree, items, '/'); - }).catch(err => console.error(err)) - } - - onHide() { - this.fResolve(this.select); - } -/* -beforeShow() {} // Happens before showModal() -onShow() {} // Happens after showModal() -afterShow() {} // Happens after showModal() animation transitionend -onHide() {} // Happens before animation transitionend -afterHide() {} // Happens after animation transitionend -close() {} -*/ -} - -class NextcloudCalendarsPopupView extends rl.pluginPopupView { - constructor() { - super('NextcloudCalendars'); - } - - onBuild(dom) { - this.tree = dom.querySelector('#sm-nc-calendars'); - this.tree.addEventListener('click', event => { - let el = event.target; - if (el.matches('button')) { - this.select = el.href; - this.close(); - } - }); - } - // Happens after showModal() beforeShow(fResolve) { this.select = ''; @@ -409,7 +409,7 @@ class NextcloudCalendarsPopupView extends rl.pluginPopupView { }; // Call the function to create and append the list item - // this.createCalendarListItem(calendarData, this.tree); + this.createCalendarListItem(calendarData, this.tree); } } })