Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/classify.picotech.app/public_html/vendor/livewire/livewire/js/component/ drwxr-xr-x | |
| Viewing file: Select action/file-type: import store from '@/Store'
export default function () {
store.registerHook('interceptWireModelAttachListener', (directive, el, component) => {
if (! (el.tagName.toLowerCase() === 'input' && el.type === 'file')) return
let start = () => el.dispatchEvent(new CustomEvent('livewire-upload-start', { bubbles: true }))
let finish = () => el.dispatchEvent(new CustomEvent('livewire-upload-finish', { bubbles: true }))
let error = () => el.dispatchEvent(new CustomEvent('livewire-upload-error', { bubbles: true }))
let progress = (progressEvent) => {
var percentCompleted = Math.round( (progressEvent.loaded * 100) / progressEvent.total )
el.dispatchEvent(
new CustomEvent('livewire-upload-progress', {
bubbles: true, detail: { progress: percentCompleted }
})
)
}
let eventHandler = e => {
if (e.target.files.length === 0) return
start()
if (e.target.multiple) {
component.uploadMultiple(directive.value, e.target.files, finish, error, progress)
} else {
component.upload(directive.value, e.target.files[0], finish, error, progress)
}
}
el.addEventListener('change', eventHandler)
// There's a bug in browsers where selecting a file, removing it,
// then re-adding it doesn't fire the change event. This fixes it.
// Reference: https://stackoverflow.com/questions/12030686/html-input-file-selection-event-not-firing-upon-selecting-the-same-file
let clearFileInputValue = () => { el.value = null }
el.addEventListener('click', clearFileInputValue)
component.addListenerForTeardown(() => {
el.removeEventListener('change', eventHandler)
el.removeEventListener('click', clearFileInputValue)
})
})
}
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0041 ]-- |