mblinks: display icon for places

This commit is contained in:
Laurent Monin 2015-06-11 15:30:39 +02:00
parent 255e933379
commit 08046d1b09

View file

@ -66,6 +66,9 @@ var MBLinks = function (user_cache_key, expiration) {
release_group: {
title: 'See this release group on MusicBrainz',
},
place: {
img_src: '<img src="'+ this.mb_server + '/static/images/entity/place_lg.png" height=16 width=16 />'
}
}
this.initAjaxEngine = function () {
@ -146,13 +149,15 @@ var MBLinks = function (user_cache_key, expiration) {
this.createMusicBrainzLink = function (mb_url, _type) {
var title = 'See this ' + _type + ' on MusicBrainz';
var img_url = this.mb_server + '/static/images/entity/' + _type + '.png';
var img_src = '<img src="' + img_url + '" height=16 width=16 />';
// handle overrides
var ti = this.type_link_info[_type];
if (ti) {
if (ti.title) title = ti.title;
if (ti.img_url) img_url = ti.img_url;
if (ti.img_src) img_src = ti.img_src;
}
return '<a href="' + mb_url + '" title="' + title + '"><img src="' + img_url + '"/></a> ';
return '<a href="' + mb_url + '" title="' + title + '">' + img_src + '</a> ';
};
// Search for ressource 'url' on MB, for relation of type 'mb_type' (artist, release, label, release-group, ...)