mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Additional fix to be inline with what APP Engine expects
This commit is contained in:
parent
b42f896584
commit
2deaf00911
23
js/piskel.js
23
js/piskel.js
|
@ -178,34 +178,33 @@
|
||||||
formData.append('name', $('#piskel-name').val());
|
formData.append('name', $('#piskel-name').val());
|
||||||
formData.append('frames', frameSheet.getFrameCount());
|
formData.append('frames', frameSheet.getFrameCount());
|
||||||
// Get image/png data for first frame
|
// Get image/png data for first frame
|
||||||
|
|
||||||
formData.append('preview', this.getFirstFrameAsPNGData_());
|
formData.append('preview', this.getFirstFrameAsPNGData_());
|
||||||
|
|
||||||
|
var imageData = (new pskl.rendering.SpritesheetRenderer(frameSheet)).renderAsImageDataSpritesheetPNG();
|
||||||
|
formData.append('framesheet', imageData);
|
||||||
|
|
||||||
xhr.open('POST', "save", true);
|
xhr.open('POST', "save", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
xhr.onload = function (e) {
|
xhr.onload = function(e) {
|
||||||
if (this.status == 200) {
|
if (this.status == 200) {
|
||||||
if (pskl.app.isStaticVersion) {
|
if (pskl.app.isStaticVersion) {
|
||||||
var baseUrl = window.location.href.replace(window.location.search, "");
|
var baseUrl = window.location.href.replace(window.location.search, "");
|
||||||
window.location.href = baseUrl + "?frameId=" + this.responseText;
|
window.location.href = baseUrl + "?frameId=" + this.responseText;
|
||||||
} else {
|
} else {
|
||||||
$.publish(Events.SHOW_NOTIFICATION, [{
|
$.publish(Events.SHOW_NOTIFICATION, [{"content": "Successfully saved !"}]);
|
||||||
"content" : "Successfully saved !"
|
|
||||||
}]);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.onerror(e);
|
this.onerror(e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
xhr.onerror = function (e) {
|
xhr.onerror = function(e) {
|
||||||
$.publish(Events.SHOW_NOTIFICATION, [{
|
$.publish(Events.SHOW_NOTIFICATION, [{"content": "Saving failed ("+this.status+")"}]);
|
||||||
"content" : "Saving failed (" + this.status + ")"
|
|
||||||
}]);
|
|
||||||
};
|
};
|
||||||
xhr.send(formData);
|
xhr.send(formData);
|
||||||
|
|
||||||
if (event) {
|
if(event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user