several fixes and tweaks...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-06-01 21:06:10 +04:00
parent 5cfe86dbfb
commit 19bec265bc
3 changed files with 68 additions and 39 deletions

View File

@ -74,8 +74,8 @@ Roadmap
[_] 23% Gen 3 current todo [_] 22% Gen 3 current todo
[_] 46% High priority [_] 45% High priority
[_] BUG: aligning still sometimes gets off... [_] BUG: aligning still sometimes gets off...
| ...after rotating a number of images | ...after rotating a number of images
| |
@ -111,17 +111,12 @@ Roadmap
[_] ASAP: test on Android... [_] ASAP: test on Android...
[_] empty view (no data) usable... [_] empty view (no data) usable...
[_] propper system init (start w.o. any data) [_] propper system init (start w.o. any data)
[_] default STUB image... [_] revise reporting scheme...
| or a loading animation.. | showStatus(...) should be called uniformly, either at the source
| | or a specific reporting layer...
| ...would be good to make something pixilated so as to look nise
| on various magnifications.
|
| keep always cached.
[_] tweak image pre-caching size -- keep as many images cached as possible. [_] tweak image pre-caching size -- keep as many images cached as possible.
| might be good to always cache the smaller previews so as to make things | might be good to always cache the smaller previews so as to make things
| look faster... | look faster...
[_] slideshow mode...
[_] single ribbon mode [_] single ribbon mode
| should this have up/down navigation? | should this have up/down navigation?
| |
@ -177,6 +172,14 @@ Roadmap
[_] thresholds and frame size [_] thresholds and frame size
[_] remove extra and repetitive actions [_] remove extra and repetitive actions
[_] caching config [_] caching config
[X] slideshow mode...
[X] default STUB image...
| or a loading animation..
|
| ...would be good to make something pixilated so as to look nise
| on various magnifications.
|
| keep always cached.
[X] import fav dirs (wo. index)... [X] import fav dirs (wo. index)...
[X] ASAP: load/view un-cached directories... [X] ASAP: load/view un-cached directories...
[X] ASAP: support relative paths in cache... [X] ASAP: support relative paths in cache...

View File

