diff --git a/grid-n-view.html b/grid-n-view.html index 7620f6f..64388a8 100644 --- a/grid-n-view.html +++ b/grid-n-view.html @@ -52,7 +52,8 @@ var restoreScroll = function(){
--Views: Gallery />Details / Lightbox+- Save current gallery (zip) +-Views: Gallery / Details / Lightbox- Details: populate fields - toolbar -- floating over gallery - lightbox (current) diff --git a/grid-n-view.js b/grid-n-view.js index c914719..fa6405c 100644 --- a/grid-n-view.js +++ b/grid-n-view.js @@ -678,12 +678,14 @@ var Gallery = { .update() }, __image_attributes__: [ 'caption', + 'filename', ], __image_classes__: [ // XXX should this be here or set as a root attribute??? 'current', 'marked', ], + // XXX add option to include images as data urls... // XXX do we handle previews here??? json: function(images=undefined){ var that = this @@ -707,6 +709,12 @@ var Gallery = { && (res[key] = true) } return res }) }, + // XXX + zip: function(){ + var json = this.json() + // XXX + }, + remove: function(...images){ if(images.includes('all')){ return this.clear() } @@ -855,13 +863,21 @@ var Gallery = { // images... if(file.type.match('image.*')){ + // XXX TEST... if(file.path){ - return file.path + return { + url: file.path, + filename: file.name, + } } else { return new Promise(function(resolve, reject){ var reader = new FileReader() reader.onload = function(f){ - resolve(f.target.result) } + resolve({ + url: f.target.result, + filename: file.name, + // XXX any other metadata to include??? + }) } reader.readAsDataURL(file) }) } } // other files... return [] })