|
|
|
|
@ -2,10 +2,20 @@ |
|
|
|
|
class CustomSounds { |
|
|
|
|
constructor() { |
|
|
|
|
this.list = new ReactiveVar({}); |
|
|
|
|
this.add({ _id: 'beep', name: 'Beep', extension: 'mp3', src: '/sounds/beep.mp3' }); |
|
|
|
|
this.add({ _id: 'chelle', name: 'Chelle', extension: 'mp3', src: '/sounds/chelle.mp3' }); |
|
|
|
|
this.add({ _id: 'chime', name: 'Chime', extension: 'mp3', src: '/sounds/chime.mp3' }); |
|
|
|
|
this.add({ _id: 'ding', name: 'Ding', extension: 'mp3', src: '/sounds/ding.mp3' }); |
|
|
|
|
this.add({ _id: 'door', name: 'Door', extension: 'mp3', src: '/sounds/door.mp3' }); |
|
|
|
|
this.add({ _id: 'droplet', name: 'Droplet', extension: 'mp3', src: '/sounds/droplet.mp3' }); |
|
|
|
|
this.add({ _id: 'highbell', name: 'Highbell', extension: 'mp3', src: '/sounds/highbell.mp3' }); |
|
|
|
|
this.add({ _id: 'seasons', name: 'Seasons', extension: 'mp3', src: '/sounds/seasons.mp3' }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
add(sound) { |
|
|
|
|
sound.src = this.getURL(sound); |
|
|
|
|
if (!sound.src) { |
|
|
|
|
sound.src = this.getURL(sound); |
|
|
|
|
} |
|
|
|
|
const audio = $('<audio />', { id: sound._id, preload: true }).append( |
|
|
|
|
$('<source />', { src: sound.src }) |
|
|
|
|
); |
|
|
|
|
@ -41,7 +51,8 @@ class CustomSounds { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getList() { |
|
|
|
|
return Object.values(this.list.get()); |
|
|
|
|
const list = Object.values(this.list.get()); |
|
|
|
|
return _.sortBy(list, 'name'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|