mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
minor stuff and cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
14f62ace9a
commit
0e87a44b3c
@ -36,8 +36,29 @@ var browseWalk = require('lib/widget/browse-walk')
|
|||||||
|
|
||||||
var ExternalEditorActions = actions.Actions({
|
var ExternalEditorActions = actions.Actions({
|
||||||
config: {
|
config: {
|
||||||
|
// XXX do we actually need this????
|
||||||
'external-editor-default': 'System default',
|
'external-editor-default': 'System default',
|
||||||
// XXX
|
|
||||||
|
// XXX should this be a dict???
|
||||||
|
// ...a list is simpler for sorting...
|
||||||
|
'_external-editors': [
|
||||||
|
{
|
||||||
|
// NOTE: empty means use app name...
|
||||||
|
title: 'System default',
|
||||||
|
// NOTE: empty means system to select editor...
|
||||||
|
path: '',
|
||||||
|
// NOTE: empty is the same as '$TARGET'...
|
||||||
|
arguments: '',
|
||||||
|
target: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'IrfanView',
|
||||||
|
path: 'C:/Program Files (x86)/IrfanView/i_view32.exe',
|
||||||
|
arguments: '',
|
||||||
|
target: '',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
'external-editors': [
|
'external-editors': [
|
||||||
// XXX system default might be different on different systems...
|
// XXX system default might be different on different systems...
|
||||||
['System default|"$PATH"'],
|
['System default|"$PATH"'],
|
||||||
@ -48,8 +69,8 @@ var ExternalEditorActions = actions.Actions({
|
|||||||
],
|
],
|
||||||
|
|
||||||
'external-editor-targets': [
|
'external-editor-targets': [
|
||||||
'Original image',
|
|
||||||
'Best preview',
|
'Best preview',
|
||||||
|
//'Original image',
|
||||||
// XXX
|
// XXX
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -130,11 +151,10 @@ var ExternalEditorUIActions = actions.Actions({
|
|||||||
// NOTE: empty means use app name...
|
// NOTE: empty means use app name...
|
||||||
title: '',
|
title: '',
|
||||||
// NOTE: empty means system to select editor...
|
// NOTE: empty means system to select editor...
|
||||||
path: '/',
|
path: '',
|
||||||
// NOTE: empty is the same as '$TARGET'...
|
// NOTE: empty is the same as '$TARGET'...
|
||||||
// XXX use $TARGET...
|
|
||||||
arguments: '',
|
arguments: '',
|
||||||
target: 'Original image',
|
target: '',
|
||||||
}
|
}
|
||||||
|
|
||||||
var o = overlay.Overlay(this.ribbons.viewer,
|
var o = overlay.Overlay(this.ribbons.viewer,
|
||||||
@ -142,7 +162,7 @@ var ExternalEditorUIActions = actions.Actions({
|
|||||||
make(['Title: ', function(){ return editor.title || '' }])
|
make(['Title: ', function(){ return editor.title || '' }])
|
||||||
.on('open', function(){
|
.on('open', function(){
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
widgets.makeEditableItem(o.client,
|
widgets.makeEditableItem(o.client, $(this),
|
||||||
$(this).find('.text').last(),
|
$(this).find('.text').last(),
|
||||||
function(_, text){ editor.title = text }) })
|
function(_, text){ editor.title = text }) })
|
||||||
|
|
||||||
@ -176,26 +196,32 @@ var ExternalEditorUIActions = actions.Actions({
|
|||||||
})
|
})
|
||||||
.on('open', function(){
|
.on('open', function(){
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
widgets.makeEditableItem(o.client,
|
widgets.makeEditableItem(o.client, $(this),
|
||||||
$(this).find('.text').last(),
|
$(this).find('.text').last(),
|
||||||
function(_, text){ editor.path = text }) })
|
function(_, text){ editor.path = text }) })
|
||||||
|
|
||||||
make(['Arguments: ', function(){ return editor.arguments || '' }])
|
make(['Arguments: ', function(){ return editor.arguments || '' }])
|
||||||
.on('open', function(){
|
.on('open', function(){
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
widgets.makeEditableItem(o.client,
|
widgets.makeEditableItem(o.client, $(this),
|
||||||
$(this).find('.text').last(),
|
$(this).find('.text').last(),
|
||||||
function(_, text){ editor.arguments = text }) })
|
function(_, text){ editor.arguments = text }) })
|
||||||
|
|
||||||
make(['Target: ', function(){ return editor.target || 'Original image' }])
|
make(['Target: ',
|
||||||
|
function(){
|
||||||
|
return editor.target
|
||||||
|
|| that.config['external-editor-targets'][0] }])
|
||||||
.on('open',
|
.on('open',
|
||||||
widgets.makeNestedConfigListEditor(that, o,
|
widgets.makeNestedConfigListEditor(that, o,
|
||||||
'external-editor-targets',
|
'external-editor-targets',
|
||||||
function(val){
|
function(val){
|
||||||
if(val == null){
|
if(val == null){
|
||||||
return editor.target
|
return editor.target
|
||||||
|
|| that.config['external-editor-targets'][0]
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
editor.target = val
|
editor.target = val
|
||||||
|
|| that.config['external-editor-targets'][0]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -217,6 +243,8 @@ var ExternalEditorUIActions = actions.Actions({
|
|||||||
return o
|
return o
|
||||||
}],
|
}],
|
||||||
// XXX use .externalEditorDialog(..)
|
// XXX use .externalEditorDialog(..)
|
||||||
|
// XXX need to support $TARGET in args...
|
||||||
|
// ...append if not present...
|
||||||
listExtenalEditors: ['Edit/List external editors',
|
listExtenalEditors: ['Edit/List external editors',
|
||||||
function(){
|
function(){
|
||||||
var that = this
|
var that = this
|
||||||
|
|||||||
@ -1299,7 +1299,7 @@ var FileSystemWriterUIActions = actions.Actions({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// XXX indicate export state: index, crop, image...
|
// XXX indicate export state: index, crop, image...
|
||||||
exportDialog: ['File/Export/Images...',
|
exportDialog: ['File/Export/Export optioons...',
|
||||||
function(){
|
function(){
|
||||||
var that = this
|
var that = this
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ var browseWalk = require('lib/widget/browse-walk')
|
|||||||
// can be a different elem...
|
// can be a different elem...
|
||||||
var makeEditableItem =
|
var makeEditableItem =
|
||||||
module.makeEditableItem =
|
module.makeEditableItem =
|
||||||
function(list, elem, callback, options){
|
function(list, item, elem, callback, options){
|
||||||
return elem
|
return elem
|
||||||
.makeEditable({
|
.makeEditable({
|
||||||
clear_on_edit: false,
|
clear_on_edit: false,
|
||||||
@ -47,7 +47,7 @@ function(list, elem, callback, options){
|
|||||||
// XXX make the selector more accurate...
|
// XXX make the selector more accurate...
|
||||||
// ...at this point this will select the first elem
|
// ...at this point this will select the first elem
|
||||||
// with text which can be a different elem...
|
// with text which can be a different elem...
|
||||||
.then(function(){ list.select(text) })
|
.then(function(){ list.select(item.text()) })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user