mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2025-03-17 23:16:56 +00:00
mblinks: display icon for places
This commit is contained in:
parent
255e933379
commit
08046d1b09
1 changed files with 6 additions and 1 deletions
|
@ -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, ...)
|
||||
|
|
Loading…
Add table
Reference in a new issue