mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 03:10:07 +00:00 
			
		
		
		
	added main controls + crop button/status...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									c75dd733e5
								
							
						
					
					
						commit
						cb2420fafe
					
				| @ -296,13 +296,9 @@ button:hover { | |||||||
| */ | */ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| .fullscreen-controls { | .buttons { | ||||||
| 	display: block; | 	display: block; | ||||||
| 	position: absolute; | 	position: absolute; | ||||||
| 	top: 0px; |  | ||||||
| 	right: 0px; |  | ||||||
| 	z-index: 4000; |  | ||||||
| 
 |  | ||||||
| 	opacity: 0.4; | 	opacity: 0.4; | ||||||
| 
 | 
 | ||||||
| 	size: 30px; | 	size: 30px; | ||||||
| @ -311,12 +307,12 @@ button:hover { | |||||||
| 
 | 
 | ||||||
| 	//z-index: 9999; | 	//z-index: 9999; | ||||||
| } | } | ||||||
| .fullscreen-controls:hover { | .buttons:hover { | ||||||
| 	opacity: 1; | 	opacity: 1; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| .fullscreen-controls .button { | .buttons .button { | ||||||
| 	display: inline-block; | 	display: inline-block; | ||||||
| 	color: silver; | 	color: silver; | ||||||
| 
 | 
 | ||||||
| @ -326,18 +322,35 @@ button:hover { | |||||||
| 	text-align: center; | 	text-align: center; | ||||||
| 	line-height: 40px; | 	line-height: 40px; | ||||||
| } | } | ||||||
| .fullscreen-controls .button:hover { | .buttons .button:hover { | ||||||
| 	color: white; | 	color: white; | ||||||
| 	background: rgba(0, 0, 0, 0.5); | 	background: rgba(0, 0, 0, 0.5); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | /* main controls... */ | ||||||
|  | .main-controls.buttons { | ||||||
|  | 	top: 0px; | ||||||
|  | 	left: 0px; | ||||||
|  | 	z-index: 4000; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | /* fullscreen controls... */ | ||||||
|  | .fullscreen-controls.buttons { | ||||||
|  | 	top: 0px; | ||||||
|  | 	right: 0px; | ||||||
|  | 	z-index: 4000; | ||||||
|  | } | ||||||
| .fullscreen-controls .button.close:hover { | .fullscreen-controls .button.close:hover { | ||||||
| 	background: rgba(255, 0, 0, 0.8); | 	background: rgba(255, 0, 0, 0.8); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| /********************************************************** Viewer ***/ | /********************************************************** Viewer ***/ | ||||||
| .viewer { | .viewer { | ||||||
| 	position: relative; | 	position: relative; | ||||||
| @ -1658,7 +1671,7 @@ progress:not(value)::-webkit-progress-bar { | |||||||
| 
 | 
 | ||||||
| .progress-container { | .progress-container { | ||||||
| 	position: absolute; | 	position: absolute; | ||||||
| 	top: 20px; | 	top: 30px; | ||||||
| 	margin: 5px; | 	margin: 5px; | ||||||
| 	padding: 2px; | 	padding: 2px; | ||||||
| 	border-radius: 5px; | 	border-radius: 5px; | ||||||
|  | |||||||
| @ -260,11 +260,12 @@ var FullScreenControllsActions = actions.Actions({ | |||||||
| 					var that = this | 					var that = this | ||||||
| 
 | 
 | ||||||
| 					$('<div>') | 					$('<div>') | ||||||
| 						.addClass('fullscreen-controls') | 						.addClass('fullscreen-controls buttons') | ||||||
| 						// minimize....
 | 						// minimize....
 | ||||||
| 						.append($('<div>') | 						.append($('<div>') | ||||||
| 							.addClass('button') | 							.addClass('button') | ||||||
| 							.html('_') | 							.html('_') | ||||||
|  | 							.attr('info', 'Minimize') | ||||||
| 							.click(function(){ that.minimize() })) | 							.click(function(){ that.minimize() })) | ||||||
| 						// fullscreen....
 | 						// fullscreen....
 | ||||||
| 						.append($('<div>') | 						.append($('<div>') | ||||||
| @ -273,12 +274,26 @@ var FullScreenControllsActions = actions.Actions({ | |||||||
| 							//.html('□')
 | 							//.html('□')
 | ||||||
| 							// diagonal arrows...
 | 							// diagonal arrows...
 | ||||||
| 							.html('↙') | 							.html('↙') | ||||||
|  | 							.attr('info', 'Toggle fullscreen') | ||||||
| 							.click(function(){ that.toggleFullScreen() })) | 							.click(function(){ that.toggleFullScreen() })) | ||||||
| 						// close...
 | 						// close...
 | ||||||
| 						.append($('<div>') | 						.append($('<div>') | ||||||
| 							.addClass('button close') | 							.addClass('button close') | ||||||
| 							.html('×') | 							.html('×') | ||||||
|  | 							.attr('info', 'Close') | ||||||
| 							.click(function(){ that.close() })) | 							.click(function(){ that.close() })) | ||||||
|  | 
 | ||||||
|  | 						.on('mouseover', function(){ | ||||||
|  | 							var t = $(event.target) | ||||||
|  | 
 | ||||||
|  | 							var info = t.attr('info') || t.parents('[info]').attr('info') || '' | ||||||
|  | 
 | ||||||
|  | 							that.showStatusBarInfo(info) | ||||||
|  | 						}) | ||||||
|  | 						.on('mouseout', function(){ | ||||||
|  | 							that.showStatusBarInfo() | ||||||
|  | 						}) | ||||||
|  | 
 | ||||||
| 						.appendTo(this.ribbons.viewer) | 						.appendTo(this.ribbons.viewer) | ||||||
| 				} | 				} | ||||||
| 			})], | 			})], | ||||||
| @ -292,6 +307,7 @@ module.FullScreenControlls = core.ImageGridFeatures.Feature({ | |||||||
| 	tag: 'ui-fullscreen-controls', | 	tag: 'ui-fullscreen-controls', | ||||||
| 	depends: [ | 	depends: [ | ||||||
| 		'ui-app-control', | 		'ui-app-control', | ||||||
|  | 		'ui-status', | ||||||
| 	], | 	], | ||||||
| 
 | 
 | ||||||
| 	actions: FullScreenControllsActions, | 	actions: FullScreenControllsActions, | ||||||
|  | |||||||
| @ -509,6 +509,19 @@ var StatusBarActions = actions.Actions({ | |||||||
| 
 | 
 | ||||||
| 				this.updateStatusBar() | 				this.updateStatusBar() | ||||||
| 			})], | 			})], | ||||||
|  | 
 | ||||||
|  | 	// XXX revise...
 | ||||||
|  | 	showStatusBarInfo: ['- Interface/', | ||||||
|  | 		function(text){ | ||||||
|  | 			var bar = this.ribbons.viewer.find('.state-indicator-container.global-info')  | ||||||
|  | 
 | ||||||
|  | 			if(text){ | ||||||
|  | 				bar.find('.info').text(text) | ||||||
|  | 
 | ||||||
|  | 			} else { | ||||||
|  | 				bar.find('.info').empty() | ||||||
|  | 			} | ||||||
|  | 		}], | ||||||
| }) | }) | ||||||
| 
 | 
 | ||||||
| var StatusBar =  | var StatusBar =  | ||||||
|  | |||||||
| @ -1005,6 +1005,9 @@ module.ContextActionMenu = core.ImageGridFeatures.Feature({ | |||||||
| // XXX make this not applicable to production...
 | // XXX make this not applicable to production...
 | ||||||
| 
 | 
 | ||||||
| var WidgetTestActions = actions.Actions({ | var WidgetTestActions = actions.Actions({ | ||||||
|  | 	config: { | ||||||
|  | 		'main-controls': 'on', | ||||||
|  | 	}, | ||||||
| 
 | 
 | ||||||
| 	testAction: ['- Test/', | 	testAction: ['- Test/', | ||||||
| 		function(){ | 		function(){ | ||||||
| @ -1156,6 +1159,64 @@ var WidgetTestActions = actions.Actions({ | |||||||
| 			setTimeout(step, 1000) | 			setTimeout(step, 1000) | ||||||
| 		}],  | 		}],  | ||||||
| 
 | 
 | ||||||
|  | 	// XXX move this out...
 | ||||||
|  | 	// XXX also see handlers....
 | ||||||
|  | 	toggleMainControls: ['Interface/', | ||||||
|  | 		toggler.Toggler(null, | ||||||
|  | 			function(){  | ||||||
|  | 				return this.ribbons.viewer.find('.main-controls').length > 0 ? 'on' : 'off' }, | ||||||
|  | 			['off', 'on'], | ||||||
|  | 			function(state){ | ||||||
|  | 				// clear the controls....
 | ||||||
|  | 				this.ribbons.viewer.find('.main-controls').remove() | ||||||
|  | 
 | ||||||
|  | 				if(state == 'on'){ | ||||||
|  | 					var that = this | ||||||
|  | 
 | ||||||
|  | 					$('<div>') | ||||||
|  | 						.addClass('main-controls buttons') | ||||||
|  | 						// menu....
 | ||||||
|  | 						.append($('<div>') | ||||||
|  | 							.addClass('button') | ||||||
|  | 							.html('☰') | ||||||
|  | 							.attr('info', 'Show action menu...') | ||||||
|  | 							// XXX show this in status bar... (???)
 | ||||||
|  | 							.click(function(){ that.browseActions() })) | ||||||
|  | 						/*  | ||||||
|  | 						// XXX make the rest configurable... (???)
 | ||||||
|  | 						.append($('<div>') | ||||||
|  | 							.addClass('button') | ||||||
|  | 							.html('O') | ||||||
|  | 							.click(function(){  })) | ||||||
|  | 						.append($('<div>') | ||||||
|  | 							.addClass('button') | ||||||
|  | 							.html('H') | ||||||
|  | 							.click(function(){  })) | ||||||
|  | 						//*/
 | ||||||
|  | 						// crop menu/status....
 | ||||||
|  | 						.append($('<div>') | ||||||
|  | 							.addClass('button crop') | ||||||
|  | 							.html('C') | ||||||
|  | 							// crop status...
 | ||||||
|  | 							.append($('<sub/>') | ||||||
|  | 								.addClass('status')) | ||||||
|  | 							.attr('info', 'Show crop menu...') | ||||||
|  | 							.click(function(){ that.browseActions('Crop/') })) | ||||||
|  | 
 | ||||||
|  | 						.on('mouseover', function(){ | ||||||
|  | 							var t = $(event.target) | ||||||
|  | 
 | ||||||
|  | 							var info = t.attr('info') || t.parents('[info]').attr('info') || '' | ||||||
|  | 
 | ||||||
|  | 							that.showStatusBarInfo(info) | ||||||
|  | 						}) | ||||||
|  | 						.on('mouseout', function(){ | ||||||
|  | 							that.showStatusBarInfo() | ||||||
|  | 						}) | ||||||
|  | 
 | ||||||
|  | 						.appendTo(this.ribbons.viewer) | ||||||
|  | 				} | ||||||
|  | 			})], | ||||||
| 
 | 
 | ||||||
| 	// XXX make this a toggler....
 | 	// XXX make this a toggler....
 | ||||||
| 	partitionByMonth: ['Test/', | 	partitionByMonth: ['Test/', | ||||||
| @ -1362,6 +1423,18 @@ module.WidgetTest = core.ImageGridFeatures.Feature({ | |||||||
| 	], | 	], | ||||||
| 
 | 
 | ||||||
| 	actions: WidgetTestActions, | 	actions: WidgetTestActions, | ||||||
|  | 
 | ||||||
|  | 	handlers: [ | ||||||
|  | 		// main controls stuff...
 | ||||||
|  | 		['start',  | ||||||
|  | 			function(){  | ||||||
|  | 				this.toggleMainControls(this.config['main-controls'] || 'on') }], | ||||||
|  | 		['load reload',  | ||||||
|  | 			function(){ | ||||||
|  | 				// update crop button status...
 | ||||||
|  | 				$('.main-controls.buttons .crop.button .status') | ||||||
|  | 					.text(this.crop_stack ? this.crop_stack.length : '') }] | ||||||
|  | 	], | ||||||
| }) | }) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user