Skip to content

Commit

Permalink
Merge pull request #2134 from nextcloud/fix/1447/drop-jquery
Browse files Browse the repository at this point in the history
fix: drop deprecated jquery functions
  • Loading branch information
Antreesy authored Dec 30, 2024
2 parents 575300c + 379ada0 commit 56340d4
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 74 deletions.
7 changes: 3 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
*/
module.exports = {
extends: [
'@nextcloud'
'@nextcloud',
],
globals: {
'$': true
},
rules: {
'no-control-regex': 1
}
'no-control-regex': 'warn',
},
}

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions js/NotificationsApp-BblOjCtt.chunk.mjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions js/NotificationsApp-BblOjCtt.chunk.mjs.map

Large diffs are not rendered by default.

35 changes: 0 additions & 35 deletions js/NotificationsApp-CTe3zlZO.chunk.mjs

This file was deleted.

1 change: 0 additions & 1 deletion js/NotificationsApp-CTe3zlZO.chunk.mjs.map

This file was deleted.

Large diffs are not rendered by default.

File renamed without changes.

Large diffs are not rendered by default.

File renamed without changes.
4 changes: 2 additions & 2 deletions js/notifications-main.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('notifications', '', 'js/NotificationsApp-CTe3zlZO.chunk.mjs'),window.OC.filePath('notifications', '', 'js/_plugin-vue2_normalizer-CT8YLgqQ.chunk.mjs'),window.OC.filePath('notifications', '', 'js/style-N1aAjoYj.chunk.mjs'),window.OC.filePath('notifications', '', 'css/style-BRbSke62.chunk.css'),window.OC.filePath('notifications', '', 'css/_plugin-vue2_normalizer-DCbvgtYV.chunk.css'),window.OC.filePath('notifications', '', 'js/BrowserStorage-D6kcvwSJ.chunk.mjs'),window.OC.filePath('notifications', '', 'css/BrowserStorage-ClWbmnb8.chunk.css'),window.OC.filePath('notifications', '', 'css/NotificationsApp-DMxXHcXK.chunk.css')])))=>i.map(i=>d[i]);
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('notifications', '', 'js/NotificationsApp-BblOjCtt.chunk.mjs'),window.OC.filePath('notifications', '', 'js/_plugin-vue2_normalizer-CT8YLgqQ.chunk.mjs'),window.OC.filePath('notifications', '', 'js/style-N1aAjoYj.chunk.mjs'),window.OC.filePath('notifications', '', 'css/style-BRbSke62.chunk.css'),window.OC.filePath('notifications', '', 'css/_plugin-vue2_normalizer-DCbvgtYV.chunk.css'),window.OC.filePath('notifications', '', 'js/BrowserStorage-D6kcvwSJ.chunk.mjs'),window.OC.filePath('notifications', '', 'css/BrowserStorage-ClWbmnb8.chunk.css'),window.OC.filePath('notifications', '', 'css/NotificationsApp-B2NiaI7A.chunk.css')])))=>i.map(i=>d[i]);
/*! third party licenses: js/vendor.LICENSE.txt */
import{V as p}from"./style-N1aAjoYj.chunk.mjs";const v="modulepreload",w=function(i,c){return new URL(i,c).href},y={},A=function(i,c,f){let u=Promise.resolve();if(c&&c.length>0){const s=document.getElementsByTagName("link"),e=document.querySelector("meta[property=csp-nonce]"),h=e?.nonce||e?.getAttribute("nonce");u=Promise.allSettled(c.map(r=>{if(r=w(r,f),r in y)return;y[r]=!0;const l=r.endsWith(".css"),E=l?'[rel="stylesheet"]':"";if(f)for(let a=s.length-1;a>=0;a--){const d=s[a];if(d.href===r&&(!l||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${E}`))return;const o=document.createElement("link");if(o.rel=l?"stylesheet":v,l||(o.as="script"),o.crossOrigin="",o.href=r,h&&o.setAttribute("nonce",h),document.head.appendChild(o),l)return new Promise((a,d)=>{o.addEventListener("load",a),o.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${r}`)))})}))}function m(s){const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=s,window.dispatchEvent(e),!e.defaultPrevented)throw s}return u.then(s=>{for(const e of s||[])e.status==="rejected"&&m(e.reason);return i().catch(m)})};p.prototype.t=t,p.prototype.n=n,p.prototype.OC=OC,p.prototype.OCA=OCA,new p({el:"#notifications",name:"NotificationsApp",components:{NotificationsApp:()=>A(()=>import("./NotificationsApp-CTe3zlZO.chunk.mjs").then(i=>i.N),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)},render:i=>i("NotificationsApp")});export{A as _};
import{V as p}from"./style-N1aAjoYj.chunk.mjs";const v="modulepreload",w=function(i,c){return new URL(i,c).href},y={},A=function(i,c,f){let u=Promise.resolve();if(c&&c.length>0){const s=document.getElementsByTagName("link"),e=document.querySelector("meta[property=csp-nonce]"),h=e?.nonce||e?.getAttribute("nonce");u=Promise.allSettled(c.map(r=>{if(r=w(r,f),r in y)return;y[r]=!0;const l=r.endsWith(".css"),E=l?'[rel="stylesheet"]':"";if(f)for(let a=s.length-1;a>=0;a--){const d=s[a];if(d.href===r&&(!l||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${E}`))return;const o=document.createElement("link");if(o.rel=l?"stylesheet":v,l||(o.as="script"),o.crossOrigin="",o.href=r,h&&o.setAttribute("nonce",h),document.head.appendChild(o),l)return new Promise((a,d)=>{o.addEventListener("load",a),o.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${r}`)))})}))}function m(s){const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=s,window.dispatchEvent(e),!e.defaultPrevented)throw s}return u.then(s=>{for(const e of s||[])e.status==="rejected"&&m(e.reason);return i().catch(m)})};p.prototype.t=t,p.prototype.n=n,p.prototype.OC=OC,p.prototype.OCA=OCA,new p({el:"#notifications",name:"NotificationsApp",components:{NotificationsApp:()=>A(()=>import("./NotificationsApp-BblOjCtt.chunk.mjs").then(i=>i.N),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)},render:i=>i("NotificationsApp")});export{A as _};
15 changes: 0 additions & 15 deletions src/Components/Action.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,24 +125,9 @@ export default {
})

