Index: trunk/extensions/UploadWizard/UploadWizardHooks.php |
— | — | @@ -60,6 +60,7 @@ |
61 | 61 | 'resources/mw.ApiUploadHandler.js', |
62 | 62 | 'resources/mw.DestinationChecker.js', |
63 | 63 | 'resources/mw.UploadWizardUtil.js', |
| 64 | + 'resources/mw.FlickrChecker.js', |
64 | 65 | |
65 | 66 | // interface libraries |
66 | 67 | 'resources/mw.GroupProgressBar.js', |
Index: trunk/extensions/UploadWizard/resources/mw.FlickrChecker.js |
— | — | @@ -1,4 +1,4 @@ |
2 | | -( function( mw ) { |
| 2 | +( function( mw, $ ) { |
3 | 3 | |
4 | 4 | mw.FlickrChecker = { |
5 | 5 | |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | var photoIdMatches = url.match(/flickr.com\/photos\/[^\/]+\/([0-9]+)/); |
38 | 38 | if ( photoIdMatches && photoIdMatches[1] > 0 ) { |
39 | 39 | var photoId = photoIdMatches[1]; |
40 | | - $.getJSON(this.apiUrl+'&method=flickr.photos.getInfo&api_key='+this.apiKey+'&photo_id='+photoId+'&format=json&jsoncallback=?', |
| 40 | + $.getJSON( this.apiUrl + '?jsoncallback=?', { 'method': 'flickr.photos.getInfo', 'api_key': this.apiKey, 'photo_id': photoId, 'format': 'json' }, |
41 | 41 | function( data ) { |
42 | 42 | if ( typeof data.photo != 'undefined' ) { |
43 | 43 | // The returned data.photo.license is just an ID that we use to look up the license name |
— | — | @@ -50,6 +50,7 @@ |
51 | 51 | } else { |
52 | 52 | var licenseMessage = gM( 'mwe-upwiz-license-external', 'Flickr', licenseName ); |
53 | 53 | } |
| 54 | + // XXX Do something with data. |
54 | 55 | } |
55 | 56 | } |
56 | 57 | } |
— | — | @@ -58,10 +59,10 @@ |
59 | 60 | }, |
60 | 61 | |
61 | 62 | /** |
62 | | - * Retrieve the list of all current Flickr licenses and store it in an array (mw.FlickrChecker.licenses) |
| 63 | + * Retrieve the list of all current Flickr licenses and store it in an array (mw.FlickrChecker.licenseList) |
63 | 64 | */ |
64 | 65 | getLicenses: function() { |
65 | | - $.getJSON(this.apiUrl+'&method=flickr.photos.licenses.getInfo&api_key='+this.apiKey+'&format=json&jsoncallback=?', |
| 66 | + $.getJSON( this.apiUrl + '?jsoncallback=?', { 'method': 'flickr.photos.licenses.getInfo', 'api_key': this.apiKey, 'format': 'json' }, |
66 | 67 | function( data ) { |
67 | 68 | if ( typeof data.licenses != 'undefined' ) { |
68 | 69 | $.each( data.licenses.license, function(index, value) { |