sdk: add encodeURIComponent() to getters, add getThumbnailURL(), add thumbnail.* constants
This commit is contained in:
parent
366c307e02
commit
79cb8733e5
@ -65,13 +65,24 @@ var contented = (function() {
|
|||||||
},
|
},
|
||||||
|
|
||||||
"getPreviewURL": function(id) {
|
"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) {
|
"getDownloadURL": function(id) {
|
||||||
return baseURL + "get/" + id;
|
return baseURL + "get/" + encodeURIComponent(id);
|
||||||
},
|
},
|
||||||
"getInfoJSONURL": function(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"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user