some refactoring + bugfix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-07-23 23:03:19 +03:00
parent 58ca38619d
commit bd9027094b
5 changed files with 22 additions and 16 deletions

View File

@ -170,8 +170,7 @@ var AppControlActions = actions.Actions({
var base = image.base_path || this.location.path var base = image.base_path || this.location.path
var filename = image.path var filename = image.path
var path = pathlib.normalize(base + '/' + filename)
path = pathlib.normalize(base + '/' + filename)
nw.Shell.showItemInFolder(path) nw.Shell.showItemInFolder(path)
}], }],

View File

@ -348,15 +348,15 @@ var ImageMarkEditActions = actions.Actions({
shiftMarked('down')], shiftMarked('down')],
// XXX undo... // XXX undo...
shiftMarkedAfter: ['Mark|Ribbon/Shift marked after image', shiftMarkedAfter: ['Mark|Ribbon/Shift marked after',
{browseMode: 'cropMarked'}, {browseMode: 'cropMarked'},
function(target){ function(target){
this.shiftMarkedTo(this.marked, target || 'current', 'after') }], this.shiftImageTo(this.marked, target || 'current', 'after') }],
// XXX undo... // XXX undo...
shiftMarkedBefore: ['Mark|Ribbon/Shift marked before image', shiftMarkedBefore: ['Mark|Ribbon/Shift marked before',
{browseMode: 'cropMarked'}, {browseMode: 'cropMarked'},
function(target){ function(target){
this.shiftMarkedTo(this.marked, target || 'current', 'before') }], this.shiftImageTo(this.marked, target || 'current', 'before') }],
}) })
var ImageEditMarks = var ImageEditMarks =

View File

@ -4,19 +4,19 @@
* *
**********************************************************************/ **********************************************************************/
// XXX this is a hack...
// ...need a way to escape these so as not to load them in browser...
if(typeof(process) != 'undefined'){
var fs = require('fs')
var path = require('path')
var exiftool = require('exiftool')
}
((typeof define)[0]=='u'?function(f){module.exports=f(require)}:define) ((typeof define)[0]=='u'?function(f){module.exports=f(require)}:define)
(function(require){ var module={} // make module AMD/node compatible... (function(require){ var module={} // make module AMD/node compatible...
/*********************************************************************/ /*********************************************************************/
// XXX this is a hack...
// ...need a way to escape these so as not to load them in browser...
if(typeof(process) != 'undefined'){
var fs = requirejs('fs')
var path = requirejs('path')
var exiftool = requirejs('exiftool')
}
var util = require('lib/util') var util = require('lib/util')
var toggler = require('lib/toggler') var toggler = require('lib/toggler')
var tasks = require('lib/tasks') var tasks = require('lib/tasks')
@ -168,7 +168,7 @@ var MetadataReaderActions = actions.Actions({
}], }],
// XXX STUB: add support for this to .readMetadata(..) // XXX STUB: add support for this to .readMetadata(..)
readAllMetadata: ['- Image/Read all metadata', readAllMetadata: ['File/Read all metadata',
function(){ function(){
var that = this var that = this
// XXX make this a global API... // XXX make this a global API...

View File

@ -770,6 +770,9 @@ module.ShiftAnimation = core.ImageGridFeatures.Feature({
depends: [ depends: [
'ui-ribbons-render', 'ui-ribbons-render',
], ],
// NOTE: this will allow the animations to start as early as possible
// in the action call...
priority: 'high',
config: { config: {
// XXX make this duration... // XXX make this duration...

View File

@ -338,6 +338,10 @@ module.SingleImageView = core.ImageGridFeatures.Feature({
actions: SingleImageActions, actions: SingleImageActions,
handlers:[ handlers:[
['load.pre',
function(){
this.toggleSingleImage('?') == 'on'
&& this.toggleSingleImage('off') }],
// update config... // update config...
//['resizing.post', //['resizing.post',
['resizingDone resizingWindow', ['resizingDone resizingWindow',