mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 03:10:07 +00:00 
			
		
		
		
	some tweaking and cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									80a5f031a2
								
							
						
					
					
						commit
						be0a5bc2d4
					
				| @ -124,13 +124,14 @@ var CONFIG = { | |||||||
| 	zoom_step_scale: 1.2, | 	zoom_step_scale: 1.2, | ||||||
| 
 | 
 | ||||||
| 	// ribbon scaling limits and defaults (pixels)...
 | 	// ribbon scaling limits and defaults (pixels)...
 | ||||||
|  | 	// XXX need to make these depend on dpi...
 | ||||||
| 	// ~10 images per screen @ 1024x768
 | 	// ~10 images per screen @ 1024x768
 | ||||||
| 	min_image_size: 100, | 	min_image_size: 100, | ||||||
| 	// ~4 images per screen @ 1024x768
 | 	// ~4 images per screen @ 1024x768
 | ||||||
| 	default_image_size: 250, | 	default_image_size: 250, | ||||||
| 
 | 
 | ||||||
| 	single_image_scale_2: 1.125, | 	single_image_view_scale_2: 1.125, | ||||||
| 	single_image_scale_3: 3, | 	single_image_view_scale_3: 3, | ||||||
| 
 | 
 | ||||||
| 	// localStorage prefix...
 | 	// localStorage prefix...
 | ||||||
| 	data_attr: 'DATA', | 	data_attr: 'DATA', | ||||||
|  | |||||||
| @ -9,6 +9,7 @@ | |||||||
| var _STEPS_LEFT_TO_CHANGE_DIRECTION = CONFIG.steps_to_change_direction | var _STEPS_LEFT_TO_CHANGE_DIRECTION = CONFIG.steps_to_change_direction | ||||||
| var DIRECTION = 'next' | var DIRECTION = 'next' | ||||||
| 
 | 
 | ||||||
|  | var ACTIONS = {} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| /*********************************************************************/ | /*********************************************************************/ | ||||||
| @ -35,6 +36,19 @@ function directionImage(reverse){ | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | // XXX this is experimental...
 | ||||||
|  | // 		...not sure yet how to go about this...
 | ||||||
|  | function Action(text, func){ | ||||||
|  | 	func = func == null ? function(){return true}: func | ||||||
|  | 	func.doc = text | ||||||
|  | 
 | ||||||
|  | 	ACTIONS[text.split('\n')[0].trim()] = func | ||||||
|  | 
 | ||||||
|  | 	return func | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | doc = Action | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| /*********************************************************************/ | /*********************************************************************/ | ||||||
| 
 | 
 | ||||||
| @ -87,8 +101,6 @@ var KEYBOARD_CONFIG = { | |||||||
| 
 | 
 | ||||||
| 	}, | 	}, | ||||||
| 
 | 
 | ||||||
| 	// info overlay...
 |  | ||||||
| 	//
 |  | ||||||
| 	// NOTE: this is here to prevent selecting images while trying to 
 | 	// NOTE: this is here to prevent selecting images while trying to 
 | ||||||
| 	// 		select info text...
 | 	// 		select info text...
 | ||||||
| 	'Info overlay': { | 	'Info overlay': { | ||||||
| @ -117,8 +129,6 @@ var KEYBOARD_CONFIG = { | |||||||
| 	}, | 	}, | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	// dialogs...
 |  | ||||||
| 	//
 |  | ||||||
| 	// NOTE: editor effects are not documented, but should be obvious...
 | 	// NOTE: editor effects are not documented, but should be obvious...
 | ||||||
| 	// 		XXX is this the case?
 | 	// 		XXX is this the case?
 | ||||||
| 	'Dialog': { | 	'Dialog': { | ||||||
| @ -177,8 +187,6 @@ var KEYBOARD_CONFIG = { | |||||||
| 	}, | 	}, | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	// help view...
 |  | ||||||
| 	//
 |  | ||||||
| 	// NOTE: need to keep all info modes before the rest so as to give 
 | 	// NOTE: need to keep all info modes before the rest so as to give 
 | ||||||
| 	// 		their bindings priority...
 | 	// 		their bindings priority...
 | ||||||
| 	'Drawer views': { | 	'Drawer views': { | ||||||
| @ -197,8 +205,6 @@ var KEYBOARD_CONFIG = { | |||||||
| 	}, | 	}, | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	// slideshow view...
 |  | ||||||
| 	//
 |  | ||||||
| 	'Slideshow view': { | 	'Slideshow view': { | ||||||
| 		doc: 'To enter this view press <b>S</b>.', | 		doc: 'To enter this view press <b>S</b>.', | ||||||
| 		pattern: '.slideshow-mode', | 		pattern: '.slideshow-mode', | ||||||
| @ -230,8 +236,6 @@ var KEYBOARD_CONFIG = { | |||||||
| 	}, | 	}, | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	// single image view...
 |  | ||||||
| 	//
 |  | ||||||
| 	'Single image view': { | 	'Single image view': { | ||||||
| 		doc: 'To toggle between this and ribbon view press <b>Enter</b>.', | 		doc: 'To toggle between this and ribbon view press <b>Enter</b>.', | ||||||
| 		pattern: '.single-image-mode', | 		pattern: '.single-image-mode', | ||||||
| @ -245,8 +249,6 @@ var KEYBOARD_CONFIG = { | |||||||
| 	}, | 	}, | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	// crop views...
 |  | ||||||
| 	//
 |  | ||||||
| 	'Cropped ribbon views': { | 	'Cropped ribbon views': { | ||||||
| 		doc: 'To crop marked images press <b>shift-F2</b> for '+ | 		doc: 'To crop marked images press <b>shift-F2</b> for '+ | ||||||
| 			'single ribbon crop view press <b>F3</b> and to open the crop '+ | 			'single ribbon crop view press <b>F3</b> and to open the crop '+ | ||||||
| @ -289,8 +291,7 @@ var KEYBOARD_CONFIG = { | |||||||
| 	*/ | 	*/ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	// ribbon view only...
 | 	// NOTE: these bindings apply ONLY to ribbon view...
 | ||||||
| 	//
 |  | ||||||
| 	// XXX this breaks getKeyHandlers(...) when modes argument is given...
 | 	// XXX this breaks getKeyHandlers(...) when modes argument is given...
 | ||||||
| 	'Ribbon view': { | 	'Ribbon view': { | ||||||
| 		pattern: '.viewer:not(.overlay):not(.single-image-mode)', | 		pattern: '.viewer:not(.overlay):not(.single-image-mode)', | ||||||
| @ -415,7 +416,7 @@ var KEYBOARD_CONFIG = { | |||||||
| 	}, | 	}, | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	// general setup...
 | 	// general bindings...
 | ||||||
| 	//
 | 	//
 | ||||||
| 	'Viewer': { | 	'Viewer': { | ||||||
| 		doc: 'These key bindings work in most other viewer views.'+ | 		doc: 'These key bindings work in most other viewer views.'+ | ||||||
| @ -610,8 +611,14 @@ var KEYBOARD_CONFIG = { | |||||||
| 
 | 
 | ||||||
| 		// zooming...
 | 		// zooming...
 | ||||||
| 		'#1': doc('Fit image to screen', function(){ fitNImages(1) }), | 		'#1': doc('Fit image to screen', function(){ fitNImages(1) }), | ||||||
| 		'#2': doc('Show big image', function(){ fitNImages(CONFIG.single_image_scale_2) }), | 		'#2': doc('Show big image',  | ||||||
| 		'#3': doc('Show small image', function(){ fitNImages(CONFIG.single_image_scale_3) }), | 				function(){  | ||||||
|  | 					fitNImages(CONFIG.single_image_view_scale_2)  | ||||||
|  | 				}), | ||||||
|  | 		'#3': doc('Show small image',  | ||||||
|  | 				function(){  | ||||||
|  | 					fitNImages(CONFIG.single_image_view_scale_3)  | ||||||
|  | 				}), | ||||||
| 
 | 
 | ||||||
| 		'-': doc('Zoom in', function(){ zoomOut() }), | 		'-': doc('Zoom in', function(){ zoomOut() }), | ||||||
| 		'=': doc('Zoom out', function(){ zoomIn() }), | 		'=': doc('Zoom out', function(){ zoomIn() }), | ||||||
|  | |||||||
							
								
								
									
										22
									
								
								ui/ui.js
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								ui/ui.js
									
									
									
									
									
								
							| @ -1104,29 +1104,23 @@ function exportPreviewsDialog(state, dfl){ | |||||||
| 	// 		keys become unreadable with JS syntax preventing us from 
 | 	// 		keys become unreadable with JS syntax preventing us from 
 | ||||||
| 	// 		splitting the key into several lines...
 | 	// 		splitting the key into several lines...
 | ||||||
| 	var cfg = {} | 	var cfg = {} | ||||||
| 	// multiple images...
 | 	var img_pattern = 'Image name pattern | '+ | ||||||
| 	if(state != 'current image'){ | 		'%f - full filename (same as %n%e)\n'+ | ||||||
| 		cfg['Image name pattern | '+ |  | ||||||
| 				'%f - full filename\n'+ |  | ||||||
| 		'%n - filename\n'+ | 		'%n - filename\n'+ | ||||||
| 		'%e - extension (with leading dot)\n'+ | 		'%e - extension (with leading dot)\n'+ | ||||||
| 		'%(abc)m - if marked insert "abc"\n'+ | 		'%(abc)m - if marked insert "abc"\n'+ | ||||||
| 		'%(abc)b - if bookmarked insert "abc"\n'+ | 		'%(abc)b - if bookmarked insert "abc"\n'+ | ||||||
| 				'%gid - log gid\n'+ | 		'%gid - long gid\n'+ | ||||||
| 				'%g - short gid\n'+ | 		'%g - short gid\n' | ||||||
|  | 	// multiple images...
 | ||||||
|  | 	if(state != 'current image'){ | ||||||
|  | 		cfg[img_pattern + | ||||||
| 				'%I - global order\n'+ | 				'%I - global order\n'+ | ||||||
| 				'%i - current selection order'] = '%f' | 				'%i - current selection order'] = '%f' | ||||||
| 		cfg['Level directory name'] = 'fav' | 		cfg['Level directory name'] = 'fav' | ||||||
| 	// single image...
 | 	// single image...
 | ||||||
| 	} else { | 	} else { | ||||||
| 		cfg['Image name pattern | '+ | 		cfg[img_pattern + | ||||||
| 				'%f - full filename\n'+ |  | ||||||
| 				'%n - filename\n'+ |  | ||||||
| 				'%e - extension (with leading dot)\n'+ |  | ||||||
| 				'%(abc)m - if marked insert "abc"\n'+ |  | ||||||
| 				'%(abc)b - if bookmarked insert "abc"\n'+ |  | ||||||
| 				'%gid - log gid\n'+ |  | ||||||
| 				'%g - short gid\n'+ |  | ||||||
| 				'\n'+ | 				'\n'+ | ||||||
| 				'NOTE: %i and %I are not supported for single\n'+ | 				'NOTE: %i and %I are not supported for single\n'+ | ||||||
| 				'image exporting.'] = '%f' | 				'image exporting.'] = '%f' | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user