mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2025-03-04 22:37:16 +00:00
Merge pull request #36 from zas/bci_helper
New script for Bandcamp that displays the link to the current album when not on an bandcamp /album/ page.
This commit is contained in:
commit
6b76728d75
1 changed files with 27 additions and 0 deletions
27
bandcamp_importer_helper.user.js
Normal file
27
bandcamp_importer_helper.user.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
// ==UserScript==
|
||||
// @name Bandcamp Importer Album Link Helper
|
||||
// @version 2015.05.19.0
|
||||
// @namespace http://userscripts.org/users/22504
|
||||
// @downloadURL https://raw.github.com/murdos/musicbrainz-userscripts/master/bandcamp_importer_helper.user.js
|
||||
// @updateURL https://raw.github.com/murdos/musicbrainz-userscripts/master/bandcamp_importer_helper.user.js
|
||||
// @include http*://*.bandcamp.com/
|
||||
// @include http*://*.bandcamp.com/releases
|
||||
// @exclude http*://*.bandcamp.com/*/*
|
||||
// @grant none
|
||||
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js
|
||||
// @require https://raw.github.com/murdos/musicbrainz-userscripts/master/lib/logger.js
|
||||
// ==/UserScript==
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
// Display a link to the correct album bandcamp url (ie. main page or releases page)
|
||||
// search for the rss feed link and use it to build the current album url
|
||||
rssurl = $("#rssFeedAlbum").attr('href');
|
||||
if (typeof rssurl !== "undefined" && rssurl.indexOf('/feed/album/') !== -1) {
|
||||
albumurl = rssurl.replace('/feed/', '/');
|
||||
innerHTML = '<div id="bci_helper" style="padding-top: 5px;"><a href="' + albumurl + '" title="Load album page and display Import to MB button">Album page (MB import)</a></div>';
|
||||
$('#name-section').append(innerHTML);
|
||||
}
|
||||
});
|
||||
|
Loading…
Add table
Reference in a new issue