minor tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
0640c7da14
commit
5c9116b9d1
@ -52,7 +52,8 @@ var restoreScroll = function(){
|
|||||||
|
|
||||||
<h3>ToDo</h3>
|
<h3>ToDo</h3>
|
||||||
<pre>
|
<pre>
|
||||||
- <s>Views: Gallery />Details / Lightbox</s>
|
- Save current gallery (zip)
|
||||||
|
- <s>Views: Gallery / Details / Lightbox</s>
|
||||||
- Details: populate fields
|
- Details: populate fields
|
||||||
- toolbar -- floating over gallery
|
- toolbar -- floating over gallery
|
||||||
- lightbox (current)
|
- lightbox (current)
|
||||||
|
|||||||
@ -678,12 +678,14 @@ var Gallery = {
|
|||||||
.update() },
|
.update() },
|
||||||
__image_attributes__: [
|
__image_attributes__: [
|
||||||
'caption',
|
'caption',
|
||||||
|
'filename',
|
||||||
],
|
],
|
||||||
__image_classes__: [
|
__image_classes__: [
|
||||||
// XXX should this be here or set as a root attribute???
|
// XXX should this be here or set as a root attribute???
|
||||||
'current',
|
'current',
|
||||||
'marked',
|
'marked',
|
||||||
],
|
],
|
||||||
|
// XXX add option to include images as data urls...
|
||||||
// XXX do we handle previews here???
|
// XXX do we handle previews here???
|
||||||
json: function(images=undefined){
|
json: function(images=undefined){
|
||||||
var that = this
|
var that = this
|
||||||
@ -707,6 +709,12 @@ var Gallery = {
|
|||||||
&& (res[key] = true) }
|
&& (res[key] = true) }
|
||||||
return res }) },
|
return res }) },
|
||||||
|
|
||||||
|
// XXX
|
||||||
|
zip: function(){
|
||||||
|
var json = this.json()
|
||||||
|
// XXX
|
||||||
|
},
|
||||||
|
|
||||||
remove: function(...images){
|
remove: function(...images){
|
||||||
if(images.includes('all')){
|
if(images.includes('all')){
|
||||||
return this.clear() }
|
return this.clear() }
|
||||||
@ -855,13 +863,21 @@ var Gallery = {
|
|||||||
|
|
||||||
// images...
|
// images...
|
||||||
if(file.type.match('image.*')){
|
if(file.type.match('image.*')){
|
||||||
|
// XXX TEST...
|
||||||
if(file.path){
|
if(file.path){
|
||||||
return file.path
|
return {
|
||||||
|
url: file.path,
|
||||||
|
filename: file.name,
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return new Promise(function(resolve, reject){
|
return new Promise(function(resolve, reject){
|
||||||
var reader = new FileReader()
|
var reader = new FileReader()
|
||||||
reader.onload = function(f){
|
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) }) } }
|
reader.readAsDataURL(file) }) } }
|
||||||
// other files...
|
// other files...
|
||||||
return [] })
|
return [] })
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user