Skip to content

Instantly share code, notes, and snippets.

@ApeKattQuest-MonkeyPython
Last active June 7, 2024 22:23
Show Gist options
  • Save ApeKattQuest-MonkeyPython/2a687046edf1949ff3f266eb6211d791 to your computer and use it in GitHub Desktop.
Save ApeKattQuest-MonkeyPython/2a687046edf1949ff3f266eb6211d791 to your computer and use it in GitHub Desktop.
edit rels move.user.js
// ==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