mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
more refactoring + some docs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
6bffb4db59
commit
a828ed4ec6
@ -518,23 +518,72 @@ actions.Actions({
|
|||||||
|
|
||||||
// basic image editing...
|
// basic image editing...
|
||||||
//
|
//
|
||||||
// XXX should we have .rotate(..) and .flip(..) generic actions???
|
// Rotate image...
|
||||||
rotateCW: ['Image|Edit/',
|
//
|
||||||
function(target){
|
// Rotate current image clockwise...
|
||||||
|
// .rotate()
|
||||||
|
// .rotate('cw')
|
||||||
|
// -> actions
|
||||||
|
//
|
||||||
|
// Rotate current image counterclockwise...
|
||||||
|
// .rotate('ccw')
|
||||||
|
// -> actions
|
||||||
|
//
|
||||||
|
// Rotate target image clockwise...
|
||||||
|
// .rotate(target)
|
||||||
|
// .rotate(target, 'cw')
|
||||||
|
// -> actions
|
||||||
|
//
|
||||||
|
// Rotate target image counterclockwise...
|
||||||
|
// .rotate(target, 'ccw')
|
||||||
|
// -> actions
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Flip is similar...
|
||||||
|
//
|
||||||
|
// Flip current image ('horizontal' is default)...
|
||||||
|
// .flip()
|
||||||
|
// .flip('horizontal')
|
||||||
|
// .flip('vertical')
|
||||||
|
// -> actions
|
||||||
|
//
|
||||||
|
// Flip target...
|
||||||
|
// .flip(target)
|
||||||
|
// .flip(target, 'horizontal')
|
||||||
|
// .flip(target, 'vertical')
|
||||||
|
// -> actions
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// NOTE: target must be .data.getImage(..) compatible, see it for docs...
|
||||||
|
rotate: ['- Image|Edit/Rotate image',
|
||||||
|
function(target, direction){
|
||||||
|
if(target == 'cw' || target == 'ccw'){
|
||||||
|
direction = target
|
||||||
|
target = null
|
||||||
|
}
|
||||||
this.images
|
this.images
|
||||||
&& this.images.rotateImage(this.data.getImage(target), 'cw') }],
|
&& this.images.rotateImage(this.data.getImage(target), direction || 'cw')
|
||||||
rotateCCW: ['Image|Edit/',
|
}],
|
||||||
function(target){
|
flip: ['- Flip|edit/Flip image',
|
||||||
|
function(target, direction){
|
||||||
|
if(target == 'vertical' || target == 'horizontal'){
|
||||||
|
direction = target
|
||||||
|
target = null
|
||||||
|
}
|
||||||
this.images
|
this.images
|
||||||
&& this.images.rotateImage(this.data.getImage(target), 'ccw') }],
|
&& this.images.flipImage(this.data.getImage(target), direction || 'horizontal')
|
||||||
flipVertical: ['Image|Edit/',
|
}],
|
||||||
function(target){
|
|
||||||
this.images
|
// shorthands...
|
||||||
&& this.images.flipImage(this.data.getImage(target), 'vertical') }],
|
// NOTE: these are here mostly for the menus...
|
||||||
flipHorizontal: ['Image|Edit/',
|
rotateCW: ['Image|Edit/Rotate image clockwise',
|
||||||
function(target){
|
function(target){ this.rotate(traget, 'cw') }],
|
||||||
this.images
|
rotateCCW: ['Image|Edit/Rotate image counterclockwise',
|
||||||
&& this.images.flipImage(this.data.getImage(target), 'horizontal') }],
|
function(target){ this.rotate(traget, 'ccw') }],
|
||||||
|
flipVertical: ['Image|Edit/Flip image vertically',
|
||||||
|
function(target){ this.flip(traget, 'vertical') }],
|
||||||
|
flipHorizontal: ['Image|Edit/Flip image horizontally',
|
||||||
|
function(target){ this.flip(traget, 'horizontal') }],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -88,12 +88,12 @@ module.GLOBAL_KEYBOARD = {
|
|||||||
'#2': {
|
'#2': {
|
||||||
default: 'fitNormal',
|
default: 'fitNormal',
|
||||||
'alt': 'setNormalScale -- Set current image size as normal',
|
'alt': 'setNormalScale -- Set current image size as normal',
|
||||||
'ctrl+shift': 'setNormalScale: null -- Reset normal size to default',
|
'ctrl+shift': 'setNormalScale: null -- Reset normal image size to default',
|
||||||
},
|
},
|
||||||
'#3': {
|
'#3': {
|
||||||
default: 'fitSmall',
|
default: 'fitSmall',
|
||||||
'alt': 'setSmallScale -- Set current image size as small',
|
'alt': 'setSmallScale -- Set current image size as small',
|
||||||
'ctrl+shift': 'setSmallScale: null -- Reset small size to default',
|
'ctrl+shift': 'setSmallScale: null -- Reset small image size to default',
|
||||||
},
|
},
|
||||||
'#4': customScale(4),
|
'#4': customScale(4),
|
||||||
'#5': customScale(5),
|
'#5': customScale(5),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user