mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-12-17 16:51:40 +00:00
added select field to formDialog(), added target size to export dialog...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
e90641e255
commit
8c340780f0
14
ui/TODO.otl
14
ui/TODO.otl
@ -107,13 +107,13 @@ Roadmap
|
||||
[_] index and group ALL files in an archive
|
||||
[_] import metadata
|
||||
[_] real GIDs
|
||||
[_] % Thumbnail generation strategies
|
||||
[_] extract existing raw thumbnails
|
||||
[_] make a preview just bigger than the screen first
|
||||
| ...to prevent loading the high-res
|
||||
|
|
||||
| this should be done BEFORE loading the image -- pre-load phase...
|
||||
[_] prioritize making thumbs for the ribbon (~350px)
|
||||
[_] 33% Thumbnail generation strategies
|
||||
[_] 0% pass 1: generate really fast previews
|
||||
[_] ~1/3 screen - for ribbon
|
||||
[_] ~1 screen - for single image mode
|
||||
[X] pass 2: generate normal previews
|
||||
[_] extract existing raw thumbnails/previews (for RAW files)
|
||||
[_] add option to export either original or preview (exportDialog)
|
||||
[_] BUG: shifting last image out of a ribbon misaligns the current ribbon
|
||||
| i.e. the prev ribbon was deleted and the new focused ribbon
|
||||
| is aligned as if it was not current...
|
||||
|
||||
60
ui/ui.js
60
ui/ui.js
@ -540,6 +540,53 @@ var FIELD_TYPES = {
|
||||
},
|
||||
},
|
||||
|
||||
// format:
|
||||
// {
|
||||
// select: ['a', 'b', 'c', ...]
|
||||
// // default option (optional)...
|
||||
// default: <number> | <text>
|
||||
// }
|
||||
select: {
|
||||
type: 'select',
|
||||
text: null,
|
||||
default: false,
|
||||
html: '<div class="field choice">'+
|
||||
'<span class="text"></span>'+
|
||||
'<select>'+
|
||||
'<option class="option"></option>'+
|
||||
'</select>'+
|
||||
'</div>',
|
||||
test: function(val){
|
||||
return 'select' in val
|
||||
},
|
||||
set: function(field, value){
|
||||
var t = field.find('.text').text()
|
||||
var item = field.find('.option').last()
|
||||
var select = field.find('select')
|
||||
for(var i=0; i < value.select.length; i++){
|
||||
item
|
||||
.text(value.select[i])
|
||||
.val(value.select[i])
|
||||
item.appendTo(select)
|
||||
|
||||
item = item.clone()
|
||||
}
|
||||
if(value.default != null){
|
||||
if(typeof(value.default) == typeof(123)){
|
||||
field.find('.option')
|
||||
.eq(value.default)
|
||||
.attr('selected', '')
|
||||
} else {
|
||||
field.find('.option[value="'+ value.default +'"]')
|
||||
.attr('selected', '')
|
||||
}
|
||||
}
|
||||
},
|
||||
get: function(field){
|
||||
return $(field).find('.option:selected').val()
|
||||
},
|
||||
},
|
||||
|
||||
// NOTE: a button can have state...
|
||||
// format:
|
||||
// {
|
||||
@ -787,16 +834,25 @@ function exportPreviewsDialog(state, dfl){
|
||||
'%I - global order\n'+
|
||||
'%i - current selection order'] = '%f'
|
||||
cfg['Fav directory name'] = 'fav'
|
||||
cfg['Size | '+
|
||||
'The selected size is aproximate, the actual\n'+
|
||||
'preview will be copied from cache.'] = {
|
||||
select: ['Original image'].concat(PREVIEW_SIZES.slice().sort()),
|
||||
default: 1
|
||||
}
|
||||
cfg['Destination'] = {ndir: dfl}
|
||||
|
||||
var keys = Object.keys(cfg)
|
||||
|
||||
formDialog(null, '<b>Export:</b> '+ state +'.', cfg, 'OK', 'exportPreviewsDialog')
|
||||
.done(function(data){
|
||||
var s = data[keys[2]]
|
||||
s = s == 'Original image' ? Math.max.apply(null, PREVIEW_SIZES)*2 : parseInt(s)-5
|
||||
exportTo(
|
||||
normalizePath(data[keys[2]]),
|
||||
normalizePath(data[keys[3]]),
|
||||
data[keys[0]],
|
||||
data[keys[1]])
|
||||
data[keys[1]],
|
||||
s)
|
||||
// XXX do real reporting...
|
||||
showStatusQ('Copying data...')
|
||||
res.resolve(data[''])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user