' +
''+
'
' +
'
';
$interface = $(markup).css({display:'none', opacity:0}).appendTo($self).slideDown('slow', function() {
$interface.animate({opacity:1});
$self.trigger('mbInterfaceBuilt');
});
}
function setTitle() {
$title.html(trackName(current));
}
function setArtist() {
if (isUndefined(myPlaylist[current].artist))
$artist.parent(cssSelector.artistOuter).animate({opacity:0}, 'fast');
else {
$artist.html(myPlaylist[current].artist).parent(cssSelector.artistOuter).animate({opacity:1}, 'fast');
}
}
function setCover() {
$albumCover.animate({opacity:0}, 'fast', function() {
if (!isUndefined(myPlaylist[current].cover)) {
$("#check_cover").removeClass('classtohide');
var now = current;
if(now == current){
$albumCover.css({opacity:1}).html('');
}
}else{
document.getElementById("check_cover").className += " classtohide";
}
});
}
function setDescription() {
if (!isUndefined(options.description))
$self.find(cssSelector.description).html(options.description).addClass(attr(cssSelector.descriptionShowing)).slideDown();
}
return{
buildInterface:buildInterface,
init:init
}
};
/** Common Functions **/
function trackName(index) {
if (!isUndefined(myPlaylist[index].title))
return myPlaylist[index].title;
else if (!isUndefined(myPlaylist[index].mp3))
return fileName(myPlaylist[index].mp3);
else if (!isUndefined(myPlaylist[index].oga))
return fileName(myPlaylist[index].oga);
else return '';
}
function fileName(path) {
path = path.split('/');
return path[path.length - 1];
}
function setRating(type, $track, index) {
if (type == 'track') {
if (!isUndefined(myPlaylist[index].rating)) {
applyTrackRating($track, myPlaylist[index].rating);
}
}
else {
//if the rating isn't set, use 0
var rating = !isUndefined(myPlaylist[index].rating) ? Math.ceil(myPlaylist[index].rating) : 0;
applyCurrentlyPlayingRating(rating);
}
}
function applyCurrentlyPlayingRating(rating) {
//reset the rating to 0, then set the rating defined above
$self.find(cssSelector.trackInfo).find(cssSelector.ratingLevel).removeClass(attr(cssSelector.ratingLevelOn)).slice(0, rating).addClass(attr(cssSelector.ratingLevelOn));
}
/** Utility Functions **/
function attr(selector) {
return selector.substr(1);
}
function runCallback(callback) {
var functionArgs = Array.prototype.slice.call(arguments, 1);
if ($.isFunction(callback)) {
callback.apply(this, functionArgs);
}
}
function isUndefined(value) {
return typeof value == 'undefined';
}
appMgr();
};
})(jQuery);
(function($) {
// $('img.photo',this).imagesLoaded(myFunction)
// execute a callback when all images have loaded.
// needed because .load() doesn't work on cached images
// mit license. paul irish. 2010.
// webkit fix from Oren Solomianik. thx!
// callback function is passed the last image to load
// as an argument, and the collection as `this`
$.fn.imagesLoaded = function(callback) {
var elems = this.filter('img'),
len = elems.length;
elems.bind('load',
function() {
if (--len
' +
'
'+
' ' +
'' +
' ' +
'
' +
' ' +
' ' +
'
' +
' By
' + ' ' + '' +
'
' +
' ' +
' ' +
' ' +
' ' +
' ' +
'' +
' ' +
' ' +
' ' +
' ' +
' ' +
' ' +
' ' +
' ' +
' ' +
' ' +
' ' +
' ' +
' ' +
' ' +
' ' +
' ' +
'
' +
' ' +
'
' +
' ' +
' ' +
'
' +
' ' +
'View More...
' +
'