nextcloud/apps/media/js/music.js

42 lines
1.1 KiB
JavaScript
Raw Normal View History

$(document).ready(function(){
//load the collection
$('#plugins a[href="#collection"]').click(function(){
$('#plugins li.subentry a.active').removeClass('active');
$(this).addClass('active');
PlayList.hide();
Collection.display();
});
$('#plugins a[href="#playlist"]').click(function(){
$('#plugins li.subentry a.active').removeClass('active');
$(this).addClass('active');
PlayList.render();
Collection.hide();
2011-07-22 08:30:52 +04:00
});
var tab=window.location.href.slice(window.location.href.indexOf('#') + 1);
if(tab=='collection'){
$('#plugins a[href="#collection"]').trigger('click');
}
});
2011-07-22 08:30:52 +04:00
2011-07-22 08:30:52 +04:00
function getUrlVars(){
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('#') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = decodeURIComponent(hash[1]).replace(/\+/g,' ');
}
return vars;
}
function musicTypeFromFile(file){
var extention=file.split('.').pop();
if(extention=='ogg'){
return 'oga'
}
//TODO check for more specific cases
return extention;
2011-07-22 08:30:52 +04:00
}