mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
several fixes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
24d90345f3
commit
bb413be06b
@ -44,6 +44,7 @@ if(window.CEF_dumpJSON != null){
|
|||||||
// XXX make this work across fs...
|
// XXX make this work across fs...
|
||||||
// XXX this will not overwrite...
|
// XXX this will not overwrite...
|
||||||
window.copyFile = function(src, dst){
|
window.copyFile = function(src, dst){
|
||||||
|
var deferred = $.Deferred()
|
||||||
if(fp.test(src)){
|
if(fp.test(src)){
|
||||||
// XXX will this work on Mac???
|
// XXX will this work on Mac???
|
||||||
src = src.replace(fp, '')
|
src = src.replace(fp, '')
|
||||||
@ -58,7 +59,7 @@ if(window.CEF_dumpJSON != null){
|
|||||||
path = path.join('/')
|
path = path.join('/')
|
||||||
|
|
||||||
|
|
||||||
// XXX make dirs...
|
// make dirs...
|
||||||
if(!fs.existsSync(path)){
|
if(!fs.existsSync(path)){
|
||||||
console.log('making:', path)
|
console.log('making:', path)
|
||||||
fse.mkdirRecursiveSync(path)
|
fse.mkdirRecursiveSync(path)
|
||||||
@ -66,8 +67,17 @@ if(window.CEF_dumpJSON != null){
|
|||||||
|
|
||||||
if(!fs.existsSync(dst)){
|
if(!fs.existsSync(dst)){
|
||||||
// NOTE: this is not sync...
|
// NOTE: this is not sync...
|
||||||
return fse.copy(src, dst)
|
fse.copy(src, dst, function(err){
|
||||||
|
if(err){
|
||||||
|
deferred.reject(err)
|
||||||
|
} else {
|
||||||
|
deferred.resolve()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return deferred
|
||||||
}
|
}
|
||||||
|
deferred.notify(dst, 'exists')
|
||||||
|
return deferred.resolve()
|
||||||
}
|
}
|
||||||
window.dumpJSON = function(path, data){
|
window.dumpJSON = function(path, data){
|
||||||
if(fp.test(path)){
|
if(fp.test(path)){
|
||||||
|
|||||||
@ -563,6 +563,9 @@ function exportTo(path, im_name, dir_name, size){
|
|||||||
dir_name = dir_name == null ? 'fav' : dir_name
|
dir_name = dir_name == null ? 'fav' : dir_name
|
||||||
size = size == null ? 1000 : size
|
size = size == null ? 1000 : size
|
||||||
|
|
||||||
|
// starting point...
|
||||||
|
//var deferred = $.Deferred().resolve()
|
||||||
|
|
||||||
var base_path = path
|
var base_path = path
|
||||||
path = normalizePath(path)
|
path = normalizePath(path)
|
||||||
|
|
||||||
|
|||||||
30
ui/ui.js
30
ui/ui.js
@ -718,16 +718,28 @@ function exportPreviewsDialog(state, dfl){
|
|||||||
|
|
||||||
updateStatus('Export...').show()
|
updateStatus('Export...').show()
|
||||||
|
|
||||||
formDialog(null, '<b>Export source:</b> '+ state +'.', {
|
// NOTE: we are not defining the object in-place here because some
|
||||||
'Image name pattern | %f - full filename \n%n - filename \n%e - extension \n%gid - log gid \n%g - short gid \n%i - order': '%f',
|
// keys become unreadable with JS syntax preventing us from
|
||||||
'Fav directory name': 'fav',
|
// splitting the key into several lines...
|
||||||
'Destination': {ndir: dfl},
|
var cfg = {}
|
||||||
}, 'OK', 'exportPreviewsDialog')
|
cfg['Image name pattern | '+
|
||||||
|
'%f - full filename\n'+
|
||||||
|
'%n - filename\n'+
|
||||||
|
'%e - extension\n'+
|
||||||
|
'%gid - log gid\n'+
|
||||||
|
'%g - short gid\n'+
|
||||||
|
'%i - order'] = '%f'
|
||||||
|
cfg['Fav directory name'] = 'fav'
|
||||||
|
cfg['Destination'] = {ndir: dfl}
|
||||||
|
|
||||||
|
var keys = Object.keys(cfg)
|
||||||
|
|
||||||
|
formDialog(null, '<b>Export source:</b> '+ state +'.', cfg, 'OK', 'exportPreviewsDialog')
|
||||||
.done(function(data){
|
.done(function(data){
|
||||||
exportTo(
|
exportTo(
|
||||||
data['Destination'],
|
normalizePath(data[keys[2]]),
|
||||||
data['Image name pattern'],
|
data[keys[0]],
|
||||||
data['Fav directory name'])
|
data[keys[1]])
|
||||||
|
|
||||||
// XXX do real reporting...
|
// XXX do real reporting...
|
||||||
showStatusQ('Copying data...')
|
showStatusQ('Copying data...')
|
||||||
@ -758,7 +770,7 @@ function loadDirectoryDialog(dfl){
|
|||||||
toggleSingleRibbonMode('off')
|
toggleSingleRibbonMode('off')
|
||||||
toggleMarkedOnlyView('off')
|
toggleMarkedOnlyView('off')
|
||||||
|
|
||||||
path = path.trim()
|
path = normalizePath(path.trim())
|
||||||
statusNotify(loadDir(path))
|
statusNotify(loadDir(path))
|
||||||
})
|
})
|
||||||
.fail(function(){
|
.fail(function(){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user