tweaking and some refactoring...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-06-21 20:02:54 +04:00
parent e3730ebdc8
commit 94826cdcf0
3 changed files with 29 additions and 11 deletions

View File

@ -274,14 +274,7 @@ var KEYBOARD_CONFIG = {
// XXX STUB: use a real path browser...
O: doc('Open a directory path',
function(){
// browser version...
var getter = window.listDir != null ? getDir : prompt
getter('Path to open', BASE_URL)
.done(function(path){
path = path.trim()
statusNotify(loadDir(path))
})
loadDirectory()
}),

View File

@ -254,7 +254,7 @@ var toggleSlideShowMode = createCSSClassToggler(
} else {
window._slideshow_timer != null && clearInterval(_slideshow_timer)
showStatus('Slideshow: stopped.')
showStatus('Slideshow: canceled.')
hideOverlay($('.viewer'))
}
})

View File

@ -647,6 +647,8 @@ function exportPreviews(dfl){
dfl = dfl == null ? BASE_URL : dfl
var res = $.Deferred()
updateStatus('Export...').show()
formDialog(null, 'Export previews', {
'Image name pattern': '%f',
'Fav directory name': 'fav',
@ -658,16 +660,39 @@ function exportPreviews(dfl){
data['Image name pattern'],
data['Fav directory name'])
showStatusQ('Exporting data...')
// XXX do real reporting...
showStatusQ('Copying data...')
res.resolve(data[''])
})
.fail(function(){ res.reject() })
.fail(function(){
showStatusQ('Export: canceled.')
res.reject()
})
return res
}
function loadDirectory(dfl){
dfl = dfl == null ? BASE_URL : dfl
// browser version...
var getter = window.listDir != null ? getDir : prompt
updateStatus('Open...').show()
getter('Path to open', dfl)
.done(function(path){
path = path.trim()
statusNotify(loadDir(path))
})
.fail(function(){
showStatusQ('Open: canceled.')
})
}
/************************************************ Specific dialogs ***/