mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-03 02:09:28 +01:00
Moved all of the ajax functions over to use the cache rather than last.fm/amazon
This commit is contained in:
@@ -15,7 +15,7 @@ function getThumb(imgElem,id,type) {
|
||||
else {
|
||||
var imageUrl = data;
|
||||
}
|
||||
$(imgElem).attr("src",imageUrl).removeAttr("width").removeAttr("height").hide().fadeIn();
|
||||
$(imgElem).attr("src",imageUrl).hide().fadeIn();
|
||||
$(imgElem).wrap('<a href="'+ imageLarge +'" rel="dialog" title="' + name + '"></a>');
|
||||
}
|
||||
});
|
||||
@@ -51,17 +51,37 @@ function getInfo(elem,id,type) {
|
||||
} else {
|
||||
var infoURL = "getInfo?AlbumID=" + id;
|
||||
}
|
||||
// Get Data from the cache by Artist ID
|
||||
// Get Data from the cache by ID
|
||||
$.ajax({
|
||||
url: infoURL,
|
||||
data_type: "jsonp",
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
var summary = data['Summary'];
|
||||
var summary = data.Summary;
|
||||
$(elem).append(summary);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getImageLinks(elem,id,type) {
|
||||
|
||||
if ( type == 'artist' ) {
|
||||
var infoURL = "getImageLinks?ArtistID=" + id;
|
||||
} else {
|
||||
var infoURL = "getImageLinks?AlbumID=" + id;
|
||||
}
|
||||
// Get Data from the cache by ID
|
||||
$.ajax({
|
||||
url: infoURL,
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
var thumbnail = data.thumbnail;
|
||||
var artwork = data.artwork;
|
||||
|
||||
$(elem).attr("src", thumbnail);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getOriginalWidthOfImg(img_element) {
|
||||
var t = new Image();
|
||||
t.src = (img_element.getAttribute ? img_element.getAttribute("src") : false) || img_element.src;
|
||||
|
||||
Reference in New Issue
Block a user