started work on export history/presets...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-09-21 20:06:38 +03:00
parent 3963da3630
commit 90f00b5a83
2 changed files with 33 additions and 9 deletions

View File

@ -2544,6 +2544,7 @@ var FileSystemWriterUIActions = actions.Actions({
alias: 'index',
action: 'exportIndex',
data: [
//'name',
'base_path',
'target_dir',
'clean_target_dir',
@ -2561,6 +2562,7 @@ var FileSystemWriterUIActions = actions.Actions({
alias: 'images',
action: 'exportDirs',
data: [
//'name',
'pattern',
'size',
'include_virtual',
@ -2576,15 +2578,31 @@ var FileSystemWriterUIActions = actions.Actions({
// XXX format:
// [
// {
// // XXX optional -- auto-generated if not given...
// name: <name>,
// // XXX key in .config['export-dialog-modes']
// type: <preset-tipe>,
//
// // these depend on preset type...
// ...
// }
// ]
// XXX should this be a dict or a list???
// ...a dict would require keys (gid/title??)
// XXX should this api be accessible from outside the ui???
'export-presets': [],
'export-presets': [
// XXX examples...
{
type: 'images',
pattern: '%(fav)l%n%(-bookmarked)b%(-m)m%(-%c)c',
size: '1000',
include_virtual: true,
target_dir: './select',
clean_target_dir: true,
},
],
'export-history': [
],
},
// XXX this needs feedback...
@ -3007,8 +3025,17 @@ var FileSystemWriterUIActions = actions.Actions({
// XXX need a means to save/manage/run presets...
exportPresets: ['- File/Export...',
widgets.makeUIDialog(function(mode){
// XXX
})],
var that = this
return browse.makeLister(null, function(path, make){
make('Export...')
make('---')
make('---')
}) })],
// XXX these do note need the ui -- move to a separate feature...
// XXX these are essentially the same as the history API, make a

View File

@ -759,8 +759,7 @@ function(list, options){
// we need to return the list itself...
&& lst
// in case the list(..) returns nothing...
|| lst
}
|| lst }
// save item to lst...
var saveItem = function(txt, replace){
if(txt == replace || txt.trim() == ''){
@ -841,8 +840,7 @@ function(list, options){
lst = write(dialog.__list[id], lst)
return txt
}
return txt }
// edit item inline...
var editItem = function(elem){
var elem = $(elem).find('.text').last()
@ -876,8 +874,7 @@ function(list, options){
title = title.replace(/\$/g, '')
dialog.update()
.then(function(){ dialog.select(`"${title}"`) })
})
}
}) }
dialog.__list = dialog.__list || {}
dialog.__editable = dialog.__editable || {}