// emit event to current app
this.$parent._$el.fadeOut(OC.menuSpeed)
this.$parent.$emit('remove', this.notificationIndex)

emit('notifications:action:executed', event)

try {
$('body').trigger(new $.Event('OCA.Notification.Action', {
notification: this.$parent,
action: {
url: this.link,
type: this.typeWithDefault,
},
}))
// do not do anything but log, the action went fine
// only the event bus listener failed, this is not our problem
} catch (error) {
console.error(error)
}
} catch (error) {
console.error('Failed to perform action', error)
showError(t('notifications', 'Failed to perform action'))
Expand Down
6 changes: 0 additions & 6 deletions src/Components/Notification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ export default {
}
},

_$el: null,

computed: {
timestamp() {
if (this.datetime === 'warning') {
Expand Down Expand Up @@ -246,10 +244,6 @@ export default {
},
},

mounted() {
this._$el = $(this.$el)
},

methods: {
prepareParameters(parameters) {
const richParameters = {}
Expand Down
7 changes: 0 additions & 7 deletions src/NotificationsApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ export default {
}
},

_$icon: null,

computed: {
showBrowserNotifications() {
return this.backgroundFetching
Expand Down Expand Up @@ -194,13 +192,8 @@ export default {

mounted() {
this.tabId = OC.requestToken || ('' + Math.random())
this._$icon = $(this.$refs.icon)
this._oldcount = 0

// Bind the button click event
console.debug('Registering notifications container as a menu')
OC.registerMenu($(this.$refs.button), $(this.$refs.container), undefined, true)

this.checkWebNotificationPermissions()

// Initial call to the notification endpoint
Expand Down

0 comments on commit 56340d4

Please sign in to comment.