From 927d130a59e70f079bc6be4b01b1b953959f4fe4 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sun, 2 Oct 2016 18:57:22 -0400 Subject: [PATCH] remove unused file --- js/_ipfs.js | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 js/_ipfs.js diff --git a/js/_ipfs.js b/js/_ipfs.js deleted file mode 100644 index 83483e38..00000000 --- a/js/_ipfs.js +++ /dev/null @@ -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); - }); - }; - -});