@ -22,10 +22,16 @@ var KEYBOARD_CONFIG = {
// select info text... // select info text...
'.overlay-info:hover': { '.overlay-info:hover': {
title: 'Info overlay', title: 'Info overlay',
doc: 'NOTE: when the cursor is over the info overlay one can use '+ doc: 'Displayed on bottom of the screen if enabled (toggle with '+
'<b>I</b>) and/or inline, at bottom of and image when cursor '+
'is over it (only in ribbon mode, toggle with <b>alt-I</b>)<p>'+
'<p>NOTE: when the cursor is over the info overlay one can use '+
'Ctrl-A and Ctrl-D for info text selection, without affecting '+ 'Ctrl-A and Ctrl-D for info text selection, without affecting '+
'image selection/marks.', 'image selection/marks.',
ignore: [ 'A' ], ignore: [ 'A' ],
A: { A: {
// NOTE: this is here only for documentation... // NOTE: this is here only for documentation...
ctrl: doc('Select all'), ctrl: doc('Select all'),
@ -46,9 +52,11 @@ var KEYBOARD_CONFIG = {
// their bindings priority... // their bindings priority...
'.help-mode': { '.help-mode': {
title: 'Help', title: 'Help',
doc: 'To enter this mode press <b>H</b> or <b>?</b>.<br>'+ doc: 'To enter this mode press <b>H</b> or <b>?</b>.'+
'NOTE: In this mode all other key bindings are disabled, '+
'<p>NOTE: In this mode all other key bindings are disabled, '+
'except the ones explicitly defined here.', 'except the ones explicitly defined here.',
ignore: '*', ignore: '*',
Esc: doc('Close help', Esc: doc('Close help',
@ -74,17 +82,22 @@ var KEYBOARD_CONFIG = {
], ],
L: doc('Toggle slideshow looping', L: doc('Toggle slideshow looping',
function(){ function(){
SLIDESHOW_LOOP = SLIDESHOW_LOOP ? false : true SLIDESHOW_LOOP = SLIDESHOW_LOOP ? false : true
showStatus('Slideshow: looping', SLIDESHOW_LOOP ? 'enabled...' : 'disabled...') showStatus('Slideshow: looping', SLIDESHOW_LOOP ? 'enabled...' : 'disabled...')
return false return false
}), }),
R: doc('Reverse slideshow direction',
function(){
SLIDESHOW_DIRECTION = SLIDESHOW_DIRECTION == 'next' ? 'prev' : 'next'
showStatus('Slideshow: direction:', SLIDESHOW_DIRECTION + '...')
return false
}),
Esc: doc('Exit/stop slideshow', Esc: doc('Exit/stop slideshow',
function(){ function(){
toggleSlideShowMode('off') toggleSlideShowMode('off')
return false return false
}), }),
S: 'Esc', S: 'Esc',
Q: 'Esc', Q: 'Esc',
}, },
@ -99,7 +112,8 @@ var KEYBOARD_CONFIG = {
// XXX this should only work on single image mode... // XXX this should only work on single image mode...
F: doc('Toggle view proportions', F: doc('Toggle view proportions',
function(){ function(){
toggleImageProportions() var mode = toggleImageProportions()
showStatus('Fitting image to:', mode + '...')
centerRibbons() centerRibbons()
}), }),
Esc: doc('Exit single image mode', Esc: doc('Exit single image mode',
@ -132,6 +146,20 @@ var KEYBOARD_CONFIG = {
title: 'Global', title: 'Global',
doc: 'These key bindings work in most other modes.', doc: 'These key bindings work in most other modes.',
// Aliases...
'.next-screen': doc('Next screen',
function(){
event.preventDefault()
nextScreenImages()
centerRibbons()
}),
'.prev-screen': doc('Previous screen',
function(){
event.preventDefault()
prevScreenImages()
centerRibbons()
}),
// Navigation... // Navigation...
// XXX need to cancel the animation of the prev action... // XXX need to cancel the animation of the prev action...
Left: { Left: {
@ -151,12 +179,7 @@ var KEYBOARD_CONFIG = {
prevImage() prevImage()
centerRibbons() centerRibbons()
}), }),
ctrl: doc('Previous screen', ctrl: '.prev-screen',
function(){
event.preventDefault()
prevScreenImages()
centerRibbons()
}),
}, },
Right: { Right: {
default: doc('Next image', default: doc('Next image',
@ -175,23 +198,23 @@ var KEYBOARD_CONFIG = {
nextImage() nextImage()
centerRibbons() centerRibbons()
}), }),
ctrl: doc('Previous screen', ctrl: '.next-screen',
function(){
event.preventDefault()
nextScreenImages()
centerRibbons()
}),
}, },
Space: { Space: {
default: 'Right', default: 'Right',
shift: 'Left', shift: 'Left',
// screen-oriented movement... // screen-oriented movement...
ctrl: 'Right', ctrl: 'Right',
'ctrl+shift': 'Left', 'ctrl+shift': '.prev-screen',
}, },
Backspace: { Backspace: {
default: 'Left', default: 'Left',
shift: 'Right', shift: 'Right',
// screen-oriented movement...
ctrl: 'Left',
// XXX this does not work...
'ctrl+shift': '.next-screen',
}, },
Home: doc('First image', Home: doc('First image',
function(){ function(){

View File

@ -121,6 +121,7 @@ var toggleTheme = createCSSClassToggler('.viewer',
'dark', 'dark',
'light' 'light'
], ],
// XXX does this get called for default state (gray)???
function(action){ function(action){
SETTINGS['theme'] = action SETTINGS['theme'] = action
}) })
@ -165,6 +166,7 @@ function toggleImageProportions(mode){
// square... // square...
} else if(h != w || mode == 'square'){ } else if(h != w || mode == 'square'){
mode = 'square'
var size = Math.min(w, h) var size = Math.min(w, h)
image.css({ image.css({
width: size, width: size,
@ -175,10 +177,10 @@ function toggleImageProportions(mode){
correctImageProportionsForRotation(image) correctImageProportionsForRotation(image)
centerView(null, 'css') centerView(null, 'css')
return 'square'
// viewer size... // viewer size...
} else { } else {
mode = 'viewer'
var viewer = $('.viewer') var viewer = $('.viewer')
var W = viewer.innerWidth() var W = viewer.innerWidth()
var H = viewer.innerHeight() var H = viewer.innerHeight()
@ -193,8 +195,9 @@ function toggleImageProportions(mode){
correctImageProportionsForRotation(image) correctImageProportionsForRotation(image)
centerView(null, 'css') centerView(null, 'css')
return 'viewer'
} }
return 'mode'
} }