First implementation of tool tester

This commit is contained in:
jdescottes
2014-08-21 00:50:59 +02:00
parent 34dbcedec3
commit 1955d3f8f5
12 changed files with 422 additions and 30 deletions

View File

@@ -39,7 +39,10 @@
};
ns.ImportController.prototype.onOpenPiskelChange_ = function (evt) {
this.openPiskelFile_();
var files = this.hiddenOpenPiskelInput.get(0).files;
if (files.length == 1) {
this.openPiskelFile_(files[0]);
}
};
ns.ImportController.prototype.onOpenPiskelClick_ = function (evt) {
@@ -51,19 +54,14 @@
this.closeDrawer_();
};
ns.ImportController.prototype.openPiskelFile_ = function () {
var files = this.hiddenOpenPiskelInput.get(0).files;
if (files.length == 1) {
var file = files[0];
if (this.isPiskel_(file)){
pskl.utils.PiskelFileUtils.loadFromFile(file, function (piskel, descriptor, fps) {
piskel.setDescriptor(descriptor);
pskl.app.piskelController.setPiskel(piskel);
pskl.app.animationController.setFPS(fps);
});
this.closeDrawer_();
}
ns.ImportController.prototype.openPiskelFile_ = function (file) {
if (this.isPiskel_(file)){
pskl.utils.PiskelFileUtils.loadFromFile(file, function (piskel, descriptor, fps) {
piskel.setDescriptor(descriptor);
pskl.app.piskelController.setPiskel(piskel);
pskl.app.animationController.setFPS(fps);
});
this.closeDrawer_();
}
};