r87021 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87020‎ | r87021 | r87022 >
Date:17:43, 27 April 2011
Author:kaldari
Status:ok (Comments)
Tags:
Comment:
fixing a license, better regex checking
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.FlickrChecker.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.FlickrChecker.js
@@ -16,7 +16,7 @@
1717 'Attribution License': '{{flickrreview}}{{cc-by-2.0}}',
1818 'Attribution-ShareAlike License': '{{flickrreview}}{{cc-by-sa-2.0}}',
1919 'Attribution-NoDerivs License': 'invalid',
20 - 'No known copyright restrictions': '{{flickrreview}}{{PD-Old}}',
 20+ 'No known copyright restrictions': '{{flickrreview}}{{Flickr-no known copyright restrictions}}',
2121 'United States Government Work': '{{flickrreview}}{{PD-USGov}}'
2222 },
2323
@@ -30,8 +30,8 @@
3131 * @param upload - the upload object to set the deed for
3232 */
3333 checkFlickr: function( url, $selector, upload ) {
34 - if ( url.search(/http:\/\/(www.)?flickr.com\/photos\//) !== -1 ) {
35 - photoIdMatches = url.match(/photos\/[^\/]+\/([0-9]+)/);
 34+ photoIdMatches = url.match(/flickr.com\/photos\/[^\/]+\/([0-9]+)/);
 35+ if ( photoIdMatches && photoIdMatches[1] > 0 ) {
3636 photoId = photoIdMatches[1];
3737 $.getJSON(this.apiUrl+'&method=flickr.photos.getInfo&api_key='+this.apiKey+'&photo_id='+photoId+'&format=json&jsoncallback=?',
3838 function( data ) {
@@ -55,8 +55,6 @@
5656 $.each( data.licenses.license, function(index, value) {
5757 mw.FlickrChecker.licenseList[value.id] = value.name;
5858 } );
59 - console.debug(mw.FlickrChecker.licenseList);
60 - console.debug(mw.FlickrChecker.licenseMaps);
6159 }
6260 }
6361 );

Comments

#Comment by NeilK (talk | contribs)   20:14, 27 April 2011

this is ok, as long as fixmes for other revs are fixed

Status & tagging log