mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
slideshow cleanup done...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
3c9b552c39
commit
75ddc73ba6
@ -46,11 +46,10 @@ module.GLOBAL_KEYBOARD = {
|
|||||||
Esc: 'toggleSlideshow: "off" -- Exit slideshow',
|
Esc: 'toggleSlideshow: "off" -- Exit slideshow',
|
||||||
Enter: 'slideshowDialog',
|
Enter: 'slideshowDialog',
|
||||||
|
|
||||||
// XXX do we need a spearate slideshow paused mode???
|
|
||||||
Space: 'toggleSlideshowTimer',
|
Space: 'toggleSlideshowTimer',
|
||||||
// XXX not sure about these yet...
|
|
||||||
//Left: 'resetSlideshowTimer',
|
Left: 'resetSlideshowTimer',
|
||||||
//Right: 'resetSlideshowTimer',
|
Right: 'resetSlideshowTimer',
|
||||||
Home: 'resetSlideshowTimer',
|
Home: 'resetSlideshowTimer',
|
||||||
End: 'resetSlideshowTimer',
|
End: 'resetSlideshowTimer',
|
||||||
|
|
||||||
|
|||||||
@ -176,7 +176,6 @@ core.ImageGridFeatures.Feature('imagegrid-testing', [
|
|||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------- testing ---
|
//----------------------------------------------------- testing ---
|
||||||
'ui-editor',
|
|
||||||
'experiments',
|
'experiments',
|
||||||
'-tests',
|
'-tests',
|
||||||
|
|
||||||
|
|||||||
@ -134,11 +134,6 @@ var SlideshowActions = actions.Actions({
|
|||||||
widgets.makeUIDialog(function(){
|
widgets.makeUIDialog(function(){
|
||||||
var that = this
|
var that = this
|
||||||
var spec
|
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,
|
return browse.makeLister(null,
|
||||||
function(path, make){
|
function(path, make){
|
||||||
// fields...
|
// fields...
|
||||||
@ -170,10 +165,6 @@ var SlideshowActions = actions.Actions({
|
|||||||
},{
|
},{
|
||||||
path: that.toggleSlideshow('?') == 'on' ? 'Stop' : 'Start',
|
path: that.toggleSlideshow('?') == 'on' ? 'Stop' : 'Start',
|
||||||
cls: 'table-view tail-action',
|
cls: 'table-view tail-action',
|
||||||
// reset the timer if it was not suspended outside...
|
|
||||||
close: function(){
|
|
||||||
suspended_timer
|
|
||||||
|| that.resetSlideshowTimer() },
|
|
||||||
}) })],
|
}) })],
|
||||||
slideshowButtonAction: ['- Slideshow/',
|
slideshowButtonAction: ['- Slideshow/',
|
||||||
core.doc`Slideshow button action
|
core.doc`Slideshow button action
|
||||||
@ -194,11 +185,10 @@ var SlideshowActions = actions.Actions({
|
|||||||
|
|
||||||
// settings...
|
// settings...
|
||||||
// NOTE: these are disabled as they are repeated in the slideshow dialog...
|
// NOTE: these are disabled as they are repeated in the slideshow dialog...
|
||||||
// XXX do we need both this and .slideshowDialog(???)???
|
|
||||||
slideshowIntervalDialog: ['- Slideshow/Slideshow $interval...',
|
slideshowIntervalDialog: ['- Slideshow/Slideshow $interval...',
|
||||||
widgets.makeUIDialog(function(parent){
|
widgets.makeUIDialog(function(){
|
||||||
var that = this
|
var that = this
|
||||||
var dialog = widgets.makeConfigListEditor(
|
return widgets.makeConfigListEditor(
|
||||||
that,
|
that,
|
||||||
'slideshow-intervals',
|
'slideshow-intervals',
|
||||||
'slideshow-interval',
|
'slideshow-interval',
|
||||||
@ -209,28 +199,7 @@ var SlideshowActions = actions.Actions({
|
|||||||
normalize: function(e){ return e.trim() },
|
normalize: function(e){ return e.trim() },
|
||||||
sort: function(a, b){
|
sort: function(a, b){
|
||||||
return Date.str2ms(a) - Date.str2ms(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',
|
toggleSlideshowDirection: ['- Slideshow/Slideshow $direction',
|
||||||
core.makeConfigToggler('slideshow-direction', ['forward', 'reverse'])],
|
core.makeConfigToggler('slideshow-direction', ['forward', 'reverse'])],
|
||||||
toggleSlideshowLooping: ['- Slideshow/Slideshow $looping',
|
toggleSlideshowLooping: ['- Slideshow/Slideshow $looping',
|
||||||
@ -239,17 +208,16 @@ var SlideshowActions = actions.Actions({
|
|||||||
toggleSlideshowPauseOnBlur: ['Interface|Slideshow/Slideshow pause on app blur',
|
toggleSlideshowPauseOnBlur: ['Interface|Slideshow/Slideshow pause on app blur',
|
||||||
core.makeConfigToggler('slideshow-pause-on-blur', ['on', 'off'])],
|
core.makeConfigToggler('slideshow-pause-on-blur', ['on', 'off'])],
|
||||||
|
|
||||||
// XXX make these stack-like...
|
|
||||||
resetSlideshowTimer: ['- Slideshow/Reset slideshow timer',
|
resetSlideshowTimer: ['- Slideshow/Reset slideshow timer',
|
||||||
function(){
|
function(){
|
||||||
this.__slideshow_timer && this.toggleSlideshow('on') }],
|
this.__slideshow_timer
|
||||||
|
&& this.toggleSlideshowTimer('?') != 'paused'
|
||||||
|
&& this.toggleSlideshow('on') }],
|
||||||
suspendSlideshowTimer: ['- Slideshow/Suspend slideshow timer',
|
suspendSlideshowTimer: ['- Slideshow/Suspend slideshow timer',
|
||||||
function(){
|
function(){
|
||||||
if(this.__slideshow_timer){
|
if(this.__slideshow_timer){
|
||||||
clearInterval(this.__slideshow_timer)
|
clearInterval(this.__slideshow_timer)
|
||||||
this.__slideshow_timer = 'suspended'
|
this.__slideshow_timer = 'suspended' } }],
|
||||||
}
|
|
||||||
}],
|
|
||||||
|
|
||||||
toggleSlideshowTimer: ['Slideshow/Pause or resume running slideshow',
|
toggleSlideshowTimer: ['Slideshow/Pause or resume running slideshow',
|
||||||
core.doc`
|
core.doc`
|
||||||
@ -277,7 +245,7 @@ var SlideshowActions = actions.Actions({
|
|||||||
return 'paused'
|
return 'paused'
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.resetSlideshowTimer()
|
this.toggleSlideshow('on')
|
||||||
return 'running'
|
return 'running'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -301,6 +269,7 @@ module.Slideshow = core.ImageGridFeatures.Feature({
|
|||||||
depends: [
|
depends: [
|
||||||
'ui',
|
'ui',
|
||||||
'ui-control',
|
'ui-control',
|
||||||
|
'ui-editor',
|
||||||
'ui-single-image',
|
'ui-single-image',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
@ -1385,6 +1385,8 @@ var EditorActions = actions.Actions({
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
NOTE: for examples see: .exampleEditor(..) and .exampleEmbededEditor(..)
|
||||||
|
of 'ui-action-examples' feature...
|
||||||
`,
|
`,
|
||||||
makeUIDialog(function(spec, callback){
|
makeUIDialog(function(spec, callback){
|
||||||
var that = this
|
var that = this
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user