mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2024-12-13 11:52:27 +00:00
Merge pull request #165 from yvanzo/patch-2
Check target type in shorcut for relationships
This commit is contained in:
commit
2a2bf1a3cc
1 changed files with 5 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
|||
// ==UserScript==
|
||||
// @name Display shortcut for relationships on MusicBrainz
|
||||
// @description Display icon shortcut for relationships of release-group, release, recording and work: e.g. Amazon, Discogs, Wikipedia, ... links. This allows to access some relationships without opening the entity page.
|
||||
// @version 2017.11.12.1
|
||||
// @version 2018.02.11.0
|
||||
// @author Aurelien Mino <aurelien.mino@gmail.com>
|
||||
// @licence GPL (http://www.gnu.org/copyleft/gpl.html)
|
||||
// @downloadURL https://raw.github.com/murdos/musicbrainz-userscripts/master/mb_relationship_shortcuts.user.js
|
||||
|
@ -143,6 +143,10 @@ $(document).ready(function(){
|
|||
var targettype = $(this).attr("target-type").replace("release_group", "release-group");
|
||||
var relations = {};
|
||||
|
||||
if (relationsIconsURLs[targettype] === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
$(this).children("relation").each(function() {
|
||||
var reltype = $(this).attr("type");
|
||||
var target = $(this).children("target").text();
|
||||
|
|
Loading…
Reference in a new issue