made sure project thumbnails are normalized when saved

upd4.2
Jens Mönig 2018-02-08 23:43:16 +01:00
rodzic d9355f4adf
commit 1a855f81ed
2 zmienionych plików z 12 dodań i 5 usunięć

Wyświetl plik

@ -29,7 +29,8 @@
// Global settings ///////////////////////////////////////////////////// // Global settings /////////////////////////////////////////////////////
/*global modules, SnapSerializer, nop, hex_sha512, DialogBoxMorph, Color*/ /*global modules, SnapSerializer, nop, hex_sha512, DialogBoxMorph, Color,
normalizeCanvas*/
modules.cloud = '2018-February-08'; modules.cloud = '2018-February-08';
@ -320,8 +321,10 @@ Cloud.prototype.saveProject = function (ide, onSuccess, onError) {
function (username) { function (username) {
if (username) { if (username) {
var xml = ide.serializer.serialize(ide.stage), var xml = ide.serializer.serialize(ide.stage),
thumbnail = ide.stage.thumbnail( thumbnail = normalizeCanvas(
SnapSerializer.prototype.thumbnailSize).toDataURL(), ide.stage.thumbnail(
SnapSerializer.prototype.thumbnailSize
)).toDataURL(),
body, mediaSize, size; body, mediaSize, size;
ide.serializer.isCollectingMedia = true; ide.serializer.isCollectingMedia = true;
@ -452,8 +455,11 @@ Cloud.prototype.getThumbnail = function (
) { ) {
this[username ? 'request' : 'withCredentialsRequest']( this[username ? 'request' : 'withCredentialsRequest'](
'GET', 'GET',
'/projects/' + (username || '%username') + '/' '/projects/' +
+ projectName + '/thumbnail', (username || '%username') +
'/' +
projectName +
'/thumbnail',
onSuccess, onSuccess,
onError, onError,
'Could not fetch thumbnail', 'Could not fetch thumbnail',

Wyświetl plik

@ -3939,6 +3939,7 @@ Translation Updates:
* Cloud, GUI, Widgets: New Cloud API, thanks, Bernat! * Cloud, GUI, Widgets: New Cloud API, thanks, Bernat!
* GUI: fixed a url-bar refresh bug introduced by the new cloud mechanism * GUI: fixed a url-bar refresh bug introduced by the new cloud mechanism
* GUI: made sure user names are lower case when sent to the cloud * GUI: made sure user names are lower case when sent to the cloud
* Cloud: made sure project thumbnails are normalized when saved
=== v4.1.2 features === === v4.1.2 features ===