sdk: add encodeURIComponent() to getters, add getThumbnailURL(), add thumbnail.* constants

This commit is contained in:
mappu 2017-11-18 13:32:47 +13:00
parent 366c307e02
commit 79cb8733e5

View File

@ -65,13 +65,24 @@ var contented = (function() {
},
"getPreviewURL": function(id) {
return baseURL + "get/" + id; // n.b. there's no better preview URL yet
return baseURL + "get/" + encodeURIComponent(id); // n.b. there's no better preview URL yet
},
"getDownloadURL": function(id) {
return baseURL + "get/" + id;
return baseURL + "get/" + encodeURIComponent(id);
},
"getInfoJSONURL": function(id) {
return baseURL + "info/" + id;
return baseURL + "info/" + encodeURIComponent(id);
},
"getThumbnailURL": function(thumbnailType, id) {
return baseURL + "thumb/" + encodeURIComponent(thumbnailType) + "/" + encodeURIComponent(id);
},
"thumbnail": {
"small_square": "s",
"medium_square": "b",
"medium": "t",
"large": "m",
"xlarge": "l",
"xxlarge": "h"
}
};