mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-30 10:50:08 +00:00 
			
		
		
		
	tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									62cf0a5ba5
								
							
						
					
					
						commit
						ac20f12176
					
				| @ -31,6 +31,9 @@ var NAV_RIBBON_VISIBLE = ':visible' | |||||||
| var NAV_RIBBON_DEFAULT = NAV_RIBBON_ALL | var NAV_RIBBON_DEFAULT = NAV_RIBBON_ALL | ||||||
| //var NAV_RIBBON_DEFAULT = NAV_RIBBON_VISIBLE
 | //var NAV_RIBBON_DEFAULT = NAV_RIBBON_VISIBLE
 | ||||||
| 
 | 
 | ||||||
|  | // can be:
 | ||||||
|  | // 	- animate
 | ||||||
|  | // 	- css
 | ||||||
| var TRANSITION_MODE_DEFAULT = 'animate' | var TRANSITION_MODE_DEFAULT = 'animate' | ||||||
| 
 | 
 | ||||||
| var MAX_SCREEN_IMAGES = 12 | var MAX_SCREEN_IMAGES = 12 | ||||||
|  | |||||||
| @ -77,6 +77,11 @@ less = { | |||||||
| //DEBUG = true | //DEBUG = true | ||||||
| 
 | 
 | ||||||
| var SCROLLER_ENABLED = true | var SCROLLER_ENABLED = true | ||||||
|  | var SCROLLER_ANIMATE_DURATION = 100 | ||||||
|  | // XXX scroller transitions not yet ready... | ||||||
|  | //		...need to disable transitions on some actions (where we  | ||||||
|  | //		explicitly say 'css') | ||||||
|  | //var TRANSITION_MODE_DEFAULT = 'css' | ||||||
| 
 | 
 | ||||||
| // setup... | // setup... | ||||||
| $(function(){ | $(function(){ | ||||||
| @ -99,7 +104,7 @@ $(function(){ | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	if(SCROLLER_ENABLED){ | 	if(SCROLLER_ENABLED){ | ||||||
| 		var scroller = makeScrollHandler($('.viewer'), { | 		SCROLLER = makeScrollHandler($('.viewer'), { | ||||||
| 				// XXX after click and initial move the screen jumps  | 				// XXX after click and initial move the screen jumps  | ||||||
| 				//		(both x and y), margins, left vs. translate? | 				//		(both x and y), margins, left vs. translate? | ||||||
| 				// | 				// | ||||||
| @ -115,7 +120,9 @@ $(function(){ | |||||||
| 
 | 
 | ||||||
| 				// it's either this or disable the jQuery animation... | 				// it's either this or disable the jQuery animation... | ||||||
| 				// ...have to benchmark to see which is better... | 				// ...have to benchmark to see which is better... | ||||||
| 				transitionDuration: 0, | 				// XXX BUG: if transition is set to non-0 then it initializes | ||||||
|  | 				//		only after an action, e.g. a click... | ||||||
|  | 				transitionDuration: TRANSITION_MODE_DEFAULT == 'animate' ? 0 : SCROLLER_ANIMATE_DURATION, | ||||||
| 				transitionEasing: 'liner', | 				transitionEasing: 'liner', | ||||||
| 
 | 
 | ||||||
| 				// keep selectable elements selectable... | 				// keep selectable elements selectable... | ||||||
| @ -124,7 +131,6 @@ $(function(){ | |||||||
| 					'.overlay-info, '+ | 					'.overlay-info, '+ | ||||||
| 					'', | 					'', | ||||||
| 			}) | 			}) | ||||||
| 			.start() |  | ||||||
| 
 | 
 | ||||||
| 		$('.viewer') | 		$('.viewer') | ||||||
| 			.on('shortClick', function(){ clickHandler(event) }) | 			.on('shortClick', function(){ clickHandler(event) }) | ||||||
| @ -247,6 +253,8 @@ $(function(){ | |||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			updateImages() | 			updateImages() | ||||||
|  | 
 | ||||||
|  | 			SCROLLER.start() | ||||||
| 		}) | 		}) | ||||||
| 
 | 
 | ||||||
| }) | }) | ||||||
|  | |||||||
| @ -884,6 +884,7 @@ body { | |||||||
|   height: 100%; |   height: 100%; | ||||||
|   width: 100%; |   width: 100%; | ||||||
|   opacity: 0.7; |   opacity: 0.7; | ||||||
|  |   cursor: auto; | ||||||
| } | } | ||||||
| /************************************************************ Help ***/ | /************************************************************ Help ***/ | ||||||
| /* XXX make this more generic, and not just for the keyboard... */ | /* XXX make this more generic, and not just for the keyboard... */ | ||||||
|  | |||||||
| @ -881,6 +881,8 @@ body { | |||||||
| 	height: 100%; | 	height: 100%; | ||||||
| 	width: 100%; | 	width: 100%; | ||||||
| 	opacity: 0.7; | 	opacity: 0.7; | ||||||
|  | 
 | ||||||
|  | 	cursor: auto; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -648,6 +648,32 @@ Date.fromTimeStamp = function(ts){ | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | function logCalls(func, logger){ | ||||||
|  | 	var that = this | ||||||
|  | 	var _func = function(){ | ||||||
|  | 		logger(func, arguments) | ||||||
|  | 		return func.apply(that, arguments) | ||||||
|  | 	} | ||||||
|  | 	_func.name = func.name | ||||||
|  | 	return _func | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | function assyncCall(func){ | ||||||
|  | 	var that = this | ||||||
|  | 	var _func = function(){ | ||||||
|  | 		var res = $.Deferred() | ||||||
|  | 		setTimeout(function(){ | ||||||
|  | 			res.resolve(func.apply(that, arguments)) | ||||||
|  | 		}, 0) | ||||||
|  | 		return res | ||||||
|  | 	} | ||||||
|  | 	_func.name = func.name | ||||||
|  | 	return _func | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| /********************************************************************** | /********************************************************************** | ||||||
| * vim:set ts=4 sw=4 :                                                */ | * vim:set ts=4 sw=4 :                                                */ | ||||||
|  | |||||||
| @ -339,6 +339,10 @@ function makeScrollHandler(root, config){ | |||||||
| 						.on('mouseup', endMoveHandler)  | 						.on('mouseup', endMoveHandler)  | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
|  | 
 | ||||||
|  | 			// setup transitions...
 | ||||||
|  | 			this.resetTransitions() | ||||||
|  | 
 | ||||||
| 			return this | 			return this | ||||||
| 		}, | 		}, | ||||||
| 		// XXX test...
 | 		// XXX test...
 | ||||||
| @ -366,6 +370,8 @@ function makeScrollHandler(root, config){ | |||||||
| 			var scrolled = this.root.children().first() | 			var scrolled = this.root.children().first() | ||||||
| 			setTransitionDuration(scrolled, this.options.transitionDuration) | 			setTransitionDuration(scrolled, this.options.transitionDuration) | ||||||
| 			setTransitionEasing(scrolled, this.options.transitionEasing) | 			setTransitionEasing(scrolled, this.options.transitionEasing) | ||||||
|  | 
 | ||||||
|  | 			return this | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										10
									
								
								ui/modes.js
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								ui/modes.js
									
									
									
									
									
								
							| @ -179,6 +179,9 @@ var toggleSlideShowMode = createCSSClassToggler( | |||||||
| 			if(action == 'on'){ | 			if(action == 'on'){ | ||||||
| 				updateStatus('Slideshow...').show() | 				updateStatus('Slideshow...').show() | ||||||
| 
 | 
 | ||||||
|  | 				// XXX is this the correct way to go???
 | ||||||
|  | 				$('.viewer').addClass('overlay') | ||||||
|  | 
 | ||||||
| 				// interval from user...
 | 				// interval from user...
 | ||||||
| 				// XXX make this a real UI...
 | 				// XXX make this a real UI...
 | ||||||
| 				var interval = prompt('Slideshow interval (sec):', SLIDESHOW_INTERVAL/1000) | 				var interval = prompt('Slideshow interval (sec):', SLIDESHOW_INTERVAL/1000) | ||||||
| @ -187,12 +190,19 @@ var toggleSlideShowMode = createCSSClassToggler( | |||||||
| 				if(interval == null){ | 				if(interval == null){ | ||||||
| 					showStatus('Slideshow: cencelled...') | 					showStatus('Slideshow: cencelled...') | ||||||
| 					toggleSlideShowMode('off') | 					toggleSlideShowMode('off') | ||||||
|  | 
 | ||||||
|  | 					// XXX is this the correct way to go???
 | ||||||
|  | 					$('.viewer').removeClass('overlay') | ||||||
|  | 
 | ||||||
| 					return  | 					return  | ||||||
| 				} | 				} | ||||||
| 
 | 
 | ||||||
| 				SLIDESHOW_INTERVAL = isNaN(interval) ? 3000 : interval*1000 | 				SLIDESHOW_INTERVAL = isNaN(interval) ? 3000 : interval*1000 | ||||||
| 
 | 
 | ||||||
| 				showStatus('Slideshow: starting', SLIDESHOW_LOOP ? 'looped...' : 'unlooped...') | 				showStatus('Slideshow: starting', SLIDESHOW_LOOP ? 'looped...' : 'unlooped...') | ||||||
|  | 			 | ||||||
|  | 				// XXX is this the correct way to go???
 | ||||||
|  | 				$('.viewer').removeClass('overlay') | ||||||
| 
 | 
 | ||||||
| 				toggleSingleImageMode('on') | 				toggleSingleImageMode('on') | ||||||
| 				_slideshow_timer = setInterval(function(){ | 				_slideshow_timer = setInterval(function(){ | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user