mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-11-04 13:20:10 +00:00 
			
		
		
		
	several minor tweaks and fixes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									187e538bb9
								
							
						
					
					
						commit
						6d429f257e
					
				
							
								
								
									
										55
									
								
								ui/data.js
									
									
									
									
									
								
							
							
						
						
									
										55
									
								
								ui/data.js
									
									
									
									
									
								
							@ -735,9 +735,13 @@ function getRibbonGIDs(a, no_clone, data){
 | 
				
			|||||||
	if(typeof(a) == typeof(123)){
 | 
						if(typeof(a) == typeof(123)){
 | 
				
			||||||
		var res = data.ribbons[a]
 | 
							var res = data.ribbons[a]
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		var res = data.ribbons[getGIDRibbonIndex(a.constructor.name != 'Array' ? a : null, data)]
 | 
							var res = data.ribbons[getGIDRibbonIndex(
 | 
				
			||||||
 | 
									(a != null && a.constructor.name != 'Array') 
 | 
				
			||||||
 | 
										? a 
 | 
				
			||||||
 | 
										: null,
 | 
				
			||||||
 | 
									data)]
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if(a.constructor.name = 'Array'){
 | 
						if(a != null && a.constructor.name == 'Array'){
 | 
				
			||||||
		res = res.filter(function(e){ 
 | 
							res = res.filter(function(e){ 
 | 
				
			||||||
			return a.indexOf(e) >= 0 
 | 
								return a.indexOf(e) >= 0 
 | 
				
			||||||
		})
 | 
							})
 | 
				
			||||||
@ -1284,6 +1288,7 @@ function getBestPreview(gid, size){
 | 
				
			|||||||
// values.
 | 
					// values.
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// 		EXIF		rotation	flip
 | 
					// 		EXIF		rotation	flip
 | 
				
			||||||
 | 
					// 		-----------------------------------
 | 
				
			||||||
// 		0			-			-
 | 
					// 		0			-			-
 | 
				
			||||||
// 		1			-			-
 | 
					// 		1			-			-
 | 
				
			||||||
// 		2			-			horizontal
 | 
					// 		2			-			horizontal
 | 
				
			||||||
@ -1326,7 +1331,7 @@ function orientationExif2ImageGrid(orientation){
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// mark an image as updated...
 | 
					// Mark an image as updated...
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
function imageUpdated(gid){
 | 
					function imageUpdated(gid){
 | 
				
			||||||
	gid = gid == null ? getImageGID(): gid
 | 
						gid = gid == null ? getImageGID(): gid
 | 
				
			||||||
@ -1437,7 +1442,33 @@ function makePrevFromListAction(get_closest, get_list, restrict_to_ribbon){
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Filter gids via image attribute patterns...
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Filter format:
 | 
				
			||||||
 | 
					// 	{
 | 
				
			||||||
 | 
					// 		<attribute>: <pattern>,
 | 
				
			||||||
 | 
					// 		...
 | 
				
			||||||
 | 
					// 	}
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// The pattern can be a string or a regular expression. The string value 
 | 
				
			||||||
 | 
					// is converted to a regular expression as-is.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Matching rules:
 | 
				
			||||||
 | 
					// 	- a specified attribute must exist
 | 
				
			||||||
 | 
					// 	- the pattern must match image attribute value
 | 
				
			||||||
 | 
					// 	- if image attribute value is a list, the pattern must match at 
 | 
				
			||||||
 | 
					// 		least one element of the list (OR)
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// If gids is passed, it will be used as the source, otherwise 
 | 
				
			||||||
 | 
					// getLoadedGIDs(..) will be used to produce a list of gids.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// NOTE: the data argument is used only when no gids are supplied 
 | 
				
			||||||
 | 
					// 		explicitly, otherwise it is ignored.
 | 
				
			||||||
 | 
					// NOTE: this works only with string or convertible to string values, 
 | 
				
			||||||
 | 
					// 		thus, numeric and/or date comparisons are not supported...
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
// XXX also need a date filter -- separate function?
 | 
					// XXX also need a date filter -- separate function?
 | 
				
			||||||
 | 
					// XXX need a number filter with support of advanced comparisons...
 | 
				
			||||||
function filterGIDs(filter, gids, data, images){
 | 
					function filterGIDs(filter, gids, data, images){
 | 
				
			||||||
	images = images == null ? IMAGES : images
 | 
						images = images == null ? IMAGES : images
 | 
				
			||||||
	gids = gids == null ? getLoadedGIDs(null, data) : gids
 | 
						gids = gids == null ? getLoadedGIDs(null, data) : gids
 | 
				
			||||||
@ -2191,24 +2222,6 @@ function rollImages(n, ribbon, extend, no_compensate_shift){
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
// Remove images that do not belong in the ribbons they are in...
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
function removeStrayImages(){
 | 
					 | 
				
			||||||
	$('.ribbon').each(function(i){
 | 
					 | 
				
			||||||
		var ribbon = DATA.ribbons[i]
 | 
					 | 
				
			||||||
		$(this).find('.image').map(function(){
 | 
					 | 
				
			||||||
			var gid = getImageGID(this)
 | 
					 | 
				
			||||||
			if(ribbon.indexOf(gid) < 0){
 | 
					 | 
				
			||||||
				getImageMarks(gid).remove()
 | 
					 | 
				
			||||||
				return this
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}).remove()
 | 
					 | 
				
			||||||
	})
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Reload the viewer using the current DATA and IMAGES objects
 | 
					// Reload the viewer using the current DATA and IMAGES objects
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
// NOTE: setting reuse_current_structure will not destroy ribbon 
 | 
					// NOTE: setting reuse_current_structure will not destroy ribbon 
 | 
				
			||||||
 | 
				
			|||||||
@ -652,6 +652,14 @@ var KEYBOARD_CONFIG = {
 | 
				
			|||||||
					function(){
 | 
										function(){
 | 
				
			||||||
						exportPreviewsDialog()
 | 
											exportPreviewsDialog()
 | 
				
			||||||
					}), 
 | 
										}), 
 | 
				
			||||||
 | 
									// NOTE: this will not delete anything, just merge all the diffs 
 | 
				
			||||||
 | 
									// 		into a single, redundent images.json.
 | 
				
			||||||
 | 
									// 		this will make loading faster...
 | 
				
			||||||
 | 
									'ctrl+alt': doc('Compact image data.',
 | 
				
			||||||
 | 
										function(){
 | 
				
			||||||
 | 
											showStatusQ('Merging: images diffs.')
 | 
				
			||||||
 | 
											saveFileImages()
 | 
				
			||||||
 | 
										}),
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
		Z: {
 | 
							Z: {
 | 
				
			||||||
				ctrl: doc('Restore to last saved state', 
 | 
									ctrl: doc('Restore to last saved state', 
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user