mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2024-12-14 12:22:26 +00:00
Merge pull request #29 from VxJasonxV/discogs-updates
removes GreaseMonkey's JQuery, uses pure json instead of JSON-P
This commit is contained in:
commit
5424744063
1 changed files with 2 additions and 10 deletions
|
@ -45,14 +45,9 @@ $(document).ready(function(){
|
||||||
var discogsReleaseId = window.location.href.match( /discogs\.com\/(.*\/?)release\/(\d+)$/)[2];
|
var discogsReleaseId = window.location.href.match( /discogs\.com\/(.*\/?)release\/(\d+)$/)[2];
|
||||||
var discogsWsUrl = 'http://api.discogs.com/releases/' + discogsReleaseId;
|
var discogsWsUrl = 'http://api.discogs.com/releases/' + discogsReleaseId;
|
||||||
|
|
||||||
// Swith JQuery to MB's one, and save GreaseMonkey one
|
|
||||||
var GM_JQuery = $;
|
|
||||||
$ = unsafeWindow.$;
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: discogsWsUrl,
|
url: discogsWsUrl,
|
||||||
dataType: 'jsonp',
|
dataType: 'json',
|
||||||
headers: { 'Accept-Encoding': 'gzip', 'User-Agent': 'MBDiscosgImporter/0.1 +http://userscripts.org/scripts/show/36376' },
|
|
||||||
crossDomain: true,
|
crossDomain: true,
|
||||||
success: function (data, textStatus, jqXHR) {
|
success: function (data, textStatus, jqXHR) {
|
||||||
//mylog(data);
|
//mylog(data);
|
||||||
|
@ -65,9 +60,6 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Back to GreaseMonkey's JQuery
|
|
||||||
$ = GM_JQuery;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -245,7 +237,7 @@ function insertLink(release) {
|
||||||
// Analyze Discogs data and return a release object
|
// Analyze Discogs data and return a release object
|
||||||
function parseDiscogsRelease(data) {
|
function parseDiscogsRelease(data) {
|
||||||
|
|
||||||
var discogsRelease = data.data;
|
var discogsRelease = data;
|
||||||
|
|
||||||
var release = new Object();
|
var release = new Object();
|
||||||
release.discs = [];
|
release.discs = [];
|
||||||
|
|
Loading…
Reference in a new issue