| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | <!--
 | 
					
						
							|  |  |  | TODO: | 
					
						
							|  |  |  | - basic structure | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 	ribbons					DONE | 
					
						
							|  |  |  | 	images					DONE | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 	indicators | 
					
						
							|  |  |  | - basic control elements | 
					
						
							|  |  |  | 	touch zones / buttons | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 		next				DONE | 
					
						
							|  |  |  | 		prev				DONE | 
					
						
							| 
									
										
										
										
											2012-06-07 02:54:13 +04:00
										 |  |  | 		shift up			DONE | 
					
						
							|  |  |  | 		shift down			DONE | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 		promote				DONE | 
					
						
							|  |  |  | 		demote				DONE | 
					
						
							|  |  |  | 		zoom in				~		need real zooming... | 
					
						
							|  |  |  | 		zoom out			~		need real zooming... | 
					
						
							|  |  |  | 		toggle single image	DONE | 
					
						
							|  |  |  | - image sorting | 
					
						
							| 
									
										
										
										
											2012-06-07 02:54:13 +04:00
										 |  |  | 	- will affect: | 
					
						
							|  |  |  | 		- promote | 
					
						
							|  |  |  | 		- demote | 
					
						
							|  |  |  | 		- shift up | 
					
						
							|  |  |  | 		- shift down | 
					
						
							|  |  |  | 		- ribbon merging | 
					
						
							| 
									
										
										
										
											2012-06-07 01:59:34 +04:00
										 |  |  | - add promote/demote events (to attach structure editors)... | 
					
						
							|  |  |  | - add real images... | 
					
						
							|  |  |  | - make all the code relative to the current selection (multiple instances on a page support) | 
					
						
							|  |  |  | - make this into a jquery plugin... | 
					
						
							|  |  |  | - add dynamic loading and unloading for very large sets... | 
					
						
							| 
									
										
										
										
											2012-06-07 14:59:30 +04:00
										 |  |  | - gesture support... | 
					
						
							| 
									
										
										
										
											2012-06-05 16:28:47 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 02:54:13 +04:00
										 |  |  | - first stage refactoring: | 
					
						
							|  |  |  | 	- merge almost identical functions... | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 16:05:19 +04:00
										 |  |  | - multiple groups to promote/demote | 
					
						
							|  |  |  | 	ways to go: | 
					
						
							|  |  |  | 		- promote/demote and tag | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-05 16:28:47 +04:00
										 |  |  | ISSUES: | 
					
						
							| 
									
										
										
										
											2012-06-07 03:53:23 +04:00
										 |  |  | 	- jumping on focus up/down... | 
					
						
							|  |  |  | 	- demoting a first element (a ribbon is created) positions the field incorrectly (see demoteImage() for details)... | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | --> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <script src="jquery.js"></script> | 
					
						
							| 
									
										
										
										
											2012-06-07 14:59:30 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-08 01:01:34 +04:00
										 |  |  | <!-- script src="jquery.wipetouch.js"></script--> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 14:59:30 +04:00
										 |  |  | <!-- XXX this does not work on android... -->  | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | <script src="jquery.gestures.js"></script> | 
					
						
							| 
									
										
										
										
											2012-06-07 14:59:30 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | <!-- XXX need to figure out how to disable all the bling --> | 
					
						
							|  |  |  | <!-- script src="jquery.mobile.js"></script--> | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | <script> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $(document).ready(function() { | 
					
						
							| 
									
										
										
										
											2012-06-07 03:20:39 +04:00
										 |  |  | 	// current state... | 
					
						
							|  |  |  | 	if($('.current-ribbon').length == 0){ | 
					
						
							|  |  |  | 		$('.ribbon').first().addClass('current-ribbon') | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	if($('.current-image').length == 0){ | 
					
						
							|  |  |  | 		$('.current-ribbon').children('.image').first().addClass('current-image') | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 	// setup event handlers... | 
					
						
							| 
									
										
										
										
											2012-06-07 13:20:17 +04:00
										 |  |  | 	$(document) | 
					
						
							|  |  |  | 		.keydown(handleKeys) | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 	$('.viewer') | 
					
						
							| 
									
										
										
										
											2012-06-08 01:01:34 +04:00
										 |  |  | 		// XXX this is flaky and breaks some of my code... | 
					
						
							|  |  |  | 		/*.wipetouch({ | 
					
						
							|  |  |  | 			wipeLeft: nextImage, | 
					
						
							|  |  |  | 			wipeRight: prevImage, | 
					
						
							|  |  |  | 			wipeUp: demoteImage, | 
					
						
							|  |  |  | 			wipeDown: promoteImage, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			tapToClick: true | 
					
						
							|  |  |  | 		})*/ | 
					
						
							| 
									
										
										
										
											2012-06-07 14:59:30 +04:00
										 |  |  | 		// XXX does not work on android... | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 		.gestures({eventHandler: handleGestures}) | 
					
						
							| 
									
										
										
										
											2012-06-08 01:01:34 +04:00
										 |  |  | 		/* XXX jquery.mobile handlers... (with this I'm getting way too much bling) | 
					
						
							| 
									
										
										
										
											2012-06-07 14:59:30 +04:00
										 |  |  | 		.bind('swipeleft', function(e){ | 
					
						
							|  |  |  | 			nextImage() | 
					
						
							|  |  |  | 			e.preventDefault() | 
					
						
							|  |  |  | 			return false | 
					
						
							|  |  |  | 		}) | 
					
						
							|  |  |  | 		.bind('swiperight', function(e){ | 
					
						
							|  |  |  | 			prevImage() | 
					
						
							|  |  |  | 			e.preventDefault() | 
					
						
							|  |  |  | 			return false | 
					
						
							|  |  |  | 		}) | 
					
						
							|  |  |  | 		*/ | 
					
						
							| 
									
										
										
										
											2012-06-07 02:23:38 +04:00
										 |  |  | 	$(".image").click(handleClick) | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 	$('.next-image').click(nextImage) | 
					
						
							|  |  |  | 	$('.prev-image').click(prevImage) | 
					
						
							|  |  |  | 	$('.demote').click(demoteImage) | 
					
						
							|  |  |  | 	$('.promote').click(promoteImage) | 
					
						
							|  |  |  | 	$('.toggle-wide').click(toggleWideView) | 
					
						
							|  |  |  | 	$('.toggle-single').click(toggleRibbonView) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 	// set the default position... | 
					
						
							|  |  |  | 	$('.current-image').click() | 
					
						
							| 
									
										
										
										
											2012-06-08 16:43:44 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// load images... | 
					
						
							|  |  |  | 	// XXX not allowed... | 
					
						
							|  |  |  | 	//$.getJSON('images.js', loadImages}) | 
					
						
							|  |  |  | 	// XXX STUB | 
					
						
							|  |  |  | 	loadImages({ | 
					
						
							|  |  |  | 		images:[ | 
					
						
							|  |  |  | 			'images/350px/DSC_3501.jpg', | 
					
						
							|  |  |  | 			'images/350px/DSC_3503.jpg', | 
					
						
							|  |  |  | 			'images/350px/DSC_3504.jpg', | 
					
						
							|  |  |  | 			'images/350px/DSC_3506.jpg', | 
					
						
							|  |  |  | 		] | 
					
						
							|  |  |  | 	}) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | }); | 
					
						
							| 
									
										
										
										
											2012-06-05 17:35:13 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-08 16:43:44 +04:00
										 |  |  | function loadImages(json){ | 
					
						
							|  |  |  | 	// XXX STUB | 
					
						
							|  |  |  | 	var images = json.images | 
					
						
							|  |  |  | 	var ribbon = $('.ribbon').last() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	$('.image').remove() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	for(var i = 0; i < images.length; i++){ | 
					
						
							| 
									
										
										
										
											2012-06-08 16:58:29 +04:00
										 |  |  | 		$('<div class="image"></div>') | 
					
						
							| 
									
										
										
										
											2012-06-08 16:43:44 +04:00
										 |  |  | 			.css({ | 
					
						
							| 
									
										
										
										
											2012-06-08 16:58:29 +04:00
										 |  |  | 				'background-image': 'url('+images[i]+')' | 
					
						
							| 
									
										
										
										
											2012-06-08 16:43:44 +04:00
										 |  |  | 			}) | 
					
						
							|  |  |  | 			.click(handleClick) | 
					
						
							|  |  |  | 			.appendTo(ribbon) | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	ribbon.children().first().click() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 14:59:30 +04:00
										 |  |  | // XXX jquery.gestures handler... | 
					
						
							| 
									
										
										
										
											2012-06-07 13:20:17 +04:00
										 |  |  | function handleGestures(e){ | 
					
						
							|  |  |  | 	switch (e){ | 
					
						
							|  |  |  | 		case 'N': | 
					
						
							|  |  |  | 			demoteImage() | 
					
						
							|  |  |  | 			break | 
					
						
							|  |  |  | 		case 'S': | 
					
						
							|  |  |  | 			promoteImage() | 
					
						
							|  |  |  | 			break | 
					
						
							|  |  |  | 		case 'E': | 
					
						
							|  |  |  | 			prevImage() | 
					
						
							|  |  |  | 			break | 
					
						
							|  |  |  | 		case 'W': | 
					
						
							|  |  |  | 			nextImage() | 
					
						
							|  |  |  | 			break | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 03:20:39 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 02:23:38 +04:00
										 |  |  | function handleClick(e) { | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 	var cur = $(this) | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 	// switch classes... | 
					
						
							|  |  |  | 	cur.parents().siblings().children(".image").removeClass("current-image") | 
					
						
							|  |  |  | 	cur.siblings(".image").removeClass("current-image") | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 	cur.siblings().children(".image").removeClass("current-image") | 
					
						
							|  |  |  | 	cur.parents().siblings(".ribbon").removeClass("current-ribbon") | 
					
						
							| 
									
										
										
										
											2012-06-06 16:59:32 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 	cur.addClass("current-image") | 
					
						
							|  |  |  | 	cur.parents(".ribbon").addClass("current-ribbon") | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 	var container = cur.parents('.container') | 
					
						
							|  |  |  | 	var field = cur.parents(".field") | 
					
						
							| 
									
										
										
										
											2012-06-05 17:28:50 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 	var image_offset = cur.offset() | 
					
						
							|  |  |  | 	var field_offset = field.offset() | 
					
						
							| 
									
										
										
										
											2012-06-05 16:28:47 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 	// center the current image... | 
					
						
							|  |  |  | 	field.css({ | 
					
						
							| 
									
										
										
										
											2012-06-07 04:12:14 +04:00
										 |  |  | 		left: field_offset.left - image_offset.left + (container.innerWidth() - cur.innerWidth())/2,  | 
					
						
							|  |  |  | 		top: field_offset.top - image_offset.top + (container.innerHeight() - cur.innerHeight())/2  | 
					
						
							|  |  |  | 	}) | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// XXX do I need this??? | 
					
						
							|  |  |  | 	e.preventDefault(); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-06 22:06:10 +04:00
										 |  |  | var keys = { | 
					
						
							|  |  |  | 	toggleHelpKeys: [72], | 
					
						
							|  |  |  | 	toggleRibbonView: [32], | 
					
						
							|  |  |  | 	closeKeys: [27, 88, 67], | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 02:54:13 +04:00
										 |  |  | 	firstKeys: [36], | 
					
						
							|  |  |  | 	lastKeys: [35], | 
					
						
							| 
									
										
										
										
											2012-06-06 22:06:10 +04:00
										 |  |  | 	previousKeys: [37, 80], | 
					
						
							|  |  |  | 	nextKeys: [39, 78], | 
					
						
							| 
									
										
										
										
											2012-06-07 02:14:17 +04:00
										 |  |  | 	promoteKeys: [40], | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 	// XXX add del (46) to demote... | 
					
						
							| 
									
										
										
										
											2012-06-07 02:14:17 +04:00
										 |  |  | 	demoteKeys: [38], | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 02:54:13 +04:00
										 |  |  | 	ignoreKeys: [16, 17, 18], | 
					
						
							| 
									
										
										
										
											2012-06-06 22:06:10 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	helpShowOnUnknownKey: true | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | function handleKeys(event){ | 
					
						
							|  |  |  | 	var code = event.keyCode, fn = $.inArray; | 
					
						
							|  |  |  | 	var _ = (fn(code, keys.closeKeys) >= 0) ? function(){}() | 
					
						
							| 
									
										
										
										
											2012-06-07 02:54:13 +04:00
										 |  |  | 		: (fn(code, keys.firstKeys) >= 0) ? firstImage() | 
					
						
							| 
									
										
										
										
											2012-06-06 22:06:10 +04:00
										 |  |  | 		: (fn(code, keys.nextKeys) >= 0) ? nextImage() | 
					
						
							|  |  |  | 		: (fn(code, keys.previousKeys) >= 0) ? prevImage() | 
					
						
							| 
									
										
										
										
											2012-06-07 02:54:13 +04:00
										 |  |  | 		: (fn(code, keys.lastKeys) >= 0) ? lastImage() | 
					
						
							| 
									
										
										
										
											2012-06-07 02:14:17 +04:00
										 |  |  | 		: (fn(code, keys.promoteKeys) >= 0) ? function(){ | 
					
						
							|  |  |  | 			if(event.shiftKey){ | 
					
						
							| 
									
										
										
										
											2012-06-07 03:12:39 +04:00
										 |  |  | 				if(event.ctrlKey){ | 
					
						
							|  |  |  | 					createRibbonBelow() | 
					
						
							|  |  |  | 				} | 
					
						
							| 
									
										
										
										
											2012-06-07 02:54:13 +04:00
										 |  |  | 				promoteImage() | 
					
						
							| 
									
										
										
										
											2012-06-07 02:14:17 +04:00
										 |  |  | 			} else { | 
					
						
							| 
									
										
										
										
											2012-06-07 03:12:39 +04:00
										 |  |  | 				focusBelowRibbon() | 
					
						
							| 
									
										
										
										
											2012-06-07 02:14:17 +04:00
										 |  |  | 			} | 
					
						
							|  |  |  | 		}() | 
					
						
							|  |  |  | 		: (fn(code, keys.demoteKeys) >= 0) ? function(){ | 
					
						
							|  |  |  | 			if(event.shiftKey){ | 
					
						
							| 
									
										
										
										
											2012-06-07 03:12:39 +04:00
										 |  |  | 				if(event.ctrlKey){ | 
					
						
							|  |  |  | 					createRibbonAbove() | 
					
						
							|  |  |  | 				} | 
					
						
							| 
									
										
										
										
											2012-06-07 02:54:13 +04:00
										 |  |  | 				demoteImage() | 
					
						
							| 
									
										
										
										
											2012-06-07 02:14:17 +04:00
										 |  |  | 			} else { | 
					
						
							| 
									
										
										
										
											2012-06-07 03:12:39 +04:00
										 |  |  | 				focusAboveRibbon() | 
					
						
							| 
									
										
										
										
											2012-06-07 02:14:17 +04:00
										 |  |  | 			} | 
					
						
							|  |  |  | 		}() | 
					
						
							| 
									
										
										
										
											2012-06-06 22:06:10 +04:00
										 |  |  | 		: (fn(code, keys.toggleRibbonView) >= 0) ? toggleRibbonView() | 
					
						
							| 
									
										
										
										
											2012-06-07 02:54:13 +04:00
										 |  |  | 		: (fn(code, keys.ignoreKeys) >= 0) ? false | 
					
						
							| 
									
										
										
										
											2012-06-06 22:06:10 +04:00
										 |  |  | 		// XXX | 
					
						
							| 
									
										
										
										
											2012-06-07 02:14:17 +04:00
										 |  |  | 		: (keys.helpShowOnUnknownKey) ? function(){alert(code)}() | 
					
						
							| 
									
										
										
										
											2012-06-06 22:06:10 +04:00
										 |  |  | 		: false; | 
					
						
							|  |  |  | 	return false; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-06 16:47:53 +04:00
										 |  |  | // modes... | 
					
						
							|  |  |  | function showRibbon(){ | 
					
						
							| 
									
										
										
										
											2012-06-06 16:53:06 +04:00
										 |  |  | 	$('.single-image-mode').removeClass('single-image-mode') | 
					
						
							| 
									
										
										
										
											2012-06-06 16:47:53 +04:00
										 |  |  | } | 
					
						
							|  |  |  | function showSingle(){ | 
					
						
							| 
									
										
										
										
											2012-06-08 15:22:26 +04:00
										 |  |  | 	$('.viewer').not('.single-image-mode').addClass('single-image-mode') | 
					
						
							| 
									
										
										
										
											2012-06-06 16:47:53 +04:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2012-06-06 22:06:10 +04:00
										 |  |  | function toggleRibbonView(){ | 
					
						
							|  |  |  | 	if($('.single-image-mode').length > 0){ | 
					
						
							|  |  |  | 		showRibbon() | 
					
						
							|  |  |  | 	} else { | 
					
						
							|  |  |  | 		showSingle() | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2012-06-06 16:47:53 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | // XXX need to reposition the whole thing correctly... | 
					
						
							|  |  |  | function toggleWideView(){ | 
					
						
							|  |  |  | 	if($('.wide-view-mode').length > 0){ | 
					
						
							|  |  |  | 		$('.wide-view-mode') | 
					
						
							|  |  |  | 			.removeClass('wide-view-mode') | 
					
						
							|  |  |  | 			.one("webkitTransitionEnd oTransitionEnd msTransitionEnd transitionend", function(){ | 
					
						
							|  |  |  | 				$('.current-image').click() | 
					
						
							|  |  |  | 				return true | 
					
						
							|  |  |  | 			}); | 
					
						
							|  |  |  | 		 | 
					
						
							|  |  |  | 	} else { | 
					
						
							|  |  |  | 		showRibbon() | 
					
						
							|  |  |  | 		//$('.container') | 
					
						
							| 
									
										
										
										
											2012-06-08 15:22:26 +04:00
										 |  |  | 		$('.viewer') | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 			.not('.wide-view-mode') | 
					
						
							|  |  |  | 				.addClass('wide-view-mode') | 
					
						
							|  |  |  | 				.one("webkitTransitionEnd oTransitionEnd msTransitionEnd transitionend", function(){ | 
					
						
							|  |  |  | 					$('.current-image').click() | 
					
						
							|  |  |  | 					return true | 
					
						
							|  |  |  | 				}); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-05 17:50:58 +04:00
										 |  |  | // basic navigation... | 
					
						
							| 
									
										
										
										
											2012-06-07 02:54:13 +04:00
										 |  |  | function firstImage(){ | 
					
						
							|  |  |  | 	$('.current-ribbon').children('.image').first().click() | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-05 16:28:47 +04:00
										 |  |  | function prevImage(){ | 
					
						
							| 
									
										
										
										
											2012-06-08 16:43:44 +04:00
										 |  |  | 	$('.current-image').prev('.image').click() | 
					
						
							| 
									
										
										
										
											2012-06-05 16:28:47 +04:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2012-06-05 17:50:58 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-05 16:28:47 +04:00
										 |  |  | function nextImage(){ | 
					
						
							| 
									
										
										
										
											2012-06-08 16:43:44 +04:00
										 |  |  | 	$('.current-image').next('.image').click() | 
					
						
							| 
									
										
										
										
											2012-06-05 16:28:47 +04:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 02:54:13 +04:00
										 |  |  | function lastImage(){ | 
					
						
							|  |  |  | 	$('.current-ribbon').children('.image').last().click() | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // XXX select appropriate image... | 
					
						
							| 
									
										
										
										
											2012-06-07 02:14:17 +04:00
										 |  |  | function focusAboveRibbon(){ | 
					
						
							| 
									
										
										
										
											2012-06-07 02:54:13 +04:00
										 |  |  | 	$('.current-ribbon').prev('.ribbon').children('.image').first().click() | 
					
						
							| 
									
										
										
										
											2012-06-07 02:14:17 +04:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2012-06-05 17:50:58 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 02:54:13 +04:00
										 |  |  | // XXX select appropriate image... | 
					
						
							| 
									
										
										
										
											2012-06-07 02:14:17 +04:00
										 |  |  | function focusBelowRibbon(){ | 
					
						
							| 
									
										
										
										
											2012-06-07 02:54:13 +04:00
										 |  |  | 	$('.current-ribbon').next('.ribbon').children('.image').first().click() | 
					
						
							| 
									
										
										
										
											2012-06-07 02:14:17 +04:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2012-06-05 17:50:58 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // create ribbon above/below helpers... | 
					
						
							| 
									
										
										
										
											2012-06-07 03:53:23 +04:00
										 |  |  | // XXX NOTE: this will shift the content downwards... | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | function createRibbonAbove(){ | 
					
						
							| 
									
										
										
										
											2012-06-07 03:53:23 +04:00
										 |  |  | 	var res = $('<div class="new-ribbon"></div>') | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 		.insertBefore('.current-ribbon') | 
					
						
							|  |  |  | 		// HACK: without this, the class change below will not animate... | 
					
						
							|  |  |  | 		.show() | 
					
						
							|  |  |  | 		.addClass('ribbon') | 
					
						
							|  |  |  | 		.removeClass('new-ribbon') | 
					
						
							| 
									
										
										
										
											2012-06-07 03:53:23 +04:00
										 |  |  | 	// XXX find a better way to do this... | 
					
						
							|  |  |  | 	$('.field').css({ | 
					
						
							|  |  |  | 		top: $('.field').position().top - $('.current-ribbon').outerHeight() | 
					
						
							|  |  |  | 	}) | 
					
						
							|  |  |  | 	return res | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | function createRibbonBelow(){ | 
					
						
							|  |  |  | 	return $('<div class="new-ribbon"></div>') | 
					
						
							|  |  |  | 		.insertAfter('.current-ribbon') | 
					
						
							|  |  |  | 		// HACK: without this, the class change below will not animate... | 
					
						
							|  |  |  | 		.show() | 
					
						
							|  |  |  | 		.addClass('ribbon') | 
					
						
							|  |  |  | 		.removeClass('new-ribbon') | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 02:54:13 +04:00
										 |  |  | // Modifiers... | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | // XXX sort elements correctly... | 
					
						
							|  |  |  | function mergeRibbonsUp(){ | 
					
						
							|  |  |  | 	$('.current-ribbon') | 
					
						
							|  |  |  | 		.prev('.ribbon') | 
					
						
							|  |  |  | 			.children() | 
					
						
							|  |  |  | 				.detach() | 
					
						
							|  |  |  | 				.insertAfter('.current-image') | 
					
						
							|  |  |  | 	$('.current-ribbon') | 
					
						
							|  |  |  | 		.prev('.ribbon') | 
					
						
							|  |  |  | 			.slideUp(function(){ | 
					
						
							|  |  |  | 				$(this).remove() | 
					
						
							|  |  |  | 				$('.current-image').click() | 
					
						
							|  |  |  | 			}) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // XXX sort elements correctly... | 
					
						
							|  |  |  | function mergeRibbonsDown(){ | 
					
						
							|  |  |  | 	$('.current-ribbon') | 
					
						
							|  |  |  | 		.next('.ribbon') | 
					
						
							|  |  |  | 			.children() | 
					
						
							|  |  |  | 				.detach() | 
					
						
							|  |  |  | 				.insertAfter('.current-image') | 
					
						
							|  |  |  | 	$('.current-ribbon') | 
					
						
							|  |  |  | 		.next('.ribbon') | 
					
						
							|  |  |  | 			.slideUp(function(){ | 
					
						
							|  |  |  | 				$(this).remove() | 
					
						
							|  |  |  | 				$('.current-image').click() | 
					
						
							|  |  |  | 			}) | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2012-06-05 17:50:58 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | // XXX sort elements correctly... | 
					
						
							|  |  |  | // XXX do animations... | 
					
						
							|  |  |  | function promoteImage(){ | 
					
						
							|  |  |  | 	if($('.current-ribbon').next('.ribbon').length == 0){ | 
					
						
							|  |  |  | 		createRibbonBelow() | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	// XXX sort elements correctly... | 
					
						
							|  |  |  | 	if($('.current-ribbon').children('.image').length == 1){ | 
					
						
							| 
									
										
										
										
											2012-06-07 02:27:26 +04:00
										 |  |  | 		// XXX this adds image to the head while the below portion adds it to the tail... | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 		mergeRibbonsDown() | 
					
						
							|  |  |  | 	} else { | 
					
						
							|  |  |  | 		img = $('.current-image') | 
					
						
							|  |  |  | 		if(img.next('.image').length == 0){ | 
					
						
							|  |  |  | 			prevImage() | 
					
						
							|  |  |  | 		} else { | 
					
						
							|  |  |  | 			nextImage() | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		img | 
					
						
							|  |  |  | 			.detach() | 
					
						
							|  |  |  | 			.appendTo($('.current-ribbon').next('.ribbon')) | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2012-06-07 01:55:51 +04:00
										 |  |  | 	$('.current-image').click() | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2012-06-05 17:50:58 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | // XXX sort elements correctly... | 
					
						
							|  |  |  | // XXX do animations... | 
					
						
							| 
									
										
										
										
											2012-06-07 03:53:23 +04:00
										 |  |  | // XXX BUG: when demoting first image (new ribbon created) it gets focused... | 
					
						
							|  |  |  | //		REASON: .click() gets called in several places BEFORE the animation is done... | 
					
						
							|  |  |  | //		NOTE: this bog does not affect promoteImage -- adding a lower element does not affect current positioning... | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | function demoteImage(){ | 
					
						
							|  |  |  | 	if($('.current-ribbon').prev('.ribbon').length == 0){ | 
					
						
							| 
									
										
										
										
											2012-06-07 03:53:23 +04:00
										 |  |  | 		var new_ribbon = createRibbonAbove() | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	// XXX sort elements correctly... | 
					
						
							|  |  |  | 	if($('.current-ribbon').children('.image').length == 1){ | 
					
						
							| 
									
										
										
										
											2012-06-07 03:53:23 +04:00
										 |  |  | 		// XXX this adds image to the head while the below portion adds it to the tail... | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 		mergeRibbonsUp() | 
					
						
							|  |  |  | 	} else { | 
					
						
							|  |  |  | 		img = $('.current-image') | 
					
						
							|  |  |  | 		if(img.next('.image').length == 0){ | 
					
						
							| 
									
										
										
										
											2012-06-07 03:53:23 +04:00
										 |  |  | 			// XXX in case when we've just created an empty ribbon, the click in this fires BEFORE it is fully expanded... | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 			prevImage() | 
					
						
							|  |  |  | 		} else { | 
					
						
							| 
									
										
										
										
											2012-06-07 03:53:23 +04:00
										 |  |  | 			// XXX in case when we've just created an empty ribbon, the click in this fires BEFORE it is fully expanded... | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 			nextImage() | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		img | 
					
						
							|  |  |  | 			.detach() | 
					
						
							|  |  |  | 			.appendTo($('.current-ribbon').prev('.ribbon')) | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2012-06-07 03:53:23 +04:00
										 |  |  | 	// XXX in case when we've just created an empty ribbon, the click in this fires BEFORE it is fully expanded... | 
					
						
							| 
									
										
										
										
											2012-06-07 01:55:51 +04:00
										 |  |  | 	$('.current-image').click() | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2012-06-05 17:50:58 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-05 16:28:47 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | </script> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <style> | 
					
						
							| 
									
										
										
										
											2012-06-05 17:44:42 +04:00
										 |  |  | 	.image { | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 		position: relative; | 
					
						
							| 
									
										
										
										
											2012-06-08 16:58:29 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		width: 350px; | 
					
						
							|  |  |  | 		height: 350px; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 		display: inline-block; | 
					
						
							| 
									
										
										
										
											2012-06-08 16:58:29 +04:00
										 |  |  | 		background: no-repeat 50% black; | 
					
						
							|  |  |  | 		background-size: contain; | 
					
						
							| 
									
										
										
										
											2012-06-05 16:28:47 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-05 17:44:42 +04:00
										 |  |  | 		opacity: 0.3; | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-05 16:28:47 +04:00
										 |  |  | 		-webkit-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-moz-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-o-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-ms-transition: all 0.5s ease;	 | 
					
						
							|  |  |  | 		transition: all 0.5s ease; | 
					
						
							| 
									
										
										
										
											2012-06-05 17:44:42 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		cursor: hand; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.mock-image { | 
					
						
							|  |  |  | 		background: blue; | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 	.demo-buttons { | 
					
						
							|  |  |  | 		margin: 15px | 
					
						
							|  |  |  | 		border: groove 2px; | 
					
						
							|  |  |  | 		 | 
					
						
							|  |  |  | 		opacity: 0.2; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		-webkit-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-moz-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-o-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-ms-transition: all 0.5s ease;	 | 
					
						
							|  |  |  | 		transition: all 0.5s ease; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	.demo-buttons:hover { | 
					
						
							|  |  |  | 		opacity: 1; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.viewer { | 
					
						
							|  |  |  | 		width: 900px; | 
					
						
							|  |  |  | 		height: 500px; | 
					
						
							|  |  |  | 		border: solid blue 5px; | 
					
						
							|  |  |  | 		margin: 20px;  | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	.controller { | 
					
						
							|  |  |  | 		height: 500px; | 
					
						
							|  |  |  | 		width: 50px; | 
					
						
							|  |  |  | 		background: silver; | 
					
						
							|  |  |  | 		float: left; | 
					
						
							| 
									
										
										
										
											2012-06-08 15:22:26 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		-webkit-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-moz-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-o-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-ms-transition: all 0.5s ease;	 | 
					
						
							|  |  |  | 		transition: all 0.5s ease; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	.single-image-mode .controller { | 
					
						
							|  |  |  | 		opacity: 0.2; | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	.promote, .next-image, .prev-image, .demote, .toggle-wide, .toggle-single { | 
					
						
							|  |  |  | 		text-align: center; | 
					
						
							|  |  |  | 		vertical-align: middle; | 
					
						
							|  |  |  | 		width: 100%; | 
					
						
							|  |  |  | 		height: 150px;  | 
					
						
							|  |  |  | 		background: gray; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	   -moz-user-select: none; | 
					
						
							|  |  |  | 	   -webkit-user-select: none; | 
					
						
							|  |  |  | 	   -o-user-select: none; | 
					
						
							|  |  |  | 	   -ms-user-select: none; | 
					
						
							|  |  |  | 	   user-select: none; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	.next-image, .prev-image, .toggle-wide, .toggle-single { | 
					
						
							|  |  |  | 		background: silver; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	.toggle-wide, .toggle-single { | 
					
						
							|  |  |  | 		height:50px | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	.promote { | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	.next-image { | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	.prev-image { | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	.demote { | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	.toggle-wide { | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	.toggle-single { | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 	.container { | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 		float: left; | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 		overflow: hidden; | 
					
						
							| 
									
										
										
										
											2012-06-06 16:16:13 +04:00
										 |  |  | 		width: 800px; | 
					
						
							|  |  |  | 		height: 500px; | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.field { | 
					
						
							|  |  |  | 		position: relative; | 
					
						
							|  |  |  | 		overflow: visible; | 
					
						
							|  |  |  | 		top: 0px; | 
					
						
							|  |  |  | 		left: -100px; | 
					
						
							| 
									
										
										
										
											2012-06-05 17:35:13 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		-webkit-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-moz-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-o-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-ms-transition: all 0.5s ease;	 | 
					
						
							|  |  |  | 		transition: all 0.5s ease; | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.ribbon { | 
					
						
							| 
									
										
										
										
											2012-06-06 16:16:13 +04:00
										 |  |  | 		height: 360px; | 
					
						
							| 
									
										
										
										
											2012-06-07 02:27:26 +04:00
										 |  |  | 		/* XXX make this expand dynamically */ | 
					
						
							| 
									
										
										
										
											2012-06-07 02:54:13 +04:00
										 |  |  | 		width: 10000px; | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 		overflow: visible; | 
					
						
							| 
									
										
										
										
											2012-06-05 16:28:47 +04:00
										 |  |  | 		padding-top: 2px; | 
					
						
							|  |  |  | 		padding-bottom: 2px; | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 		text-align: center; | 
					
						
							| 
									
										
										
										
											2012-06-05 16:28:47 +04:00
										 |  |  | 		opacity: 0.2; | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		-webkit-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-moz-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-o-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-ms-transition: all 0.5s ease;	 | 
					
						
							|  |  |  | 		transition: all 0.5s ease; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 	.new-ribbon { | 
					
						
							|  |  |  | 		height: 0px; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		-webkit-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-moz-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-o-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-ms-transition: all 0.5s ease;	 | 
					
						
							|  |  |  | 		transition: all 0.5s ease; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	.current-image { | 
					
						
							| 
									
										
										
										
											2012-06-05 17:44:42 +04:00
										 |  |  | 		opacity: 1.0; | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.current-ribbon { | 
					
						
							| 
									
										
										
										
											2012-06-06 16:16:13 +04:00
										 |  |  | 		padding-top: 20px; | 
					
						
							|  |  |  | 		padding-bottom: 20px; | 
					
						
							| 
									
										
										
										
											2012-06-05 16:28:47 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		opacity: 1.0; | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		-webkit-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-moz-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-o-transition: all 0.5s ease; | 
					
						
							|  |  |  | 		-ms-transition: all 0.5s ease;	 | 
					
						
							|  |  |  | 		transition: all 0.5s ease; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.current-ribbon .image { | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2012-06-06 16:47:53 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-06 16:59:32 +04:00
										 |  |  | 	/* single image theme (start everything with .single-image-mode)  | 
					
						
							|  |  |  | 	 * | 
					
						
							|  |  |  | 	 * XXX need to make this touch friendly... | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2012-06-06 16:53:06 +04:00
										 |  |  | 	.single-image-mode .image { | 
					
						
							| 
									
										
										
										
											2012-06-06 16:47:53 +04:00
										 |  |  | 		opacity: 0.0; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-06 16:53:06 +04:00
										 |  |  | 	.single-image-mode .image:hover { | 
					
						
							| 
									
										
										
										
											2012-06-06 16:47:53 +04:00
										 |  |  | 		opacity: 0.5; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-06 16:53:06 +04:00
										 |  |  | 	.single-image-mode .current-image:hover, .single-image-mode .current-image { | 
					
						
							| 
									
										
										
										
											2012-06-06 16:47:53 +04:00
										 |  |  | 		opacity: 1.0; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 02:27:26 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 	/* wide view mode */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* XXX not yet working correctly... | 
					
						
							|  |  |  | 	.wide-view-mode { | 
					
						
							|  |  |  | 		transform: scale(0.2,0.2); | 
					
						
							|  |  |  | 		-ms-transform: scale(0.2,0.2); | 
					
						
							|  |  |  | 		-webkit-transform: scale(0.2,0.2); | 
					
						
							|  |  |  | 		-o-transform: scale(0.2,0.2); | 
					
						
							|  |  |  | 		-moz-transform: scale(0.2,0.2); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	*/ | 
					
						
							| 
									
										
										
										
											2012-06-08 16:58:29 +04:00
										 |  |  | 	.wide-view-mode .image { | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 		width: 50px; | 
					
						
							|  |  |  | 		height: 50px; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.wide-view-mode .ribbon { | 
					
						
							|  |  |  | 		height: 60px; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-06 16:47:53 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | </style> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | <div class="viewer"> | 
					
						
							|  |  |  | 	<div class="controller"> | 
					
						
							|  |  |  | 		<div class="demote">^</div> | 
					
						
							|  |  |  | 		<div class="prev-image"><</div> | 
					
						
							|  |  |  | 		<div class="promote">v</div> | 
					
						
							|  |  |  | 		<div class="toggle-single">[ ]</div> | 
					
						
							|  |  |  | 	</div> | 
					
						
							|  |  |  | 	<div class="container"> | 
					
						
							|  |  |  | 		<div class="field"> | 
					
						
							|  |  |  | 			<div class="ribbon"> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 				<div class="image mock-image"></div> | 
					
						
							|  |  |  | 			</div> | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | 		</div> | 
					
						
							|  |  |  | 	</div> | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 	<div class="controller"> | 
					
						
							|  |  |  | 		<div class="demote">^</div> | 
					
						
							|  |  |  | 		<div class="next-image">></div> | 
					
						
							|  |  |  | 		<div class="promote">v</div> | 
					
						
							|  |  |  | 		<div class="toggle-wide">+/-</div> | 
					
						
							|  |  |  | 	</div> | 
					
						
							| 
									
										
										
										
											2012-06-05 15:26:41 +04:00
										 |  |  | </div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | <div class="demo-buttons"> | 
					
						
							| 
									
										
										
										
											2012-06-05 16:28:47 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 	<button onclick="firstImage()">first (home)</button> | 
					
						
							|  |  |  | 	<button onclick="prevImage()">prev (left)</button> | 
					
						
							|  |  |  | 	<button onclick="nextImage()">next (right)</button> | 
					
						
							|  |  |  | 	<button onclick="lastImage()">last (end)</button> | 
					
						
							| 
									
										
										
										
											2012-06-06 16:47:53 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 	<br><br> | 
					
						
							| 
									
										
										
										
											2012-06-06 16:47:53 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 	<button onclick="showSingle()">single</button> | 
					
						
							|  |  |  | 	<button onclick="showRibbon()">ribbon</button> | 
					
						
							|  |  |  | 	<button onclick="toggleRibbonView()">toggle ribbon view (space)</button> | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 	<br><br> | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 	<button onclick="toggleWideView()">toggle wide view</button> | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 	<br><br> | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 	<button onclick="createRibbonAbove()" disabled>create ribbon above (helper)</button><br> | 
					
						
							|  |  |  | 	<button onclick="createRibbonBelow()" disabled>create ribbon below (helper)</button> | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 	<br><br> | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 	<button onclick="mergeRibbonsUp()">merge ribbons up</button><br> | 
					
						
							|  |  |  | 	<button onclick="mergeRibbonsDown()">merge ribbons down</button> | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 	<br><br> | 
					
						
							| 
									
										
										
										
											2012-06-07 02:14:17 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 	<button onclick="demoteImage()">demote image (shift-up)</button><br> | 
					
						
							|  |  |  | 	<button onclick="promoteImage()">promote image (shift-down)</button><br> | 
					
						
							|  |  |  | 	NOTE: ctrl-shift-up / ctrl-shift-down will demote / promote an image to a new empty ribbon (the default if no ribbon exists) | 
					
						
							| 
									
										
										
										
											2012-06-07 02:14:17 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 	<br><br> | 
					
						
							| 
									
										
										
										
											2012-06-07 01:50:44 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-08 15:17:48 +04:00
										 |  |  | 	<button onclick="focusAboveRibbon()">focus above ribbon (up)</button><br> | 
					
						
							|  |  |  | 	<button onclick="focusBelowRibbon()">focus below ribbon (down)</button> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | </div> | 
					
						
							| 
									
										
										
										
											2012-06-06 16:59:32 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-05 16:28:47 +04:00
										 |  |  | <!-- vim:set ts=4 sw=4 nowrap : --> |