diff options
Diffstat (limited to 'public/assets/js/lib/views')
| -rw-r--r-- | public/assets/js/lib/views/details/audio.js | 2 | ||||
| -rw-r--r-- | public/assets/js/lib/views/details/files.js | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/public/assets/js/lib/views/details/audio.js b/public/assets/js/lib/views/details/audio.js index 0f16dc7..c876520 100644 --- a/public/assets/js/lib/views/details/audio.js +++ b/public/assets/js/lib/views/details/audio.js @@ -17,7 +17,7 @@ var audio = (function(){ music = [] var links = document.querySelectorAll("a") Array.prototype.slice.apply(links).forEach(function(link){ - if (! link.href.match(/\.(mp3|wav|ogg)$/)) return + if (! link.href.match(/\.(mp3|wav|ogg|opus)$/)) return link.dataset.index = music.length music.push(link) if (playing && link.href === el.src) { diff --git a/public/assets/js/lib/views/details/files.js b/public/assets/js/lib/views/details/files.js index b6f1794..3c7f84f 100644 --- a/public/assets/js/lib/views/details/files.js +++ b/public/assets/js/lib/views/details/files.js @@ -25,7 +25,7 @@ var FilesView = FormView.extend({ // return } total += file.size - has_music = has_music || file.filename.match(/(mp3|wav|ogg)/i) + has_music = has_music || file.filename.match(/(mp3|wav|ogg|opus)$/i) }.bind(this)) this.total = total @@ -137,7 +137,7 @@ var FilesView = FormView.extend({ pick: function(e){ if (e.ctrlKey || e.altKey || e.metaKey || e.shiftKey) return - if (! e.target.href || ! e.target.href.match(/(mp3|wav|ogg)/i)) return + if (! e.target.href || ! e.target.href.match(/(mp3|wav|ogg|opus)$/i)) return e.preventDefault() audio.play( e.target.dataset.index ) // index set in audio.js }, |
