minor tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-08-11 15:41:11 +03:00
parent 0640c7da14
commit 5c9116b9d1
2 changed files with 20 additions and 3 deletions

View File

@ -52,7 +52,8 @@ var restoreScroll = function(){
<h3>ToDo</h3>
<pre>
- <s>Views: Gallery />Details / Lightbox</s>
- Save current gallery (zip)
- <s>Views: Gallery / Details / Lightbox</s>
- Details: populate fields
- toolbar -- floating over gallery
- lightbox (current)

View File

@ -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 [] })