| 
									
										
										
										
											2016-03-12 06:24:35 +03:00
										 |  |  | /********************************************************************** | 
					
						
							|  |  |  | *  | 
					
						
							|  |  |  | * | 
					
						
							|  |  |  | * | 
					
						
							|  |  |  | **********************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | define(function(require){ var module = {} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //var DEBUG = DEBUG != null ? DEBUG : true
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | var toggler = require('lib/toggler') | 
					
						
							|  |  |  | var actions = require('lib/actions') | 
					
						
							|  |  |  | var features = require('lib/features') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | var core = require('features/core') | 
					
						
							|  |  |  | var base = require('features/base') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | var browse = require('lib/widget/browse') | 
					
						
							|  |  |  | var overlay = require('lib/widget/overlay') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-12 06:24:35 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-29 07:34:49 +03:00
										 |  |  | /*********************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | var _cmpTimes = function(a, b){ | 
					
						
							|  |  |  | 	return Date.str2ms(a) - Date.str2ms(b) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-12 06:24:35 +03:00
										 |  |  | /*********************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-30 15:24:01 +03:00
										 |  |  | // NOTE: this uses ui-chrome-hidden workspace to set the initial state
 | 
					
						
							|  |  |  | // 		of the slideshow workspace.
 | 
					
						
							|  |  |  | //
 | 
					
						
							| 
									
										
										
										
											2016-03-29 05:17:50 +03:00
										 |  |  | // XXX would be a good idea to add provision for a timer to indicate 
 | 
					
						
							|  |  |  | // 		slideshow progress/status... 
 | 
					
						
							| 
									
										
										
										
											2016-03-12 06:24:35 +03:00
										 |  |  | var SlideshowActions = actions.Actions({ | 
					
						
							|  |  |  | 	config: { | 
					
						
							| 
									
										
										
										
											2016-03-29 05:22:36 +03:00
										 |  |  | 		'slideshow-looping': 'on', | 
					
						
							|  |  |  | 		'slideshow-direction': 'forward', | 
					
						
							|  |  |  | 		'slideshow-interval': '3s', | 
					
						
							| 
									
										
										
										
											2016-03-27 20:07:48 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-29 05:22:36 +03:00
										 |  |  | 		'slideshow-intervals': [ | 
					
						
							| 
									
										
										
										
											2016-03-27 20:07:48 +03:00
										 |  |  | 			'0.2s', | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 			'1s', | 
					
						
							| 
									
										
										
										
											2016-03-27 20:07:48 +03:00
										 |  |  | 			'3s', | 
					
						
							|  |  |  | 			'5s', | 
					
						
							|  |  |  | 			'7s', | 
					
						
							|  |  |  | 		], | 
					
						
							| 
									
										
										
										
											2016-03-12 06:24:35 +03:00
										 |  |  | 	}, | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 	// XXX make interval editable...
 | 
					
						
							| 
									
										
										
										
											2016-03-12 06:24:35 +03:00
										 |  |  | 	// 		i.e.
 | 
					
						
							|  |  |  | 	// 			Interval: 3s /		-- 3s is editable...
 | 
					
						
							|  |  |  | 	// 				0.2		x		-- a history of values that can be 
 | 
					
						
							|  |  |  | 	// 									selected w/o closing the dialog
 | 
					
						
							|  |  |  | 	// 									or can be removed...
 | 
					
						
							|  |  |  | 	// 				1		x
 | 
					
						
							|  |  |  | 	// 				3		x
 | 
					
						
							|  |  |  | 	// 				Custom...		-- editable/placeholder... 'enter' 
 | 
					
						
							|  |  |  | 	// 									selects value and adds it to 
 | 
					
						
							|  |  |  | 	// 									history...
 | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 	// XXX BUG: there are still problems with focus...
 | 
					
						
							|  |  |  | 	// 		to reproduce:
 | 
					
						
							|  |  |  | 	// 			click on the first option with a mouse...
 | 
					
						
							|  |  |  | 	// 		result:
 | 
					
						
							|  |  |  | 	// 			the top dialog is not focused...
 | 
					
						
							| 
									
										
										
										
											2016-04-07 05:41:06 +03:00
										 |  |  | 	slideshowDialog: ['Slideshow/Slideshow settings and start', | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 		function(){ | 
					
						
							|  |  |  | 			var that = this | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			this.suspendSlideshowTimer() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			var o = overlay.Overlay(this.ribbons.viewer,  | 
					
						
							|  |  |  | 				browse.makeList( | 
					
						
							|  |  |  | 					null, | 
					
						
							|  |  |  | 					[ | 
					
						
							| 
									
										
										
										
											2016-03-29 07:34:49 +03:00
										 |  |  | 						// XXX make this editable...
 | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 						['Interval: ',  | 
					
						
							| 
									
										
										
										
											2016-03-29 05:22:36 +03:00
										 |  |  | 							function(){ return that.config['slideshow-interval'] }], | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 						['Direction: ',  | 
					
						
							| 
									
										
										
										
											2016-03-29 05:22:36 +03:00
										 |  |  | 							function(){ return that.config['slideshow-direction'] }], | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 						['Looping: ',  | 
					
						
							| 
									
										
										
										
											2016-03-29 05:22:36 +03:00
										 |  |  | 							function(){ return that.config['slideshow-looping'] }], | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 						'---', | 
					
						
							|  |  |  | 						[function(){  | 
					
						
							|  |  |  | 							return that.toggleSlideshow('?') == 'on' ? 'Stop' : 'Start' }], | 
					
						
							|  |  |  | 					]) | 
					
						
							|  |  |  | 					.open(function(evt, path){ | 
					
						
							|  |  |  | 						// start/stop...
 | 
					
						
							|  |  |  | 						if(path == 'Start' || path == 'Stop'){ | 
					
						
							|  |  |  | 							that.toggleSlideshow() | 
					
						
							|  |  |  | 							o.close() | 
					
						
							|  |  |  | 							return | 
					
						
							|  |  |  | 						} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 						// interval...
 | 
					
						
							|  |  |  | 						// XXX add custom interval editing...
 | 
					
						
							|  |  |  | 						if(/interval/i.test(path)){ | 
					
						
							|  |  |  | 							var to_remove = [] | 
					
						
							|  |  |  | 							var oo = overlay.Overlay(that.ribbons.viewer,  | 
					
						
							|  |  |  | 								browse.makeList( null,  | 
					
						
							| 
									
										
										
										
											2016-03-29 07:34:49 +03:00
										 |  |  | 									that.config['slideshow-intervals'] | 
					
						
							|  |  |  | 										.concat([ | 
					
						
							|  |  |  | 											// XXX do we add a new item here???
 | 
					
						
							|  |  |  | 											//'---', 
 | 
					
						
							|  |  |  | 											//'New'
 | 
					
						
							|  |  |  | 										]),  | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 									{itemButtons: [ | 
					
						
							|  |  |  | 										// mark for removal...
 | 
					
						
							|  |  |  | 										['×',  | 
					
						
							|  |  |  | 											function(p){ | 
					
						
							|  |  |  | 												var e = this.filter('"'+p+'"', false) | 
					
						
							|  |  |  | 													.toggleClass('strike-out') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 												if(e.hasClass('strike-out')){ | 
					
						
							|  |  |  | 													to_remove.indexOf(p) < 0  | 
					
						
							|  |  |  | 														&& to_remove.push(p) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 												} else { | 
					
						
							|  |  |  | 													var i = to_remove.indexOf(p) | 
					
						
							|  |  |  | 													if(i >= 0){ | 
					
						
							|  |  |  | 														to_remove.splice(i, 1) | 
					
						
							|  |  |  | 													} | 
					
						
							|  |  |  | 												} | 
					
						
							|  |  |  | 											}], | 
					
						
							|  |  |  | 									]}) | 
					
						
							|  |  |  | 									.open(function(evt, time){ | 
					
						
							| 
									
										
										
										
											2016-03-29 07:34:49 +03:00
										 |  |  | 										if(/new/i.test(time)){ | 
					
						
							|  |  |  | 											// XXX edit...
 | 
					
						
							|  |  |  | 											// XXX
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 										} else { | 
					
						
							|  |  |  | 											that.config['slideshow-interval'] = time | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 											// XXX this is ugly...
 | 
					
						
							|  |  |  | 											oo.close() | 
					
						
							|  |  |  | 											o.client.update() | 
					
						
							|  |  |  | 											o.client.select(path.split(':')[0]) | 
					
						
							|  |  |  | 										} | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 									})) | 
					
						
							|  |  |  | 								.close(function(){ | 
					
						
							|  |  |  | 									// remove striked items...
 | 
					
						
							|  |  |  | 									to_remove.forEach(function(e){ | 
					
						
							| 
									
										
										
										
											2016-03-29 05:22:36 +03:00
										 |  |  | 										var lst = that.config['slideshow-intervals'].slice() | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 										lst.splice(lst.indexOf(e), 1) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-29 05:22:36 +03:00
										 |  |  | 										that.config['slideshow-intervals'] = lst | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 									}) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-29 07:34:49 +03:00
										 |  |  | 									// XXX add new items...
 | 
					
						
							|  |  |  | 									// XXX
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 									// sort the times...
 | 
					
						
							|  |  |  | 									that.config['slideshow-intervals'] = | 
					
						
							|  |  |  | 										that.config['slideshow-intervals'] | 
					
						
							|  |  |  | 											.sort(function(a, b){ | 
					
						
							|  |  |  | 												return Date.str2ms(a) - Date.str2ms(b) | 
					
						
							|  |  |  | 											}) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 									// XXX this is ugly...
 | 
					
						
							|  |  |  | 									o.focus() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 									if(that.toggleSlideshow('?') == 'on'){ | 
					
						
							|  |  |  | 										o.close() | 
					
						
							|  |  |  | 									} | 
					
						
							|  |  |  | 								}) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-29 05:22:36 +03:00
										 |  |  | 							oo.client.select(that.config['slideshow-interval']) | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 							return | 
					
						
							|  |  |  | 						} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 						// direction...
 | 
					
						
							|  |  |  | 						if(/direction/i.test(path)){ | 
					
						
							|  |  |  | 							that.toggleSlideshowDirection() | 
					
						
							|  |  |  | 							o.client.update() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 						// Looping...
 | 
					
						
							|  |  |  | 						} else if(/looping/i.test(path)){ | 
					
						
							|  |  |  | 							that.toggleSlideshowLooping() | 
					
						
							|  |  |  | 							o.client.update() | 
					
						
							|  |  |  | 						} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 						// XXX this is ugly...
 | 
					
						
							|  |  |  | 						o.client.select(path.split(':')[0]) | 
					
						
							| 
									
										
										
										
											2016-03-28 21:46:05 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 						// do not keep the dialog open during the slideshow...
 | 
					
						
							|  |  |  | 						if(that.toggleSlideshow('?') == 'on'){ | 
					
						
							|  |  |  | 							o.close() | 
					
						
							|  |  |  | 						} | 
					
						
							|  |  |  | 					})) | 
					
						
							|  |  |  | 				.close(function(){ | 
					
						
							|  |  |  | 					that.resetSlideshowTimer() | 
					
						
							|  |  |  | 				}) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			o.client.dom.addClass('metadata-view') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			o.client.select(-1) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			return o | 
					
						
							|  |  |  | 		}], | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 	// XXX add a custom time setting...
 | 
					
						
							| 
									
										
										
										
											2016-04-07 05:41:06 +03:00
										 |  |  | 	toggleSlideshowInterval: ['- Slideshow/Slideshow interval', | 
					
						
							| 
									
										
										
										
											2016-03-29 05:22:36 +03:00
										 |  |  | 		core.makeConfigToggler('slideshow-interval',  | 
					
						
							|  |  |  | 			function(){ return this.config['slideshow-intervals'] }, | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 			function(){ this.resetSlideshowTimer() })], | 
					
						
							| 
									
										
										
										
											2016-04-07 05:41:06 +03:00
										 |  |  | 	toggleSlideshowDirection: ['- Slideshow/Slideshow direction', | 
					
						
							| 
									
										
										
										
											2016-03-29 05:22:36 +03:00
										 |  |  | 		core.makeConfigToggler('slideshow-direction', ['forward', 'reverse'])], | 
					
						
							| 
									
										
										
										
											2016-04-07 05:41:06 +03:00
										 |  |  | 	toggleSlideshowLooping: ['- Slideshow/Slideshow looping', | 
					
						
							| 
									
										
										
										
											2016-03-29 05:22:36 +03:00
										 |  |  | 		core.makeConfigToggler('slideshow-looping', ['on', 'off'])], | 
					
						
							| 
									
										
										
										
											2016-03-29 00:31:50 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-04-07 05:41:06 +03:00
										 |  |  | 	toggleSlideshow: ['Slideshow/Slideshow quick toggle', | 
					
						
							| 
									
										
										
										
											2016-03-28 21:46:05 +03:00
										 |  |  | 		toggler.CSSClassToggler( | 
					
						
							|  |  |  | 			function(){ return this.ribbons.viewer },  | 
					
						
							|  |  |  | 			'slideshow-running', | 
					
						
							|  |  |  | 			function(state){ | 
					
						
							|  |  |  | 				// start...
 | 
					
						
							|  |  |  | 				if(state == 'on'){ | 
					
						
							|  |  |  | 					var that = this | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 					// reset the timer...
 | 
					
						
							|  |  |  | 					// NOTE: this means we were in a slideshow mode so we do not
 | 
					
						
							|  |  |  | 					// 		need to prepare...
 | 
					
						
							|  |  |  | 					if(this.__slideshouw_timer){ | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 						this.__slideshouw_timer != 'suspended' | 
					
						
							|  |  |  | 							&& clearInterval(this.__slideshouw_timer) | 
					
						
							| 
									
										
										
										
											2016-03-28 21:46:05 +03:00
										 |  |  | 						delete this.__slideshouw_timer | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 					// prepare for the slideshow...
 | 
					
						
							|  |  |  | 					} else { | 
					
						
							| 
									
										
										
										
											2016-03-29 00:31:50 +03:00
										 |  |  | 						// save current workspace...
 | 
					
						
							|  |  |  | 						this.__pre_slideshow_workspace = this.workspace | 
					
						
							|  |  |  | 						this.saveWorkspace()  | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-29 05:17:50 +03:00
										 |  |  | 						// construct the slideshow workspace if it does
 | 
					
						
							|  |  |  | 						// not exist...
 | 
					
						
							|  |  |  | 						//
 | 
					
						
							|  |  |  | 						// NOTE: this is partially redundant with the 
 | 
					
						
							|  |  |  | 						// 		loadWorkspace.pre handler in the feature...
 | 
					
						
							| 
									
										
										
										
											2016-03-29 00:31:50 +03:00
										 |  |  | 						if(this.workspaces['slideshow'] == null){ | 
					
						
							| 
									
										
										
										
											2016-03-30 15:24:01 +03:00
										 |  |  | 							this.loadWorkspace('ui-chrome-hidden')  | 
					
						
							| 
									
										
										
										
											2016-03-29 00:31:50 +03:00
										 |  |  | 							this.saveWorkspace('slideshow')  | 
					
						
							| 
									
										
										
										
											2016-03-29 05:17:50 +03:00
										 |  |  | 						} | 
					
						
							| 
									
										
										
										
											2016-03-29 00:31:50 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 						// load the slideshow workspace...
 | 
					
						
							| 
									
										
										
										
											2016-03-29 05:17:50 +03:00
										 |  |  | 						this.loadWorkspace('slideshow') | 
					
						
							| 
									
										
										
										
											2016-03-28 21:46:05 +03:00
										 |  |  | 				 | 
					
						
							|  |  |  | 						// single image mode...
 | 
					
						
							|  |  |  | 						this.toggleSingleImage('on') | 
					
						
							|  |  |  | 					} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 					// start the timer... 
 | 
					
						
							|  |  |  | 					this.__slideshouw_timer = setInterval(function(){ | 
					
						
							|  |  |  | 						var cur = that.current | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 						// next step...
 | 
					
						
							| 
									
										
										
										
											2016-03-29 05:22:36 +03:00
										 |  |  | 						that.config['slideshow-direction'] == 'forward' ? | 
					
						
							| 
									
										
										
										
											2016-03-28 21:46:05 +03:00
										 |  |  | 							that.nextImage() | 
					
						
							|  |  |  | 							: that.prevImage() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 						// we have reached the end...
 | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 						if(that.current == cur){ | 
					
						
							|  |  |  | 							// loop...
 | 
					
						
							| 
									
										
										
										
											2016-03-29 05:22:36 +03:00
										 |  |  | 							if(that.config['slideshow-looping'] == 'on'){ | 
					
						
							|  |  |  | 								that.config['slideshow-direction'] == 'forward' ? | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 									that.firstImage() | 
					
						
							|  |  |  | 									: that.lastImage() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 							// stop...
 | 
					
						
							|  |  |  | 							} else { | 
					
						
							|  |  |  | 								that.toggleSlideshow('off') | 
					
						
							|  |  |  | 							} | 
					
						
							| 
									
										
										
										
											2016-03-28 21:46:05 +03:00
										 |  |  | 						} | 
					
						
							| 
									
										
										
										
											2016-03-29 05:22:36 +03:00
										 |  |  | 					}, Date.str2ms(this.config['slideshow-interval'] || '3s')) | 
					
						
							| 
									
										
										
										
											2016-03-28 21:46:05 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 				// stop...
 | 
					
						
							|  |  |  | 				} else { | 
					
						
							| 
									
										
										
										
											2016-03-29 00:58:20 +03:00
										 |  |  | 					this.saveWorkspace('slideshow')  | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-28 21:46:05 +03:00
										 |  |  | 					// stop timer...
 | 
					
						
							| 
									
										
										
										
											2016-03-29 00:31:50 +03:00
										 |  |  | 					this.__slideshouw_timer | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 						&& clearInterval(this.__slideshouw_timer) | 
					
						
							| 
									
										
										
										
											2016-03-28 21:46:05 +03:00
										 |  |  | 					delete this.__slideshouw_timer | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-29 05:17:50 +03:00
										 |  |  | 					// restore the original workspace...
 | 
					
						
							| 
									
										
										
										
											2016-03-29 00:31:50 +03:00
										 |  |  | 					this.__pre_slideshow_workspace && | 
					
						
							|  |  |  | 						this.loadWorkspace(this.__pre_slideshow_workspace) | 
					
						
							|  |  |  | 					delete this.__pre_slideshow_workspace | 
					
						
							| 
									
										
										
										
											2016-03-27 20:07:48 +03:00
										 |  |  | 				} | 
					
						
							| 
									
										
										
										
											2016-03-28 21:46:05 +03:00
										 |  |  | 			})], | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// NOTE: these can be used as pause and resume...
 | 
					
						
							|  |  |  | 	resetSlideshowTimer: ['- Slideshow/', | 
					
						
							| 
									
										
										
										
											2016-03-27 20:07:48 +03:00
										 |  |  | 		function(){ | 
					
						
							| 
									
										
										
										
											2016-03-28 21:46:05 +03:00
										 |  |  | 			this.__slideshouw_timer && this.toggleSlideshow('on') | 
					
						
							| 
									
										
										
										
											2016-03-27 20:07:48 +03:00
										 |  |  | 		}], | 
					
						
							| 
									
										
										
										
											2016-03-29 03:09:31 +03:00
										 |  |  | 	suspendSlideshowTimer: ['- Slideshow/', | 
					
						
							|  |  |  | 		function(){ | 
					
						
							|  |  |  | 			if(this.__slideshouw_timer){ | 
					
						
							|  |  |  | 				clearInterval(this.__slideshouw_timer) | 
					
						
							|  |  |  | 				this.__slideshouw_timer = 'suspended' | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		}], | 
					
						
							| 
									
										
										
										
											2016-03-12 06:24:35 +03:00
										 |  |  | }) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | var Slideshow =  | 
					
						
							|  |  |  | module.Slideshow = core.ImageGridFeatures.Feature({ | 
					
						
							|  |  |  | 	title: '', | 
					
						
							|  |  |  | 	doc: '', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	tag: 'ui-slideshow', | 
					
						
							|  |  |  | 	depends: [ | 
					
						
							|  |  |  | 		'ui', | 
					
						
							| 
									
										
										
										
											2016-03-27 20:07:48 +03:00
										 |  |  | 		'ui-single-image-view', | 
					
						
							| 
									
										
										
										
											2016-03-12 06:24:35 +03:00
										 |  |  | 	], | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	actions: SlideshowActions, | 
					
						
							| 
									
										
										
										
											2016-03-29 00:31:50 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	handlers: [ | 
					
						
							| 
									
										
										
										
											2016-03-29 05:17:50 +03:00
										 |  |  | 		// add a placeholder for slideshow workspace, this is to make the
 | 
					
						
							|  |  |  | 		// workspace toggler show it as one of the options...
 | 
					
						
							|  |  |  | 		//
 | 
					
						
							|  |  |  | 		// NOTE: the slideshow workspace will get populated either on 
 | 
					
						
							|  |  |  | 		// 		loading it for the first time or on first running a 
 | 
					
						
							|  |  |  | 		// 		slideshow...
 | 
					
						
							|  |  |  | 		['start', | 
					
						
							|  |  |  | 			function(){  | 
					
						
							|  |  |  | 				if(this.workspaces['slideshow'] == null){ | 
					
						
							|  |  |  | 					this.workspaces['slideshow'] = null | 
					
						
							|  |  |  | 				}  | 
					
						
							|  |  |  | 			}], | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		// build the slideshow workspace for the first time if it's not
 | 
					
						
							|  |  |  | 		// present yet (is null)...
 | 
					
						
							|  |  |  | 		['loadWorkspace.pre', | 
					
						
							|  |  |  | 			function(workspace){ | 
					
						
							|  |  |  | 				if(workspace == 'slideshow' && this.workspaces['slideshow'] == null){ | 
					
						
							|  |  |  | 					return function(){ | 
					
						
							| 
									
										
										
										
											2016-03-30 15:24:01 +03:00
										 |  |  | 						this.loadWorkspace('ui-chrome-hidden')  | 
					
						
							| 
									
										
										
										
											2016-03-29 05:17:50 +03:00
										 |  |  | 						this.saveWorkspace('slideshow')  | 
					
						
							|  |  |  | 					} | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			}], | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		// do not leave the viewer in slideshow mode...
 | 
					
						
							| 
									
										
										
										
											2016-03-29 00:31:50 +03:00
										 |  |  | 		['stop', | 
					
						
							|  |  |  | 			function(){ this.toggleSlideshow('off') }] | 
					
						
							|  |  |  | 	], | 
					
						
							| 
									
										
										
										
											2016-03-12 06:24:35 +03:00
										 |  |  | }) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /********************************************************************** | 
					
						
							|  |  |  | * vim:set ts=4 sw=4 :                                                */ | 
					
						
							|  |  |  | return module }) |