Commit 9fb9b7f5 authored by Tristan Cavelier's avatar Tristan Cavelier

example.html is now up to date

parent 93962ffc
...@@ -17,6 +17,7 @@ var log = function (o) { ...@@ -17,6 +17,7 @@ var log = function (o) {
<div id="log"> <div id="log">
</div> </div>
<script src="../src/sha256.amd.js"></script> <script src="../src/sha256.amd.js"></script>
<script src="../lib/rsvp/rsvp-custom.js"></script>
<script src="../jio.js"></script> <script src="../jio.js"></script>
<script src="../complex_queries.js"></script> <script src="../complex_queries.js"></script>
<script src="../src/jio.storage/localstorage.js"></script> <script src="../src/jio.storage/localstorage.js"></script>
...@@ -34,6 +35,11 @@ jio_instance = jIO.createJIO({ ...@@ -34,6 +35,11 @@ jio_instance = jIO.createJIO({
}); });
// Careful! These are asynchronous methods! // Careful! These are asynchronous methods!
// And they use promises with a custom version of RSVP.js
// For more information, see
// RSVP https://github.com/tildeio/rsvp.js#rsvpjs--
// Promises A+ http://promisesaplus.com/
// CommonJS http://wiki.commonjs.org/wiki/Promises
log('-> post "video" document metadata to localStorage'); log('-> post "video" document metadata to localStorage');
jio_instance.post({ jio_instance.post({
...@@ -86,11 +92,11 @@ jio_instance.post({ ...@@ -86,11 +92,11 @@ jio_instance.post({
}).then(function (response) { }).then(function (response) {
return jIO.util.blobAsBinaryString(response.data); return jIO.util.readBlobAsBinaryString(response.data);
}).then(function (binary_string) { }).then(function (event) {
log('Video content is: ' + binary_string); log('Video content is: ' + event.target.result);
log('-> remove "video" document from localStorage'); log('-> remove "video" document from localStorage');
return jio_instance.remove({"_id":'video'}); return jio_instance.remove({"_id":'video'});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment