diff --git a/ui (gen4)/features/keyboard.js b/ui (gen4)/features/keyboard.js index b4776815..dbcda968 100755 --- a/ui (gen4)/features/keyboard.js +++ b/ui (gen4)/features/keyboard.js @@ -46,11 +46,10 @@ module.GLOBAL_KEYBOARD = { Esc: 'toggleSlideshow: "off" -- Exit slideshow', Enter: 'slideshowDialog', - // XXX do we need a spearate slideshow paused mode??? Space: 'toggleSlideshowTimer', - // XXX not sure about these yet... - //Left: 'resetSlideshowTimer', - //Right: 'resetSlideshowTimer', + + Left: 'resetSlideshowTimer', + Right: 'resetSlideshowTimer', Home: 'resetSlideshowTimer', End: 'resetSlideshowTimer', diff --git a/ui (gen4)/features/meta.js b/ui (gen4)/features/meta.js index 721f7475..9f5bc48a 100755 --- a/ui (gen4)/features/meta.js +++ b/ui (gen4)/features/meta.js @@ -176,7 +176,6 @@ core.ImageGridFeatures.Feature('imagegrid-testing', [ //----------------------------------------------------- testing --- - 'ui-editor', 'experiments', '-tests', diff --git a/ui (gen4)/features/ui-slideshow.js b/ui (gen4)/features/ui-slideshow.js index 32078190..ad728fe8 100755 --- a/ui (gen4)/features/ui-slideshow.js +++ b/ui (gen4)/features/ui-slideshow.js @@ -134,11 +134,6 @@ var SlideshowActions = actions.Actions({ widgets.makeUIDialog(function(){ var that = this var spec - // suspend the timer if it's not suspended outside... - var suspended_timer = this.__slideshow_timer == 'suspended' - suspended_timer - || this.suspendSlideshowTimer() - return browse.makeLister(null, function(path, make){ // fields... @@ -170,10 +165,6 @@ var SlideshowActions = actions.Actions({ },{ path: that.toggleSlideshow('?') == 'on' ? 'Stop' : 'Start', cls: 'table-view tail-action', - // reset the timer if it was not suspended outside... - close: function(){ - suspended_timer - || that.resetSlideshowTimer() }, }) })], slideshowButtonAction: ['- Slideshow/', core.doc`Slideshow button action @@ -194,11 +185,10 @@ var SlideshowActions = actions.Actions({ // settings... // NOTE: these are disabled as they are repeated in the slideshow dialog... - // XXX do we need both this and .slideshowDialog(???)??? slideshowIntervalDialog: ['- Slideshow/Slideshow $interval...', - widgets.makeUIDialog(function(parent){ + widgets.makeUIDialog(function(){ var that = this - var dialog = widgets.makeConfigListEditor( + return widgets.makeConfigListEditor( that, 'slideshow-intervals', 'slideshow-interval', @@ -209,28 +199,7 @@ var SlideshowActions = actions.Actions({ normalize: function(e){ return e.trim() }, sort: function(a, b){ return Date.str2ms(a) - Date.str2ms(b) }, - }) - .on('start', function(){ - // suspend the timer if it's not suspended outside... - this.__slideshow_timer == 'suspended' - || this.suspendSlideshowTimer() - }) - .on('close', function(){ - // reset the timer if it was not suspended outside... - this.__slideshow_timer == 'suspended' - || that.resetSlideshowTimer() - - if(parent){ - var txt = parent.select('!').find('.text').first().text() - - parent.update() - .then(function(){ - txt != '' - && parent.select(txt) }) - } - }) - return dialog - })], + }) })], toggleSlideshowDirection: ['- Slideshow/Slideshow $direction', core.makeConfigToggler('slideshow-direction', ['forward', 'reverse'])], toggleSlideshowLooping: ['- Slideshow/Slideshow $looping', @@ -239,17 +208,16 @@ var SlideshowActions = actions.Actions({ toggleSlideshowPauseOnBlur: ['Interface|Slideshow/Slideshow pause on app blur', core.makeConfigToggler('slideshow-pause-on-blur', ['on', 'off'])], - // XXX make these stack-like... resetSlideshowTimer: ['- Slideshow/Reset slideshow timer', function(){ - this.__slideshow_timer && this.toggleSlideshow('on') }], + this.__slideshow_timer + && this.toggleSlideshowTimer('?') != 'paused' + && this.toggleSlideshow('on') }], suspendSlideshowTimer: ['- Slideshow/Suspend slideshow timer', function(){ if(this.__slideshow_timer){ clearInterval(this.__slideshow_timer) - this.__slideshow_timer = 'suspended' - } - }], + this.__slideshow_timer = 'suspended' } }], toggleSlideshowTimer: ['Slideshow/Pause or resume running slideshow', core.doc` @@ -277,7 +245,7 @@ var SlideshowActions = actions.Actions({ return 'paused' } else { - this.resetSlideshowTimer() + this.toggleSlideshow('on') return 'running' } }, @@ -301,6 +269,7 @@ module.Slideshow = core.ImageGridFeatures.Feature({ depends: [ 'ui', 'ui-control', + 'ui-editor', 'ui-single-image', ], diff --git a/ui (gen4)/features/ui-widgets.js b/ui (gen4)/features/ui-widgets.js index 1e64931f..5bb524fd 100755 --- a/ui (gen4)/features/ui-widgets.js +++ b/ui (gen4)/features/ui-widgets.js @@ -1385,6 +1385,8 @@ var EditorActions = actions.Actions({ + NOTE: for examples see: .exampleEditor(..) and .exampleEmbededEditor(..) + of 'ui-action-examples' feature... `, makeUIDialog(function(spec, callback){ var that = this