mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
some fixes + more work on the loader...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
73b52b347c
commit
c8b653567a
@ -759,6 +759,7 @@ stretching in width... */
|
|||||||
background: blue;
|
background: blue;
|
||||||
left: -25px;
|
left: -25px;
|
||||||
}
|
}
|
||||||
|
.marks-visible.single-image-mode.viewer .mark:before,
|
||||||
.marks-visible.single-image-mode.viewer .mark:after {
|
.marks-visible.single-image-mode.viewer .mark:after {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -777,6 +777,7 @@ stretching in width... */
|
|||||||
background: blue;
|
background: blue;
|
||||||
left: -25px;
|
left: -25px;
|
||||||
}
|
}
|
||||||
|
.marks-visible.single-image-mode.viewer .mark:before,
|
||||||
.marks-visible.single-image-mode.viewer .mark:after {
|
.marks-visible.single-image-mode.viewer .mark:after {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,6 +19,9 @@ console.log('>>> file')
|
|||||||
|
|
||||||
//var DEBUG = DEBUG != null ? DEBUG : true
|
//var DEBUG = DEBUG != null ? DEBUG : true
|
||||||
|
|
||||||
|
var data = require('data')
|
||||||
|
var images = require('images')
|
||||||
|
|
||||||
var tasks = require('lib/tasks')
|
var tasks = require('lib/tasks')
|
||||||
|
|
||||||
|
|
||||||
@ -404,6 +407,49 @@ function(base, previews, absolute_path){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// XXX move this to a better spot...
|
||||||
|
var buildIndex =
|
||||||
|
module.buildIndex = function(index, base){
|
||||||
|
var d = data.Data.fromJSON(index.data)
|
||||||
|
|
||||||
|
// buildup the data object...
|
||||||
|
d.tags = d.tags || {}
|
||||||
|
d.tags.bookmark = index.bookmarked ? index.bookmarked[0] : []
|
||||||
|
d.tags.selected = index.marked || []
|
||||||
|
d.sortTags()
|
||||||
|
|
||||||
|
// current...
|
||||||
|
d.current = index.current || d.current
|
||||||
|
|
||||||
|
|
||||||
|
// images...
|
||||||
|
// XXX there seems to be a problem with updated images...
|
||||||
|
// - in the test set not all rotated manually images are loaded rotated...
|
||||||
|
var img = images.Images(index.images)
|
||||||
|
|
||||||
|
if(base){
|
||||||
|
d.base_path = base
|
||||||
|
// XXX STUB remove ASAP...
|
||||||
|
// ...need a real way to handle base dir, possible
|
||||||
|
// approaches:
|
||||||
|
// 1) .base attr in image, set on load and
|
||||||
|
// do not save (or ignore on load)...
|
||||||
|
// if exists prepend to all paths...
|
||||||
|
// - more to do in view-time
|
||||||
|
// + more flexible
|
||||||
|
// 2) add/remove on load/save (approach below)
|
||||||
|
// + less to do in real time
|
||||||
|
// - more processing on load/save
|
||||||
|
img.forEach(function(_, img){ img.base = base })
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
data: d,
|
||||||
|
images: img,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
// Writer...
|
// Writer...
|
||||||
|
|||||||
@ -85,6 +85,7 @@ function(data){
|
|||||||
res.order = data.order.slice()
|
res.order = data.order.slice()
|
||||||
res.ribbon_order = data.ribbon_order == null ? [] : data.ribbon_order.slice()
|
res.ribbon_order = data.ribbon_order == null ? [] : data.ribbon_order.slice()
|
||||||
res.ribbons = {}
|
res.ribbons = {}
|
||||||
|
|
||||||
// generate gids...
|
// generate gids...
|
||||||
// NOTE: this will use the structures stored in data if available,
|
// NOTE: this will use the structures stored in data if available,
|
||||||
// otherwise new structures will be generated...
|
// otherwise new structures will be generated...
|
||||||
@ -98,6 +99,7 @@ function(data){
|
|||||||
res.ribbon_order.push(gid)
|
res.ribbon_order.push(gid)
|
||||||
res.ribbons[gid] = data.ribbons[k].slice()
|
res.ribbons[gid] = data.ribbons[k].slice()
|
||||||
})
|
})
|
||||||
|
|
||||||
// we set the base to the first ribbon...
|
// we set the base to the first ribbon...
|
||||||
res.base = data.base == null ? res.ribbon_order[0] : res.base
|
res.base = data.base == null ? res.ribbon_order[0] : res.base
|
||||||
return res
|
return res
|
||||||
|
|||||||
@ -19,7 +19,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* show image gid... */
|
/* show image gid... */
|
||||||
.image:after {
|
.visible-gid .image:after {
|
||||||
content: attr(gid);
|
content: attr(gid);
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@ -65,6 +65,15 @@ function makeConstructor(name, a, b){
|
|||||||
|
|
||||||
|
|
||||||
// super equivalent...
|
// super equivalent...
|
||||||
|
//
|
||||||
|
// Example:
|
||||||
|
// superMethod(<class>, <method-name>).call(this, ...)
|
||||||
|
// -> <result>
|
||||||
|
//
|
||||||
|
// This will return a next method in inheritance chain after <class> by
|
||||||
|
// its name (<method-name>).
|
||||||
|
// In the normal use-case <class> is the current class and <method-name>
|
||||||
|
// is the name of the current method.
|
||||||
var superMethod =
|
var superMethod =
|
||||||
module.superMethod =
|
module.superMethod =
|
||||||
function superMethod(cls, meth){
|
function superMethod(cls, meth){
|
||||||
|
|||||||
@ -125,6 +125,11 @@ if(typeof(glob) != 'undefined'){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
window.loadMBFWR1 = function(){
|
||||||
|
a.loadPath('L:/mnt/hdd15 (photo)/NTFS2/media/img/my/work/20151022 - MBFWR (1),/*')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
window.loadSaved = function(){
|
window.loadSaved = function(){
|
||||||
a.data.loadJSON(require('fs').readFileSync('insta.json', 'utf-8'))
|
a.data.loadJSON(require('fs').readFileSync('insta.json', 'utf-8'))
|
||||||
|
|||||||
@ -233,6 +233,9 @@ module.GLOBAL_KEYBOARD = {
|
|||||||
alt: 'browseActions: "/Bookmark/"',
|
alt: 'browseActions: "/Bookmark/"',
|
||||||
},
|
},
|
||||||
C: 'browseActions: "/Crop/"',
|
C: 'browseActions: "/Crop/"',
|
||||||
|
|
||||||
|
// XXX for debug...
|
||||||
|
G: function(){ $('.viewer').toggleClass('visible-gid') },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2901,12 +2901,15 @@ if(window.nodejs != null){
|
|||||||
var file = requirejs('./file')
|
var file = requirejs('./file')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var FileSystemLoaderActions = actions.Actions({
|
var FileSystemLoaderActions = actions.Actions({
|
||||||
// XXX
|
// XXX
|
||||||
loadPath: ['File/',
|
loadPath: ['File/',
|
||||||
function(path){
|
function(path){
|
||||||
var that = this
|
var that = this
|
||||||
|
|
||||||
|
// XXX get a logger...
|
||||||
|
|
||||||
// XXX this will not work for explicit path (path to a dir
|
// XXX this will not work for explicit path (path to a dir
|
||||||
// that contains the index)
|
// that contains the index)
|
||||||
file.loadIndex(path)
|
file.loadIndex(path)
|
||||||
@ -2915,36 +2918,14 @@ var FileSystemLoaderActions = actions.Actions({
|
|||||||
|
|
||||||
// XXX res may contain multiple indexes, need to
|
// XXX res may contain multiple indexes, need to
|
||||||
// combine them...
|
// combine them...
|
||||||
|
|
||||||
var k = Object.keys(res)[0]
|
var k = Object.keys(res)[0]
|
||||||
|
var index = res[k]
|
||||||
|
|
||||||
// XXX use the logger...
|
// XXX use the logger...
|
||||||
console.log('LOADING:', k)
|
console.log('LOADING:', k)
|
||||||
|
|
||||||
var d = data.Data.fromJSON(res[k].data)
|
that.load(file.buildIndex(index, k))
|
||||||
// XXX need to load tags, marks, bookmarks, ...
|
|
||||||
// XXX
|
|
||||||
|
|
||||||
// XXX need to make this segment specific...
|
|
||||||
d.base = k
|
|
||||||
|
|
||||||
// XXX STUB remove ASAP...
|
|
||||||
// ...need a real way to handle base dir, possible
|
|
||||||
// approaches:
|
|
||||||
// 1) .base attr in image, set on load and
|
|
||||||
// do not save (or ignore on load)...
|
|
||||||
// if exists prepend to all paths...
|
|
||||||
// - more to do in view-time
|
|
||||||
// + more flexible
|
|
||||||
// 2) add/remove on load/save (approach below)
|
|
||||||
// + less to do in real time
|
|
||||||
// - more processing on load/save
|
|
||||||
var img = images.Images(res[k].images)
|
|
||||||
.forEach(function(_, img){ img.base = k })
|
|
||||||
|
|
||||||
that.load({
|
|
||||||
data: d,
|
|
||||||
images: img,
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
}],
|
}],
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user