refactor(core): migrate OC.EventSource from jQuery to native API

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
Ferdinand Thiessen 2026-01-19 17:04:29 +01:00
parent 8920dad2de
commit 6e29885128
No known key found for this signature in database
GPG key ID: 7E849AE05218500F

View file

@ -4,7 +4,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import $ from 'jquery'
import { getRequestToken } from './requesttoken.ts'
/**
@ -42,16 +41,18 @@ function OCEventSource(src, data) {
} else {
const iframeId = 'oc_eventsource_iframe_' + OCEventSource.iframeCount
OCEventSource.fallBackSources[OCEventSource.iframeCount] = this
this.iframe = $('<iframe></iframe>')
this.iframe.attr('id', iframeId)
this.iframe.hide()
const iframe = document.createElement('iframe')
iframe.id = iframeId
iframe.style.display = 'none'
joinChar = '&'
if (src.indexOf('?') === -1) {
joinChar = '?'
}
this.iframe.attr('src', src + joinChar + 'fallback=true&fallback_id=' + OCEventSource.iframeCount + '&' + dataStr)
$('body').append(this.iframe)
iframe.src = src + joinChar + 'fallback=true&fallback_id=' + OCEventSource.iframeCount + '&' + dataStr
this.iframe = iframe
document.body.appendChild(this.iframe)
this.useFallBack = true
OCEventSource.iframeCount++
}