mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-30 19:00:09 +00:00 
			
		
		
		
	added ribbon restriction to filter dialog + several minor changes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									92de8870e6
								
							
						
					
					
						commit
						94940e78f1
					
				| @ -314,6 +314,10 @@ function filterImagesDialog(){ | |||||||
| 		'no' | 		'no' | ||||||
| 	]} | 	]} | ||||||
| 	cfg['sep2'] = '---' | 	cfg['sep2'] = '---' | ||||||
|  | 	cfg['Ribbon'] = {select: [ | ||||||
|  | 		'all', | ||||||
|  | 		'current only' | ||||||
|  | 	]} | ||||||
| 	cfg['Keep ribbons'] = false | 	cfg['Keep ribbons'] = false | ||||||
| 
 | 
 | ||||||
| 	formDialog(null,  | 	formDialog(null,  | ||||||
| @ -386,6 +390,11 @@ function filterImagesDialog(){ | |||||||
| 					} else { | 					} else { | ||||||
| 						gids = getUnmarked(gids) | 						gids = getUnmarked(gids) | ||||||
| 					} | 					} | ||||||
|  | 
 | ||||||
|  | 				} else if(/^Ribbon/.test(field) && res[field].trim() != 'all'){ | ||||||
|  | 					if(res[field] == 'current only'){ | ||||||
|  | 						gids = getRibbonGIDs(gids) | ||||||
|  | 					} | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										14
									
								
								ui/data.js
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								ui/data.js
									
									
									
									
									
								
							| @ -709,12 +709,22 @@ function getGIDRibbonIndex(gid, data){ | |||||||
| // 	- number	- ribbon index
 | // 	- number	- ribbon index
 | ||||||
| // 	- gid
 | // 	- gid
 | ||||||
| // 	- image
 | // 	- image
 | ||||||
|  | // 	- list		- return only images in ribbon
 | ||||||
|  | //
 | ||||||
|  | // XXX we should be able to pass both a ribbon number and a list of 
 | ||||||
|  | // 		gids to filter...
 | ||||||
| function getRibbonGIDs(a, no_clone, data){ | function getRibbonGIDs(a, no_clone, data){ | ||||||
| 	data = data == null ? DATA : data | 	data = data == null ? DATA : data | ||||||
| 	if(typeof(a) == typeof(123)){ | 	if(typeof(a) == typeof(123)){ | ||||||
| 		return data.ribbons[a].slice() | 		var res = data.ribbons[a] | ||||||
|  | 	} else { | ||||||
|  | 		var res = data.ribbons[getGIDRibbonIndex(a.constructor.name != 'Array' ? a : null, data)] | ||||||
|  | 	} | ||||||
|  | 	if(a.constructor.name = 'Array'){ | ||||||
|  | 		res = res.filter(function(e){  | ||||||
|  | 			return a.indexOf(e) >= 0  | ||||||
|  | 		}) | ||||||
| 	} | 	} | ||||||
| 	var res = data.ribbons[getGIDRibbonIndex(a, data)] |  | ||||||
| 	if(no_clone){ | 	if(no_clone){ | ||||||
| 		return res | 		return res | ||||||
| 	} | 	} | ||||||
|  | |||||||
| @ -436,8 +436,9 @@ function loadFileImages(path, no_load_diffs){ | |||||||
| //
 | //
 | ||||||
| // NOTE: if an explicit name is given then this will not remove anything.
 | // NOTE: if an explicit name is given then this will not remove anything.
 | ||||||
| // NOTE: this will use CONFIG.cache_dir as the location if no name is given.
 | // NOTE: this will use CONFIG.cache_dir as the location if no name is given.
 | ||||||
| function saveFileImages(name){ | function saveFileImages(name, remove_diffs){ | ||||||
| 	var remove_diffs = (name == null) | 	//remove_diffs = remove_diffs == null ? (name == null) : remove_diffs
 | ||||||
|  | 	remove_diffs = remove_diffs == null ? false : remove_diffs | ||||||
| 	name = name == null ? normalizePath(CONFIG.cache_dir_var +'/'+ Date.timeStamp()) : name | 	name = name == null ? normalizePath(CONFIG.cache_dir_var +'/'+ Date.timeStamp()) : name | ||||||
| 
 | 
 | ||||||
| 	if(window.dumpJSON == null){ | 	if(window.dumpJSON == null){ | ||||||
|  | |||||||
| @ -155,7 +155,7 @@ function removeTag(tags, gid, tagset, images){ | |||||||
| 	}) | 	}) | ||||||
| 
 | 
 | ||||||
| 	// clear the tags...
 | 	// clear the tags...
 | ||||||
| 	if(updated && img.tags.length == 0){ | 	if(updated && img.tags != null && img.tags.length == 0){ | ||||||
| 		delete img.tags | 		delete img.tags | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										5
									
								
								ui/ui.js
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								ui/ui.js
									
									
									
									
									
								
							| @ -1262,6 +1262,11 @@ function showImageInfo(){ | |||||||
| 					'<tr><td>Position (ribbon): </td><td>'+ (DATA.ribbons[r].indexOf(gid)+1) + | 					'<tr><td>Position (ribbon): </td><td>'+ (DATA.ribbons[r].indexOf(gid)+1) + | ||||||
| 						'/'+ DATA.ribbons[r].length +'</td></tr>'+ | 						'/'+ DATA.ribbons[r].length +'</td></tr>'+ | ||||||
| 					'<tr><td>Position (global): </td><td>'+ (order+1) +'/'+ DATA.order.length +'</td></tr>'+ | 					'<tr><td>Position (global): </td><td>'+ (order+1) +'/'+ DATA.order.length +'</td></tr>'+ | ||||||
|  | 					'<tr><td>Sorted: </td><td>'+  | ||||||
|  | 						//(((DATA.order.length-tagSelectAND('unsorted', DATA.order).length)/DATA.order.length)*100+'').split('.')[0] +
 | ||||||
|  | 						//(((DATA.order.length-tagSelectAND('unsorted').length)/DATA.order.length)*100+'').split('.')[0] +
 | ||||||
|  | 						(((DATA.order.length-TAGS['unsorted'].length)/DATA.order.length)*100+'').split('.')[0] + | ||||||
|  | 					'%</td></tr>'+ | ||||||
| 
 | 
 | ||||||
| 					// editable fields...
 | 					// editable fields...
 | ||||||
| 					'<tr><td colspan="2"><hr></td></tr>'+ | 					'<tr><td colspan="2"><hr></td></tr>'+ | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user