mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 19:30:07 +00:00 
			
		
		
		
	added experimental image commenting, still not full implemented...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									3fbb161de6
								
							
						
					
					
						commit
						d020318fe7
					
				| @ -616,6 +616,8 @@ var KEYBOARD_CONFIG = { | ||||
| 				// marking...
 | ||||
| 				ctrl: 'invert-marks', | ||||
| 			}, | ||||
| 		// XXX this is not permanent...
 | ||||
| 		C: doc('Edit image comment', imageCommentDialog), | ||||
| 		P: { | ||||
| 				default: doc('Show options', | ||||
| 					function(){ toggleOptionsUI() }), | ||||
|  | ||||
							
								
								
									
										30
									
								
								ui/ui.js
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								ui/ui.js
									
									
									
									
									
								
							| @ -382,6 +382,7 @@ var FIELD_TYPES = { | ||||
| 	// format: 
 | ||||
| 	// 		string
 | ||||
| 	// XXX add datalist option...
 | ||||
| 	// XXX make this textarea compatible...
 | ||||
| 	text: { | ||||
| 		type: 'text', | ||||
| 		text: null, | ||||
| @ -962,6 +963,7 @@ function sortImagesDialog(message){ | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| // XXX get EXIF...
 | ||||
| function showImageInfo(){ | ||||
| 	var gid = getImageGID(getImage()) | ||||
| 	var r = getRibbonIndex(getRibbon()) | ||||
| @ -972,6 +974,8 @@ function showImageInfo(){ | ||||
| 	flipped = flipped == null ? '' : ', flipped '+flipped+'ly' | ||||
| 	var order = DATA.order.indexOf(gid) | ||||
| 	var name = data.path.split('/').pop() | ||||
| 	var comment = data.comment | ||||
| 	comment = comment == null ? '' : comment | ||||
| 
 | ||||
| 	alert('<div>'+ | ||||
| 			'<h2>"'+ name +'"</h2>'+ | ||||
| @ -984,11 +988,37 @@ function showImageInfo(){ | ||||
| 				'<tr><td>Position (ribbon): </td><td>'+ (DATA.ribbons[r].indexOf(gid)+1) + | ||||
| 					'/'+ DATA.ribbons[r].length +'</td></tr>'+ | ||||
| 				'<tr><td>Position (global): </td><td>'+ (order+1) +'/'+ DATA.order.length +'</td></tr>'+ | ||||
| 				'<tr><td colspan="2"><hr></td></tr>'+ | ||||
| 				'<tr><td>Comment: </td><td class="comment">'+ comment +'</td></tr>'+ | ||||
| 			'</table>'+ | ||||
| 		'</div>') | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| // XXX use a text area instead of a text field...
 | ||||
| function imageCommentDialog(){ | ||||
| 	var gid = getImageGID() | ||||
| 	var data = IMAGES[gid] | ||||
| 	var name = data.path.split('/').pop().split('.')[0] | ||||
| 	var comment = data.comment | ||||
| 	comment = comment == null ? '' : comment | ||||
| 
 | ||||
| 	return formDialog(null, name +' Comment:',  | ||||
| 			{'': comment}, | ||||
| 			'Save',  | ||||
| 			'imageCommentDialog') | ||||
| 		.done(function(res){ | ||||
| 			comment = res[''] | ||||
| 			if(comment.trim() == ''){ | ||||
| 				delete data.comment | ||||
| 			} else { | ||||
| 				data.comment = comment | ||||
| 			} | ||||
| 			IMAGES_UPDATED.push(gid) | ||||
| 		}) | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| /********************************************************************** | ||||
| * vim:set ts=4 sw=4 nowrap :										 */ | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user