remove unused file

This commit is contained in:
Iuri Matias 2016-10-02 18:57:22 -04:00
parent 8a1fd3a165
commit 927d130a59
1 changed files with 0 additions and 32 deletions

View File

@ -1,32 +0,0 @@
$(document).ready(function() {
window.ipfsConnection = window.IpfsApi('localhost', '5001');
//ipfs.object.put
//ipfs.add((new ipfs.Buffer("heydudehowareyou")), function(err, result) { console.log(result[0].path) })
// see https://github.com/ConsenSys/ipfs.js for conversion to hex
// id = "QmdAvyxUkvJFYeHmBFVkfDdYZvyummU32Q2MNDKbwrCMvP"
//SimpleStorage.setHash(id)
//web3.toAscii(SimpleStorage.foo())
window.saveFileToIpfs = function(file, cb) {
var reader = new FileReader();
reader.onloadend = function() {
var fileContent = reader.result;
var buffer = ipfsConnection.Buffer.from(fileContent);
ipfsConnection.add(buffer, function(err, result) {
cb(err, result[0].path);
});
};
reader.readAsArrayBuffer(file);
};
window.saveTextToIpfs = function(content, cb) {
ipfsConnection.add((new ipfsConnection.Buffer(content)), function(err, result) {
cb(err, result[0].path);
});
};
});