mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 03:10:07 +00:00 
			
		
		
		
	added a 'single-image' workspace + added push/pop worspace actions...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									58b1672ab8
								
							
						
					
					
						commit
						14d1b9410e
					
				| @ -1251,6 +1251,22 @@ stretching in width... */ | |||||||
| 	content: "Global"; | 	content: "Global"; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | /* gid */ | ||||||
|  | .overlay-info .gid { | ||||||
|  | 	opacity: 0.7; | ||||||
|  | } | ||||||
|  | .overlay-info .gid:hover { | ||||||
|  | 	opacity: 1; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | .overlay-info .path { | ||||||
|  | 	opacity: 0.7; | ||||||
|  | } | ||||||
|  | .overlay-info .path:hover { | ||||||
|  | 	opacity: 1; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| /*************************************************** Global status ***/ | /*************************************************** Global status ***/ | ||||||
|  | |||||||
| @ -330,6 +330,8 @@ module.makeWorkspaceConfigLoader = function(keys, callback){ | |||||||
| 
 | 
 | ||||||
| var WorkspaceActions = actions.Actions({ | var WorkspaceActions = actions.Actions({ | ||||||
| 	config: { | 	config: { | ||||||
|  | 		'load-workspace': 'default', | ||||||
|  | 
 | ||||||
| 		'workspace': 'default', | 		'workspace': 'default', | ||||||
| 		'workspaces': {}, | 		'workspaces': {}, | ||||||
| 	}, | 	}, | ||||||
| @ -396,6 +398,28 @@ var WorkspaceActions = actions.Actions({ | |||||||
| 		makeConfigToggler('workspace', | 		makeConfigToggler('workspace', | ||||||
| 			function(){ return Object.keys(this.config['workspaces']) }, | 			function(){ return Object.keys(this.config['workspaces']) }, | ||||||
| 			function(state){ this.loadWorkspace(state) })], | 			function(state){ this.loadWorkspace(state) })], | ||||||
|  | 
 | ||||||
|  | 	pushWorkspace: ['- Workspace/', | ||||||
|  | 		function(name){ | ||||||
|  | 			name = name || this.workspace | ||||||
|  | 			var stack = this.__workspace_stack = this.__workspace_stack || [] | ||||||
|  | 
 | ||||||
|  | 			this.saveWorkspace() | ||||||
|  | 
 | ||||||
|  | 			this.workspace != name && this.loadWorkspace(name) | ||||||
|  | 			stack.push(name) | ||||||
|  | 		}], | ||||||
|  | 	popWorkspace: ['- Workspace/', | ||||||
|  | 		function(){ | ||||||
|  | 			var stack = this.__workspace_stack | ||||||
|  | 
 | ||||||
|  | 			if(!stack || stack.length == 0){ | ||||||
|  | 				return | ||||||
|  | 			} | ||||||
|  | 
 | ||||||
|  | 			this.saveWorkspace() | ||||||
|  | 			this.loadWorkspace(stack.pop()) | ||||||
|  | 		}], | ||||||
| }) | }) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -412,8 +436,12 @@ module.Workspace = ImageGridFeatures.Feature({ | |||||||
| 	actions: WorkspaceActions, | 	actions: WorkspaceActions, | ||||||
| 
 | 
 | ||||||
| 	handlers: [ | 	handlers: [ | ||||||
|  | 		['start',  | ||||||
|  | 			function(){  | ||||||
|  | 				this.loadWorkspace(this.config['load-workspace'] || 'default') }], | ||||||
| 		['stop',  | 		['stop',  | ||||||
| 			function(){ this.saveWorkspace() }], | 			function(){  | ||||||
|  | 				this.saveWorkspace() }], | ||||||
| 	], | 	], | ||||||
| }) | }) | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -226,7 +226,22 @@ var SingleImageActions = actions.Actions({ | |||||||
| 	toggleSingleImage: ['Interface/Toggle single image view',  | 	toggleSingleImage: ['Interface/Toggle single image view',  | ||||||
| 		toggler.CSSClassToggler( | 		toggler.CSSClassToggler( | ||||||
| 			function(){ return this.ribbons.viewer },  | 			function(){ return this.ribbons.viewer },  | ||||||
| 			'single-image-mode') ], | 			'single-image-mode', | ||||||
|  | 			function(state){ | ||||||
|  | 				if(state == 'on'){ | ||||||
|  | 					this.pushWorkspace() | ||||||
|  | 
 | ||||||
|  | 					if(this.workspaces['single-image'] == null){ | ||||||
|  | 						this.loadWorkspace('ui-chrome-hidden')  | ||||||
|  | 						this.saveWorkspace('single-image')  | ||||||
|  | 					} | ||||||
|  | 
 | ||||||
|  | 					this.loadWorkspace('single-image')  | ||||||
|  | 
 | ||||||
|  | 				} else { | ||||||
|  | 					this.popWorkspace() | ||||||
|  | 				} | ||||||
|  | 			})], | ||||||
| }) | }) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -183,9 +183,11 @@ var SlideshowActions = actions.Actions({ | |||||||
| 
 | 
 | ||||||
| 					// prepare for the slideshow...
 | 					// prepare for the slideshow...
 | ||||||
| 					} else { | 					} else { | ||||||
|  | 						// single image mode...
 | ||||||
|  | 						this.toggleSingleImage('on') | ||||||
|  | 
 | ||||||
| 						// save current workspace...
 | 						// save current workspace...
 | ||||||
| 						this.__pre_slideshow_workspace = this.workspace | 						this.pushWorkspace() | ||||||
| 						this.saveWorkspace()  |  | ||||||
| 
 | 
 | ||||||
| 						// construct the slideshow workspace if it does
 | 						// construct the slideshow workspace if it does
 | ||||||
| 						// not exist...
 | 						// not exist...
 | ||||||
| @ -199,9 +201,6 @@ var SlideshowActions = actions.Actions({ | |||||||
| 
 | 
 | ||||||
| 						// load the slideshow workspace...
 | 						// load the slideshow workspace...
 | ||||||
| 						this.loadWorkspace('slideshow') | 						this.loadWorkspace('slideshow') | ||||||
| 				 |  | ||||||
| 						// single image mode...
 |  | ||||||
| 						this.toggleSingleImage('on') |  | ||||||
| 					} | 					} | ||||||
| 
 | 
 | ||||||
| 					// start the timer... 
 | 					// start the timer... 
 | ||||||
| @ -230,17 +229,13 @@ var SlideshowActions = actions.Actions({ | |||||||
| 
 | 
 | ||||||
| 				// stop...
 | 				// stop...
 | ||||||
| 				} else { | 				} else { | ||||||
| 					this.saveWorkspace('slideshow')  |  | ||||||
| 
 |  | ||||||
| 					// stop timer...
 | 					// stop timer...
 | ||||||
| 					this.__slideshouw_timer | 					this.__slideshouw_timer | ||||||
| 						&& clearInterval(this.__slideshouw_timer) | 						&& clearInterval(this.__slideshouw_timer) | ||||||
| 					delete this.__slideshouw_timer | 					delete this.__slideshouw_timer | ||||||
| 
 | 
 | ||||||
| 					// restore the original workspace...
 | 					// restore the original workspace...
 | ||||||
| 					this.__pre_slideshow_workspace && | 					this.popWorkspace() | ||||||
| 						this.loadWorkspace(this.__pre_slideshow_workspace) |  | ||||||
| 					delete this.__pre_slideshow_workspace |  | ||||||
| 				} | 				} | ||||||
| 			})], | 			})], | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -307,7 +307,7 @@ var StatusBarActions = actions.Actions({ | |||||||
| 
 | 
 | ||||||
| 				var bar = this.ribbons.viewer.find('.state-indicator-container.global-info')  | 				var bar = this.ribbons.viewer.find('.state-indicator-container.global-info')  | ||||||
| 				if(bar.length == 0){ | 				if(bar.length == 0){ | ||||||
| 					bar = makeStateIndicator('global-info overlay-info')  | 					bar = makeStateIndicator('global-info overlay-info statusbar')  | ||||||
| 						.addClass(this.config['status-bar-mode'] || '') | 						.addClass(this.config['status-bar-mode'] || '') | ||||||
| 						.on('mouseover', function(){ | 						.on('mouseover', function(){ | ||||||
| 							var t = $(event.target) | 							var t = $(event.target) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user