mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Fixed mime type bug on Firefox
This commit is contained in:
parent
e5cb0717e2
commit
aa375315a2
@ -24,6 +24,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.png-export-preview img {
|
.png-export-preview img {
|
||||||
|
max-height:32px;
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,9 +2,17 @@
|
|||||||
var ns = $.namespace('pskl.utils');
|
var ns = $.namespace('pskl.utils');
|
||||||
|
|
||||||
ns.PiskelFileUtils = {
|
ns.PiskelFileUtils = {
|
||||||
|
/**
|
||||||
|
* Load a piskel from a piskel file.
|
||||||
|
* After deserialization is successful, the provided success callback will be called.
|
||||||
|
* Success callback is expected to handle 3 arguments : (piskel:Piskel, descriptor:PiskelDescriptor, fps:Number)
|
||||||
|
* @param {File} file the .piskel file to load
|
||||||
|
* @param {Function} onSuccess Called if the deserialization of the piskel is successful
|
||||||
|
* @param {Function} onError NOT USED YET
|
||||||
|
*/
|
||||||
loadFromFile : function (file, onSuccess, onError) {
|
loadFromFile : function (file, onSuccess, onError) {
|
||||||
pskl.utils.FileUtils.readFile(file, function (content) {
|
pskl.utils.FileUtils.readFile(file, function (content) {
|
||||||
var rawPiskel = window.atob(content.replace('data:;base64,',''));
|
var rawPiskel = window.atob(content.replace(/data\:.*?\;base64\,/,''));
|
||||||
var serializedPiskel = JSON.parse(rawPiskel);
|
var serializedPiskel = JSON.parse(rawPiskel);
|
||||||
var fps = serializedPiskel.piskel.fps;
|
var fps = serializedPiskel.piskel.fps;
|
||||||
var descriptor = new pskl.model.piskel.Descriptor(serializedPiskel.piskel.name, serializedPiskel.piskel.description, true);
|
var descriptor = new pskl.model.piskel.Descriptor(serializedPiskel.piskel.name, serializedPiskel.piskel.description, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user