diff --git a/index.html b/index.html index ed24360..877f736 100755 --- a/index.html +++ b/index.html @@ -761,6 +761,7 @@ $(document).ready(function(){

download magazine... +


@@ -1002,7 +1003,7 @@ $(document).ready(function(){ loadSettings() - // setup the link... + // setup download link... $('#downloader') .attr('href','data:text/octet-stream;base64,'+btoa( JSON.stringify(buildJSON(true, true)) @@ -1010,6 +1011,33 @@ $(document).ready(function(){ // entities with actual chars... .replace(/–/g, '–'))) + // upload... + function handleFileSelect(evt) { + var files = evt.target.files; // FileList object + + // Loop through the FileList and render image files as thumbnails. + for (var i = 0, f; f = files[i]; i++) { + + var reader = new FileReader(); + + // Closure to capture the file information. + reader.onload = (function(theFile) { + return function(e) { + console.log('loading...') + console.log($.parseJSON(e.target.result)) + loadJSON($.parseJSON(e.target.result), true) + console.log('done.') + }; + })(f); + + // Read in the image file as a data URL. + reader.readAsText(f); + } + } + + $('#upload').on('change', handleFileSelect); + +