mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 11:20:09 +00:00 
			
		
		
		
	more cleanup...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									a079466c87
								
							
						
					
					
						commit
						d404dee472
					
				| @ -141,47 +141,7 @@ $(function(){ | |||||||
| 	setupBaseURLHistory() | 	setupBaseURLHistory() | ||||||
| 	setupDataBindings() | 	setupDataBindings() | ||||||
| 
 | 
 | ||||||
| 
 | 	// XXX do we need drag'n'drop here??? | ||||||
| 	/* XXX drag/drop |  | ||||||
| 	$(document) |  | ||||||
| 		.bind('dragover', function(e){ |  | ||||||
| 			e.stopPropagation() |  | ||||||
| 			e.preventDefault() |  | ||||||
| 			// XXX is there a jQuery way out of this?? |  | ||||||
| 			e.originalEvent.dataTransfer.dropEffect = 'copy' // Explicitly show this is a copy. |  | ||||||
| 		}) |  | ||||||
| 		.bind('drop', function(e){ |  | ||||||
| 			e.stopPropagation() |  | ||||||
| 			e.preventDefault() |  | ||||||
| 
 |  | ||||||
| 			// XXX is there a jQuery way out of this?? |  | ||||||
| 			var files = e.originalEvent.dataTransfer.files |  | ||||||
| 
 |  | ||||||
| 			// XXX should we be using the loadJSON here??? |  | ||||||
| 			// XXX desperatly need image caching and preview generation... |  | ||||||
| 
 |  | ||||||
| 			for (var i = 0, f; f = files[i]; i++) { |  | ||||||
| 
 |  | ||||||
| 				if (!f.type.match('image.*')) { |  | ||||||
| 					continue |  | ||||||
| 				} |  | ||||||
| 				console.log('FILE:', f) |  | ||||||
| 
 |  | ||||||
| 				var reader = new FileReader() |  | ||||||
| 				reader.onload = function(i){ |  | ||||||
| 					return function(e){ |  | ||||||
| 						// XXX need to avoid data URLs here and use plain old paths... |  | ||||||
| 						//ribbon.append(makeImage(e.target.result, i)) |  | ||||||
| 						console.log('DROPPED')//, e.target.result) |  | ||||||
| 					} |  | ||||||
| 				}(i) |  | ||||||
| 
 |  | ||||||
| 				reader.readAsDataURL(f) |  | ||||||
| 				//reader.readAsText(f) |  | ||||||
| 			} |  | ||||||
| 
 |  | ||||||
| 		}) |  | ||||||
| 	*/ |  | ||||||
| 
 | 
 | ||||||
| 	// we have an image file... | 	// we have an image file... | ||||||
| 	if((DATA_ATTR + '_BASE_URL') in localStorage | 	if((DATA_ATTR + '_BASE_URL') in localStorage | ||||||
|  | |||||||
| @ -57,14 +57,7 @@ function setupDataBindings(viewer){ | |||||||
| 	viewer | 	viewer | ||||||
| 		.click(function(){ | 		.click(function(){ | ||||||
| 			if($('.ribbon').length == 0){ | 			if($('.ribbon').length == 0){ | ||||||
| 				// XXX use the real action (the same as the keyboard handler)...
 | 				loadDirectoryDialog() | ||||||
| 				// browser version...
 |  | ||||||
| 				var getter = window.listDir != null ? getDir : prompt |  | ||||||
| 				getter('Path to open', BASE_URL) |  | ||||||
| 					.done(function(path){ |  | ||||||
| 						path = path.trim() |  | ||||||
| 						statusNotify(loadDir(path)) |  | ||||||
| 					}) |  | ||||||
| 			} | 			} | ||||||
| 		}) | 		}) | ||||||
| 		// XXX need to maintain the correct number of images per ribbon
 | 		// XXX need to maintain the correct number of images per ribbon
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user