some refactoring and updated todo...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-06-03 00:01:49 +04:00
parent c6257a335a
commit fb302804ac
3 changed files with 89 additions and 92 deletions

View File

@ -84,8 +84,8 @@ Roadmap
[_] 24% Gen 3 current todo
[_] 49% High priority
[_] 25% Gen 3 current todo
[_] 50% High priority
[_] BUG: sometimes duplicate images get loaded...
| this happens when jumping back and forth on the mid ribbon until
| the last element shows up and then moving left until the frame
@ -123,11 +123,11 @@ Roadmap
[_] ASAP: test on Android...
[_] empty view (no data) usable...
[_] proper system init (start w.o. any data)
[_] 58% image sorting (date/name/...)
[_] 66% sort by:
[_] 75% image sorting (date/name/...)
[X] 100% sort by:
[X] date
[X] name
[_] manual shift left/right/position
[X] manual shift left/right/position
| position shift is mark and shift here..
[_] 50% Sort ui
[X] reverse
@ -135,22 +135,12 @@ Roadmap
[_] 50% Undo/Redo
[X] basic one step (revert to last save)
[_] push/pop state stack
[_] single ribbon mode
| should this have up/down navigation?
|
| something like showGidsAsRibbon(gids) would be generic and logical...
[_] add ability to save/load ranges of images and the structures around them
| e.g.load image 100 to current ribbon -> will load 100 images
| for current ribbon and all the in between images from other
| ribbons above and below...
[_] build cache in background...
| this must be done while updating IMAGES live...
[_] 6% mark-based operations
[_] 26% mark-based operations
[_] 33% cropping selection
[X] marked
[_] by tag/collection
[_] by group
[_] shift up/down
[X] shift up/down
[_] tag
[_] group
| a group should behave as a single image but is
@ -166,6 +156,16 @@ Roadmap
| a list or a member image (primary).
[_] collection
| make or add to existing collection
[_] single ribbon mode
| should this have up/down navigation?
|
| something like showGidsAsRibbon(gids) would be generic and logical...
[_] add ability to save/load ranges of images and the structures around them
| e.g.load image 100 to current ribbon -> will load 100 images
| for current ribbon and all the in between images from other
| ribbons above and below...
[_] build cache in background...
| this must be done while updating IMAGES live...
[_] 0% grouping / meta-image
[_] versions w. label image
| a set of images that is represented by one of the group

View File

@ -1481,81 +1481,6 @@ function shiftImageRight(image){
}
// XXX move to marks.js
// XXX need to account for empty ribbons...
function shiftMarkedImages(direction, mode, new_ribbon){
mode = mode == null ? 'ribbon' : mode
var cur = getRibbonIndex()
// ribbon only...
if(mode == 'ribbon'){
var ribbon = DATA.ribbons[cur]
// remove all the marked images form current ribbon...
var marked = $.map(MARKED, function(e){
var i = ribbon.indexOf(e)
if(i >= 0){
ribbon.splice(i, 1)
return e
}
return null
})
// shift all marked images...
} else {
var marked = MARKED.slice()
// remove all the marked images form all the ribbons...
$.each(DATA.ribbons, function(ribbon){
$.each(marked, function(e){
var i = ribbon.indexOf(e)
i >= 0 ? ribbon.splice(i, 1) : null
})
})
}
// if we are at the top or bottom ribbons we need to create a new
// ribbon regardless...
if((cur == 0 && direction == 'prev')
|| (cur == DATA.ribbons.length-1 && direction == 'next')){
new_ribbon = true
}
// add marked to new ribbon...
if(new_ribbon){
cur += direction == 'next' ? 1 : 0
DATA.ribbons.splice(cur, 0, marked)
// add marked to existing ribbon...
} else {
cur += direction == 'next' ? 1 : -1
DATA.ribbons[cur] = DATA.ribbons[cur].concat(marked).sort(cmp)
}
// remove empty ribbons...
DATA.ribbons = DATA.ribbons.filter(function(e){ return e.length > 0 ? true : false })
updateRibbonOrder()
}
function shiftMarkedImagesUp(mode, new_ribbon){
return shiftMarkedImages('prev', mode, new_ribbon)
}
function shiftMarkedImagesDown(mode, new_ribbon){
return shiftMarkedImages('next', mode, new_ribbon)
}
// XXX these are ribbon wise only (???)
// XXX this on first step this must pack all marked images
function horizontalShiftMarkedImages(direction){
}
function shiftMarkedImagesLeft(){
return shiftMarkedImages('prev')
}
function shiftMarkedImagesRight(){
return shiftMarkedImages('next')
}
/**********************************************************************
* vim:set ts=4 sw=4 spell : */

View File

@ -182,6 +182,78 @@ function toggleImageMarkBlock(image){
}
// XXX need to account for empty ribbons...
function shiftMarkedImages(direction, mode, new_ribbon){
mode = mode == null ? 'ribbon' : mode
var cur = getRibbonIndex()
// ribbon only...
if(mode == 'ribbon'){
var ribbon = DATA.ribbons[cur]
// remove all the marked images form current ribbon...
var marked = $.map(MARKED, function(e){
var i = ribbon.indexOf(e)
if(i >= 0){
ribbon.splice(i, 1)
return e
}
return null
})
// shift all marked images...
} else {
var marked = MARKED.slice()
// remove all the marked images form all the ribbons...
$.each(DATA.ribbons, function(ribbon){
$.each(marked, function(e){
var i = ribbon.indexOf(e)
i >= 0 ? ribbon.splice(i, 1) : null
})
})
}
// if we are at the top or bottom ribbons we need to create a new
// ribbon regardless...
if((cur == 0 && direction == 'prev')
|| (cur == DATA.ribbons.length-1 && direction == 'next')){
new_ribbon = true
}
// add marked to new ribbon...
if(new_ribbon){
cur += direction == 'next' ? 1 : 0
DATA.ribbons.splice(cur, 0, marked)
// add marked to existing ribbon...
} else {
cur += direction == 'next' ? 1 : -1
DATA.ribbons[cur] = DATA.ribbons[cur].concat(marked).sort(cmp)
}
// remove empty ribbons...
DATA.ribbons = DATA.ribbons.filter(function(e){ return e.length > 0 ? true : false })
updateRibbonOrder()
}
function shiftMarkedImagesUp(mode, new_ribbon){
return shiftMarkedImages('prev', mode, new_ribbon)
}
function shiftMarkedImagesDown(mode, new_ribbon){
return shiftMarkedImages('next', mode, new_ribbon)
}
// XXX these are ribbon wise only (???)
// XXX this on first step this must pack all marked images
function horizontalShiftMarkedImages(direction){
}
function shiftMarkedImagesLeft(){
return shiftMarkedImages('prev')
}
function shiftMarkedImagesRight(){
return shiftMarkedImages('next')
}
/**********************************************************************