';
$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)) {
var now = current;
if(now == current)
$albumCover.css({opacity:1}).html('');
}
});
}
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));
}
function applyTrackRating($track, rating) {
//multiply rating by 2 since the list ratings have 10 levels rather than 5
$track.find(cssSelector.ratingLevel).removeClass(attr(cssSelector.ratingLevelOn)).slice(0, rating * 2).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
2015 marks the 45th anniversary of the iconic record Funky Drummer. Soul Brother #1 and others reflect on the iconic tune and it’s importance to Hip Hop. Click Link for…
Are You Ready For Another Treat from Pete Rock? Once a month Pete Rock and his favorite guest DJ alongside Deadly Dragon Sound will play the finest in Soul, Reggae &…
Erik Parker, One 9 & Nas film documentary, Time Is Illmatic, takes you into the heart of Nas’ creative process for his groundbreaking and undisputed classic debut (Illmatic) and it is a…