added "this and above" crop mode and a crop dialog...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-11-16 01:54:50 +04:00
parent 9534644b5d
commit 40349ac968
2 changed files with 48 additions and 0 deletions

View File

@ -689,6 +689,8 @@ var KEYBOARD_CONFIG = {
// XXX make F4 a default editor and E a default viewer...
F4: 'E',
C: doc('Show crop dialog', cropImagesDialog),
// info...
I: {
default: doc('Show current image info',

View File

@ -1050,6 +1050,52 @@ function sortImagesDialog(){
}
function cropImagesDialog(){
updateStatus('Crop...').show()
var alg = 'Crop:|'+
'Use Esc and Shift-Esc to exit crop modes.'+
'\n\n'+
'NOTE: currently mixing crop modes is not supported,\n'+
'thus, if you are in a particular crop mode, you can\n'+
'only use that mode to crop again.\n'+
'...This restriction will be removed later.'
cfg = {}
cfg[alg] = [
'Marked images',
'Current ribbon',
'Current ribbon and above'
]
formDialog(null, '',
cfg,
'OK',
'cropImagesDialog')
.done(function(res){
res = res[alg]
if(/Marked/i.test(res)){
var method = toggleMarkedOnlyView
} else if(/Current ribbon/i.test(res)){
var method = toggleSingleRibbonMode
} else if(/Current ribbon and above/i.test(res)){
var method = toggleCurrenAndAboveRibbonsMode
}
showStatusQ('Cropped: '+res+'...')
method('on')
})
.fail(function(){
showStatusQ('Crop: canceled.')
})
}
// XXX get EXIF, IPTC...
function showImageInfo(){
var gid = getImageGID(getImage())