Last active
June 7, 2024 22:23
-
-
Save ApeKattQuest-MonkeyPython/2a687046edf1949ff3f266eb6211d791 to your computer and use it in GitHub Desktop.
edit rels move.user.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name edit rels move | |
// @namespace blup | |
// @include *.musicbrainz.org/* | |
// @include *musicbrainz.org/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
// Shamelessly copied from https://github.com/murdos/musicbrainz-userscripts/blob/master/mb_ui_enhancements.user.js | |
// Shamelessly edited by MonkeyPython | |
// Display "Annotation" link for any entity | |
re = new RegExp("musicbrainz\.org\/(.*)\/([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})","i"); | |
var matches = window.location.href.match(re); | |
if (matches) { | |
var type = matches[1] | |
var mbid = matches[2]; | |
$('ul.tabs').append('<li><a href="/' + type + '/' + mbid + '/edit_annotation">Annotation</a></li>'); | |
} | |
// Display "Edit history" link for any entity after the "Edit rels" link? | |
re = new RegExp("musicbrainz\.org\/(.*)\/([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})","i"); | |
var matches = window.location.href.match(re); | |
if (matches) { | |
var type = matches[1] | |
var mbid = matches[2]; | |
$('ul.tabs').append('<li><a href="/' + type + '/' + mbid + '/edits">Edit history</a></li>'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment