kopia lustrzana https://github.com/backface/turtlestitch
added withThumbnail param to project list fetch methods
rodzic
c24e499ba9
commit
15729044b7
16
cloud.js
16
cloud.js
|
@ -330,19 +330,29 @@ Cloud.prototype.saveProject = function (ide, onSuccess, onError) {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
Cloud.prototype.getProjectList = function (onSuccess, onError) {
|
Cloud.prototype.getProjectList = function (onSuccess, onError, withThumbnail) {
|
||||||
|
var path = '/projects/%username';
|
||||||
|
|
||||||
|
if (withThumbnail) {
|
||||||
|
path += '?withthumbnail=true';
|
||||||
|
}
|
||||||
|
|
||||||
this.withCredentialsRequest(
|
this.withCredentialsRequest(
|
||||||
'GET',
|
'GET',
|
||||||
'/projects/%username',
|
path,
|
||||||
onSuccess,
|
onSuccess,
|
||||||
onError,
|
onError,
|
||||||
'Could not fetch projects'
|
'Could not fetch projects'
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
Cloud.prototype.getPublishedProjectList = function (username, page, pageSize, searchTerm, onSuccess, onError) {
|
Cloud.prototype.getPublishedProjectList = function (username, page, pageSize, searchTerm, onSuccess, onError, withThumbnail) {
|
||||||
var path = '/projects' + (username ? '/' + username : '') + '?ispublished=true';
|
var path = '/projects' + (username ? '/' + username : '') + '?ispublished=true';
|
||||||
|
|
||||||
|
if (withThumbnail) {
|
||||||
|
path += '&withthumbnail=true';
|
||||||
|
}
|
||||||
|
|
||||||
if (page) {
|
if (page) {
|
||||||
path += '&page=' + page + '&pagesize=' + (pageSize || 16);
|
path += '&page=' + page + '&pagesize=' + (pageSize || 16);
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue