mirror of
				https://github.com/piskelapp/piskel.git
				synced 2023-08-10 21:12:52 +03:00 
			
		
		
		
	cleanup unused arguments in PiskelFileUtils
This commit is contained in:
		@@ -5,7 +5,7 @@
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * Load a piskel from a piskel file.
 | 
					     * Load a piskel from a piskel file.
 | 
				
			||||||
     * After deserialization is successful, the provided success callback will be called.
 | 
					     * 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)
 | 
					     * Success callback is expected to receive a single Piskel object argument
 | 
				
			||||||
     * @param  {File} file the .piskel file to load
 | 
					     * @param  {File} file the .piskel file to load
 | 
				
			||||||
     * @param  {Function} onSuccess Called if the deserialization of the piskel is successful
 | 
					     * @param  {Function} onSuccess Called if the deserialization of the piskel is successful
 | 
				
			||||||
     * @param  {Function} onError NOT USED YET
 | 
					     * @param  {Function} onError NOT USED YET
 | 
				
			||||||
@@ -15,13 +15,13 @@
 | 
				
			|||||||
        var rawPiskel = pskl.utils.Base64.toText(content);
 | 
					        var rawPiskel = pskl.utils.Base64.toText(content);
 | 
				
			||||||
        ns.PiskelFileUtils.decodePiskelFile(
 | 
					        ns.PiskelFileUtils.decodePiskelFile(
 | 
				
			||||||
          rawPiskel,
 | 
					          rawPiskel,
 | 
				
			||||||
          function (piskel, descriptor, fps) {
 | 
					          function (piskel) {
 | 
				
			||||||
            // if using Node-Webkit, store the savePath on load
 | 
					            // if using Node-Webkit, store the savePath on load
 | 
				
			||||||
            // Note: the 'path' property is unique to Node-Webkit, and holds the full path
 | 
					            // Note: the 'path' property is unique to Node-Webkit, and holds the full path
 | 
				
			||||||
            if (pskl.utils.Environment.detectNodeWebkit()) {
 | 
					            if (pskl.utils.Environment.detectNodeWebkit()) {
 | 
				
			||||||
              piskel.savePath = file.path;
 | 
					              piskel.savePath = file.path;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            onSuccess(piskel, descriptor, fps);
 | 
					            onSuccess(piskel);
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
          onError
 | 
					          onError
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
@@ -30,11 +30,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    decodePiskelFile : function (rawPiskel, onSuccess, onError) {
 | 
					    decodePiskelFile : function (rawPiskel, onSuccess, onError) {
 | 
				
			||||||
      var serializedPiskel = JSON.parse(rawPiskel);
 | 
					      var serializedPiskel = JSON.parse(rawPiskel);
 | 
				
			||||||
      var fps = serializedPiskel.piskel.fps;
 | 
					 | 
				
			||||||
      var piskel = serializedPiskel.piskel;
 | 
					      var piskel = serializedPiskel.piskel;
 | 
				
			||||||
      var descriptor = new pskl.model.piskel.Descriptor(piskel.name, piskel.description, true);
 | 
					 | 
				
			||||||
      pskl.utils.serialization.Deserializer.deserialize(serializedPiskel, function (piskel) {
 | 
					      pskl.utils.serialization.Deserializer.deserialize(serializedPiskel, function (piskel) {
 | 
				
			||||||
        onSuccess(piskel, descriptor, fps);
 | 
					        onSuccess(piskel);
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user