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_VISIBLE
 | ||||
| 
 | ||||
| // can be:
 | ||||
| // 	- animate
 | ||||
| // 	- css
 | ||||
| var TRANSITION_MODE_DEFAULT = 'animate' | ||||
| 
 | ||||
| var MAX_SCREEN_IMAGES = 12 | ||||
|  | ||||
| @ -77,6 +77,11 @@ less = { | ||||
| //DEBUG = 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... | ||||
| $(function(){ | ||||
| @ -99,7 +104,7 @@ $(function(){ | ||||
| 
 | ||||
| 
 | ||||
| 	if(SCROLLER_ENABLED){ | ||||
| 		var scroller = makeScrollHandler($('.viewer'), { | ||||
| 		SCROLLER = makeScrollHandler($('.viewer'), { | ||||
| 				// XXX after click and initial move the screen jumps  | ||||
| 				//		(both x and y), margins, left vs. translate? | ||||
| 				// | ||||
| @ -115,7 +120,9 @@ $(function(){ | ||||
| 
 | ||||
| 				// it's either this or disable the jQuery animation... | ||||
| 				// ...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', | ||||
| 
 | ||||
| 				// keep selectable elements selectable... | ||||
| @ -124,7 +131,6 @@ $(function(){ | ||||
| 					'.overlay-info, '+ | ||||
| 					'', | ||||
| 			}) | ||||
| 			.start() | ||||
| 
 | ||||
| 		$('.viewer') | ||||
| 			.on('shortClick', function(){ clickHandler(event) }) | ||||
| @ -247,6 +253,8 @@ $(function(){ | ||||
| 			} | ||||
| 
 | ||||
| 			updateImages() | ||||
| 
 | ||||
| 			SCROLLER.start() | ||||
| 		}) | ||||
| 
 | ||||
| }) | ||||
|  | ||||
| @ -884,6 +884,7 @@ body { | ||||
|   height: 100%; | ||||
|   width: 100%; | ||||
|   opacity: 0.7; | ||||
|   cursor: auto; | ||||
| } | ||||
| /************************************************************ Help ***/ | ||||
| /* XXX make this more generic, and not just for the keyboard... */ | ||||
|  | ||||
| @ -881,6 +881,8 @@ body { | ||||
| 	height: 100%; | ||||
| 	width: 100%; | ||||
| 	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 :                                                */ | ||||
|  | ||||
| @ -339,6 +339,10 @@ function makeScrollHandler(root, config){ | ||||
| 						.on('mouseup', endMoveHandler)  | ||||
| 				} | ||||
| 			} | ||||
| 
 | ||||
| 			// setup transitions...
 | ||||
| 			this.resetTransitions() | ||||
| 
 | ||||
| 			return this | ||||
| 		}, | ||||
| 		// XXX test...
 | ||||
| @ -366,6 +370,8 @@ function makeScrollHandler(root, config){ | ||||
| 			var scrolled = this.root.children().first() | ||||
| 			setTransitionDuration(scrolled, this.options.transitionDuration) | ||||
| 			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'){ | ||||
| 				updateStatus('Slideshow...').show() | ||||
| 
 | ||||
| 				// XXX is this the correct way to go???
 | ||||
| 				$('.viewer').addClass('overlay') | ||||
| 
 | ||||
| 				// interval from user...
 | ||||
| 				// XXX make this a real UI...
 | ||||
| 				var interval = prompt('Slideshow interval (sec):', SLIDESHOW_INTERVAL/1000) | ||||
| @ -187,6 +190,10 @@ var toggleSlideShowMode = createCSSClassToggler( | ||||
| 				if(interval == null){ | ||||
| 					showStatus('Slideshow: cencelled...') | ||||
| 					toggleSlideShowMode('off') | ||||
| 
 | ||||
| 					// XXX is this the correct way to go???
 | ||||
| 					$('.viewer').removeClass('overlay') | ||||
| 
 | ||||
| 					return  | ||||
| 				} | ||||
| 
 | ||||
| @ -194,6 +201,9 @@ var toggleSlideShowMode = createCSSClassToggler( | ||||
| 
 | ||||
| 				showStatus('Slideshow: starting', SLIDESHOW_LOOP ? 'looped...' : 'unlooped...') | ||||
| 			 | ||||
| 				// XXX is this the correct way to go???
 | ||||
| 				$('.viewer').removeClass('overlay') | ||||
| 
 | ||||
| 				toggleSingleImageMode('on') | ||||
| 				_slideshow_timer = setInterval(function(){ | ||||
| 					var cur = getImage() | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user