mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2024-12-14 04:12:28 +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==
|
// ==UserScript==
|
||||||
// @name Display shortcut for relationships on MusicBrainz
|
// @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.
|
// @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>
|
// @author Aurelien Mino <aurelien.mino@gmail.com>
|
||||||
// @licence GPL (http://www.gnu.org/copyleft/gpl.html)
|
// @licence GPL (http://www.gnu.org/copyleft/gpl.html)
|
||||||
// @downloadURL https://raw.github.com/murdos/musicbrainz-userscripts/master/mb_relationship_shortcuts.user.js
|
// @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 targettype = $(this).attr("target-type").replace("release_group", "release-group");
|
||||||
var relations = {};
|
var relations = {};
|
||||||
|
|
||||||
|
if (relationsIconsURLs[targettype] === undefined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$(this).children("relation").each(function() {
|
$(this).children("relation").each(function() {
|
||||||
var reltype = $(this).attr("type");
|
var reltype = $(this).attr("type");
|
||||||
var target = $(this).children("target").text();
|
var target = $(this).children("target").text();
|
||||||
|
|
Loading…
Reference in a new issue