aircox/assets/src/app.js
Chris Tactic 55123c386d #132 | #121: backoffice / dev-1.0-121 (#131)
cfr #121

Co-authored-by: Christophe Siraut <d@tobald.eu.org>
Co-authored-by: bkfox <thomas bkfox net>
Co-authored-by: Thomas Kairos <thomas@bkfox.net>
Reviewed-on: #131
Co-authored-by: Chris Tactic <ctactic@noreply.git.radiocampus.be>
Co-committed-by: Chris Tactic <ctactic@noreply.git.radiocampus.be>
2024-04-28 22:02:09 +02:00

46 lines
1.1 KiB
JavaScript

import {Calendar, DatePicker} from 'v-calendar';
import components from './components'
const App = {
el: '#app',
delimiters: ['[[', ']]'],
components: {
...components,
...{
VCalendar: Calendar,
VDatepicker: DatePicker
},
},
computed: {
player() { return window.aircox.player; },
},
methods: {
//! Delete elements from DOM using provided selector.
deleteElements(sel) {
for(var el of document.querySelectorAll(sel))
el.parentNode.removeChild(el)
},
//! File has been selected
//! TODO: replace using regular ref and bindings.
fileSelected(select, input, preview) {
const item = this.$refs[select].item
if(item) {
this.$refs[input].value = item.id
if(preview)
preview.src = item.file
}
},
}
}
export const PlayerApp = {
el: '#player',
delimiters: ['[[', ']]'],
components: {...components},
}
export default App