mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
added base path to export dialog...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
39754e2ec0
commit
5e00e7164c
@ -2238,6 +2238,7 @@ var FileSystemWriterUIActions = actions.Actions({
|
|||||||
alias: 'index',
|
alias: 'index',
|
||||||
action: 'exportIndex',
|
action: 'exportIndex',
|
||||||
data: [
|
data: [
|
||||||
|
'base_path',
|
||||||
'target_dir',
|
'target_dir',
|
||||||
// XXX need to add options to size: 'none',
|
// XXX need to add options to size: 'none',
|
||||||
// XXX use closest preview instead of hi-res when
|
// XXX use closest preview instead of hi-res when
|
||||||
@ -2255,8 +2256,9 @@ var FileSystemWriterUIActions = actions.Actions({
|
|||||||
data: [
|
data: [
|
||||||
'pattern',
|
'pattern',
|
||||||
'size',
|
'size',
|
||||||
'level_dir',
|
'base_path',
|
||||||
'target_dir',
|
'target_dir',
|
||||||
|
'level_dir',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -2448,59 +2450,76 @@ var FileSystemWriterUIActions = actions.Actions({
|
|||||||
return e != 'no limit' },
|
return e != 'no limit' },
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
|
// XXX should this be editable???
|
||||||
|
// XXX make this selectable...
|
||||||
|
'base_path': function(actions, make, parent){
|
||||||
|
var elem = make(['Current path: ', this.location.path],
|
||||||
|
{
|
||||||
|
events: {
|
||||||
|
select: function(){
|
||||||
|
elem.find('.text').last().selectText()
|
||||||
|
},
|
||||||
|
deselect: function(){
|
||||||
|
elem.find('.text').last().selectText(null)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
// XXX BUG: history closing errors -- non-critical...
|
// XXX BUG: history closing errors -- non-critical...
|
||||||
'target_dir': function(actions, make, parent){
|
'target_dir': function(actions, make, parent){
|
||||||
var elem = make(['$To: ',
|
var elem = make(['$To: ',
|
||||||
function(){ return actions.config['export-path'] || './' }],
|
function(){ return actions.config['export-path'] || './' }],
|
||||||
{ buttons: [
|
{
|
||||||
['browse', function(p){
|
buttons: [
|
||||||
var e = this.filter('"'+p+'"', false)
|
['browse', function(p){
|
||||||
var path = e.find('.text').last().text()
|
var e = this.filter('"'+p+'"', false)
|
||||||
var txt = e.find('.text').first().text()
|
var path = e.find('.text').last().text()
|
||||||
|
var txt = e.find('.text').first().text()
|
||||||
|
|
||||||
// XXX add new dir global button...
|
// XXX add new dir global button...
|
||||||
return actions.browsePath(path,
|
return actions.browsePath(path,
|
||||||
function(path){
|
function(path){
|
||||||
actions.config['export-path'] = path
|
actions.config['export-path'] = path
|
||||||
actions.config['export-paths'].splice(0, 0, path)
|
actions.config['export-paths'].splice(0, 0, path)
|
||||||
|
|
||||||
parent.update()
|
parent.update()
|
||||||
parent.select(txt)
|
parent.select(txt)
|
||||||
})
|
|
||||||
}],
|
|
||||||
// XXX BUG: closing this breaks on parant.focus()...
|
|
||||||
['histroy', widgets.makeNestedConfigListEditor(actions, parent,
|
|
||||||
'export-paths',
|
|
||||||
'export-path',
|
|
||||||
{
|
|
||||||
length_limit: 10,
|
|
||||||
new_item: false,
|
|
||||||
})],
|
|
||||||
]})
|
|
||||||
// XXX make this editable???
|
|
||||||
.on('open', function(){
|
|
||||||
event.preventDefault()
|
|
||||||
|
|
||||||
var path = elem.find('.text').last()
|
|
||||||
.makeEditable({
|
|
||||||
activate: true,
|
|
||||||
clear_on_edit: false,
|
|
||||||
abort_keys: [
|
|
||||||
'Esc',
|
|
||||||
],
|
|
||||||
})
|
|
||||||
.on('edit-commit', function(_, path){
|
|
||||||
actions.config['export-path'] = path
|
|
||||||
actions.config['export-paths'].indexOf(path) < 0
|
|
||||||
&& actions.config['export-paths'].splice(0, 0, path)
|
|
||||||
|
|
||||||
})
|
|
||||||
.on('edit-abort edit-commit', function(evt, path){
|
|
||||||
parent.update()
|
|
||||||
.then(function(){
|
|
||||||
parent.select(path)
|
|
||||||
})
|
})
|
||||||
})
|
}],
|
||||||
|
// XXX BUG: closing this breaks on parant.focus()...
|
||||||
|
['histroy', widgets.makeNestedConfigListEditor(actions, parent,
|
||||||
|
'export-paths',
|
||||||
|
'export-path',
|
||||||
|
{
|
||||||
|
length_limit: 10,
|
||||||
|
new_item: false,
|
||||||
|
})],
|
||||||
|
],
|
||||||
|
// XXX make this editable???
|
||||||
|
open: function(){
|
||||||
|
event.preventDefault()
|
||||||
|
|
||||||
|
var path = elem.find('.text').last()
|
||||||
|
.makeEditable({
|
||||||
|
activate: true,
|
||||||
|
clear_on_edit: false,
|
||||||
|
abort_keys: [
|
||||||
|
'Esc',
|
||||||
|
],
|
||||||
|
})
|
||||||
|
.on('edit-commit', function(_, path){
|
||||||
|
actions.config['export-path'] = path
|
||||||
|
actions.config['export-paths'].indexOf(path) < 0
|
||||||
|
&& actions.config['export-paths'].splice(0, 0, path)
|
||||||
|
|
||||||
|
})
|
||||||
|
.on('edit-abort edit-commit', function(evt, path){
|
||||||
|
parent.update()
|
||||||
|
.then(function(){
|
||||||
|
parent.select(path)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
'comment': function(actions, make, parent){
|
'comment': function(actions, make, parent){
|
||||||
@ -2532,6 +2551,7 @@ var FileSystemWriterUIActions = actions.Actions({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
// XXX might be a good idea to show (editable?) base path???
|
||||||
// XXX update export state: index, crop, image...
|
// XXX update export state: index, crop, image...
|
||||||
// XXX should this be visible directly???
|
// XXX should this be visible directly???
|
||||||
exportDialog: ['- File/$Export/Export...',
|
exportDialog: ['- File/$Export/Export...',
|
||||||
|
|||||||
@ -94,7 +94,7 @@ if(typeof(jQuery) != typeof(undefined)){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
jQuery.fn.selectText = function(){
|
jQuery.fn.selectText = function(mode){
|
||||||
var range = document.createRange()
|
var range = document.createRange()
|
||||||
|
|
||||||
this.each(function(){
|
this.each(function(){
|
||||||
@ -103,10 +103,13 @@ if(typeof(jQuery) != typeof(undefined)){
|
|||||||
|
|
||||||
var sel = window.getSelection()
|
var sel = window.getSelection()
|
||||||
sel.removeAllRanges()
|
sel.removeAllRanges()
|
||||||
sel.addRange(range)
|
|
||||||
|
mode === null
|
||||||
|
|| sel.addRange(range)
|
||||||
|
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
jQuery.fn.deselectText = function(){ this.selectText(null) }
|
||||||
jQuery.fn.caretOffset = function(){ return getCaretOffset(this) }
|
jQuery.fn.caretOffset = function(){ return getCaretOffset(this) }
|
||||||
jQuery.fn.selectionCollapsed = function(){ return selectionCollapsed(this) }
|
jQuery.fn.selectionCollapsed = function(){ return selectionCollapsed(this) }
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user