| 
									
										
										
										
											2013-04-26 05:30:56 +04:00
										 |  |  | <html> | 
					
						
							|  |  |  | <head> | 
					
						
							|  |  |  | <title>ImageGrid.Viewer</title> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <style> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-03 02:27:54 +04:00
										 |  |  | /*  | 
					
						
							|  |  |  | * XXX move the CSS to a separate file... | 
					
						
							|  |  |  | * XXX split-off styling/coloring from layout... | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-26 05:30:56 +04:00
										 |  |  | .viewer { | 
					
						
							|  |  |  | 	position: relative; | 
					
						
							|  |  |  | 	width: 800px; | 
					
						
							|  |  |  | 	height: 600px; | 
					
						
							| 
									
										
										
										
											2013-04-29 01:59:59 +04:00
										 |  |  | 	overflow: hidden; | 
					
						
							| 
									
										
										
										
											2013-04-26 05:30:56 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	border: solid blue 1px; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .ribbon-set { | 
					
						
							| 
									
										
										
										
											2013-04-29 01:59:59 +04:00
										 |  |  | 	position: absolute; | 
					
						
							| 
									
										
										
										
											2013-04-26 05:30:56 +04:00
										 |  |  | } | 
					
						
							|  |  |  | .ribbon-set:empty:after { | 
					
						
							|  |  |  | 	display: block; | 
					
						
							|  |  |  | 	top: 0px; | 
					
						
							|  |  |  | 	left: 0px; | 
					
						
							|  |  |  | 	width: 100%; | 
					
						
							|  |  |  | 	height: 100%; | 
					
						
							|  |  |  | 	content: "Empty"; | 
					
						
							|  |  |  | 	text-align: center; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .ribbon { | 
					
						
							|  |  |  | 	position: relative; | 
					
						
							|  |  |  | 	display: block; | 
					
						
							|  |  |  | 	height: auto; | 
					
						
							|  |  |  | 	min-width: 0px; | 
					
						
							|  |  |  | 	overflow: visible; | 
					
						
							|  |  |  | 	white-space: nowrap; | 
					
						
							|  |  |  | 	font-size: 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	margin-top: 20px; | 
					
						
							|  |  |  | 	margin-bottom: 20px; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2013-04-30 00:28:47 +04:00
										 |  |  | .ribbon:empty { | 
					
						
							|  |  |  | 	display: none; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2013-04-26 05:30:56 +04:00
										 |  |  | .ribbon:first-child { | 
					
						
							|  |  |  | 	margin-top: 0px; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | .ribbon:last-child { | 
					
						
							|  |  |  | 	margin-bottom: 0px; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .image { | 
					
						
							|  |  |  | 	position: relative; | 
					
						
							|  |  |  | 	display: inline-block; | 
					
						
							|  |  |  | 	vertical-align: middle; | 
					
						
							|  |  |  | 	text-align;left; | 
					
						
							| 
									
										
										
										
											2013-04-29 19:12:19 +04:00
										 |  |  | 	width: 300px; | 
					
						
							|  |  |  | 	height: 300px; | 
					
						
							| 
									
										
										
										
											2013-04-26 05:30:56 +04:00
										 |  |  | 	font-size: 12pt; | 
					
						
							| 
									
										
										
										
											2013-04-29 23:07:47 +04:00
										 |  |  | 	overflow: hidden; | 
					
						
							| 
									
										
										
										
											2013-04-26 05:30:56 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	background: black; | 
					
						
							| 
									
										
										
										
											2013-04-29 19:12:19 +04:00
										 |  |  | 	box-sizing: border-box; | 
					
						
							| 
									
										
										
										
											2013-04-26 05:30:56 +04:00
										 |  |  | 	border: solid gray 1px; | 
					
						
							|  |  |  | 	color: white; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | .current.image { | 
					
						
							|  |  |  | 	background: red; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-29 23:07:47 +04:00
										 |  |  | /* dot mark... */ | 
					
						
							| 
									
										
										
										
											2013-04-29 19:12:19 +04:00
										 |  |  | .marked.image:after { | 
					
						
							|  |  |  | 	display: block; | 
					
						
							|  |  |  | 	position: absolute; | 
					
						
							|  |  |  | 	content: ""; | 
					
						
							|  |  |  | 	font-size: 0pt; | 
					
						
							|  |  |  | 	border: none; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-29 23:07:47 +04:00
										 |  |  | 	width: 15px; | 
					
						
							|  |  |  | 	height: 15px; | 
					
						
							| 
									
										
										
										
											2013-04-29 19:12:19 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	bottom: 5px; | 
					
						
							|  |  |  | 	right: 5px; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	border-radius: 50%; | 
					
						
							|  |  |  | 	background: blue; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-29 23:07:47 +04:00
										 |  |  | /* corner mark... (a-la bookmarks in PortableMag) */ | 
					
						
							|  |  |  | /* | 
					
						
							|  |  |  | .marked.image:after { | 
					
						
							|  |  |  | 	display: block; | 
					
						
							|  |  |  | 	position: absolute; | 
					
						
							|  |  |  | 	content: ""; | 
					
						
							|  |  |  | 	font-size: 0pt; | 
					
						
							|  |  |  | 	border: none; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	width: 30px; | 
					
						
							|  |  |  | 	height: 30px; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	top: -15px; | 
					
						
							|  |  |  | 	right: -15px; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	background: blue; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	-webkit-transform: rotate(45deg); | 
					
						
							|  |  |  | 	-moz-transform: rotate(45deg); | 
					
						
							|  |  |  | 	-o-transform: rotate(45deg); | 
					
						
							|  |  |  | 	-ms-transform: rotate(45deg); | 
					
						
							|  |  |  | 	transform: rotate(45deg); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | */ | 
					
						
							| 
									
										
										
										
											2013-04-26 05:30:56 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-30 00:28:47 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | .marked-only.viewer:after { | 
					
						
							|  |  |  | 	display: block; | 
					
						
							|  |  |  | 	position: absolute; | 
					
						
							|  |  |  | 	content: "Showing marked images only"; | 
					
						
							|  |  |  | 	font-size: 14pt; | 
					
						
							|  |  |  | 	border: none; | 
					
						
							|  |  |  | 	color: blue; | 
					
						
							|  |  |  | 	width: auto; | 
					
						
							|  |  |  | 	height: auto; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	top: 10px; | 
					
						
							|  |  |  | 	right: 10px; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | .marked-only .image:not(.marked) { | 
					
						
							|  |  |  | 	display: none; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | .marked-only .marked.image:after { | 
					
						
							|  |  |  | 	display: none; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-30 00:54:32 +04:00
										 |  |  | .up-indicator, | 
					
						
							|  |  |  | .down-indicator { | 
					
						
							|  |  |  | 	display: block; | 
					
						
							|  |  |  | 	position: absolute; | 
					
						
							|  |  |  | 	content: ""; | 
					
						
							|  |  |  | 	top: 0px; | 
					
						
							|  |  |  | 	left: 50%; | 
					
						
							|  |  |  | 	height: 50px; | 
					
						
							|  |  |  | 	width: 100px; | 
					
						
							|  |  |  | 	margin-left: -50px; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	overflow: hidden; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	cursor: hand; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | .up-indicator:after, | 
					
						
							|  |  |  | .down-indicator:after { | 
					
						
							|  |  |  | 	display: inline-block; | 
					
						
							|  |  |  | 	position: absolute; | 
					
						
							|  |  |  | 	content: ""; | 
					
						
							|  |  |  | 	width: 50px; | 
					
						
							|  |  |  | 	height: 50px; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	bottom: -25px; | 
					
						
							|  |  |  | 	left: 25px; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-30 01:30:02 +04:00
										 |  |  | 	background: yellow; | 
					
						
							| 
									
										
										
										
											2013-04-30 00:54:32 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	-webkit-transform: rotate(45deg); | 
					
						
							|  |  |  | 	-moz-transform: rotate(45deg); | 
					
						
							|  |  |  | 	-o-transform: rotate(45deg); | 
					
						
							|  |  |  | 	-ms-transform: rotate(45deg); | 
					
						
							|  |  |  | 	transform: rotate(45deg); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | .down-indicator { | 
					
						
							|  |  |  | 	top: auto; | 
					
						
							|  |  |  | 	bottom: 0px; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | .down-indicator:after { | 
					
						
							|  |  |  | 	top: -25px; | 
					
						
							|  |  |  | 	bottom: auto; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | /* default state */ | 
					
						
							|  |  |  | .up-indicator, | 
					
						
							|  |  |  | .down-indicator { | 
					
						
							|  |  |  | 	display: none | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-26 05:30:56 +04:00
										 |  |  | </style> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <script src="jquery.js"></script> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-26 23:07:07 +04:00
										 |  |  | <script src="lib/jli.js"></script> | 
					
						
							|  |  |  | <script src="lib/keyboard.js"></script> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-02 19:47:04 +04:00
										 |  |  | <script src="ImageGrid.js"></script> | 
					
						
							| 
									
										
										
										
											2013-05-03 01:29:43 +04:00
										 |  |  | <script src="keybindings3.js"></script> | 
					
						
							| 
									
										
										
										
											2013-04-29 02:31:01 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-02 19:47:04 +04:00
										 |  |  | <script> | 
					
						
							| 
									
										
										
										
											2013-04-29 02:31:01 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-26 05:30:56 +04:00
										 |  |  | // setup... | 
					
						
							|  |  |  | $(function(){ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// populate the viewer... | 
					
						
							|  |  |  | 	var r = createRibbon() | 
					
						
							|  |  |  | 	var images = [] | 
					
						
							|  |  |  | 	for(var i=0; i < 40; i++){ | 
					
						
							|  |  |  | 		images.push(createImage().text(i)[0])  | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	r.append($(images)) | 
					
						
							| 
									
										
										
										
											2013-05-03 04:18:47 +04:00
										 |  |  | 	//var rr = r.clone() | 
					
						
							|  |  |  | 	//var rrr = r.clone() | 
					
						
							| 
									
										
										
										
											2013-04-26 05:30:56 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	$('.ribbon-set') | 
					
						
							|  |  |  | 		.append(r) | 
					
						
							| 
									
										
										
										
											2013-05-03 04:18:47 +04:00
										 |  |  | 		//.append(rr) | 
					
						
							|  |  |  | 		//.append(rrr) | 
					
						
							| 
									
										
										
										
											2013-04-26 05:30:56 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// NOTE: this is global so as to not to add any extra complexity to  | 
					
						
							|  |  |  | 	//		the internal workings... | 
					
						
							|  |  |  | 	$('.viewer').click(clickHandler) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-02 23:22:43 +04:00
										 |  |  | 	$(document) | 
					
						
							|  |  |  | 		.keydown(makeKeyboardHandler( | 
					
						
							|  |  |  | 			KEYBOARD_CONFIG, | 
					
						
							|  |  |  | 			function(k){console.log(k)})) | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// XXX stub... | 
					
						
							|  |  |  | 	centerImage(focusImage($('.image').first()), 'css') | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-26 05:30:56 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | </script> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | </head> | 
					
						
							|  |  |  | <body> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <!-- This is the basic viewer structure...
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Unpopulated | 
					
						
							|  |  |  | NOTE: there can be only .ribbon-set element. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <div class="viewer"> | 
					
						
							|  |  |  | 	<div class="ribbon-set"></div> | 
					
						
							|  |  |  | </div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Populated | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <div class="viewer"> | 
					
						
							|  |  |  | 	<div class="ribbon-set"> | 
					
						
							|  |  |  | 		<div class="ribbon"> | 
					
						
							|  |  |  | 			<div class="image"></div> | 
					
						
							|  |  |  | 			<div class="image"></div> | 
					
						
							|  |  |  | 		</div> | 
					
						
							|  |  |  | 		<div class="ribbon"> | 
					
						
							|  |  |  | 			<div class="image"></div> | 
					
						
							|  |  |  | 			<div class="current image"></div> | 
					
						
							|  |  |  | 			<div class="image"></div> | 
					
						
							|  |  |  | 			<div class="image"></div> | 
					
						
							|  |  |  | 		</div> | 
					
						
							|  |  |  | 	</div> | 
					
						
							|  |  |  | </div> | 
					
						
							|  |  |  | --> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <div class="viewer"> | 
					
						
							| 
									
										
										
										
											2013-04-30 00:54:32 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-26 05:30:56 +04:00
										 |  |  | 	<div class="ribbon-set"></div> | 
					
						
							| 
									
										
										
										
											2013-04-30 00:54:32 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-30 01:34:26 +04:00
										 |  |  | 	<!-- XXX should these be here??? --> | 
					
						
							| 
									
										
										
										
											2013-04-30 00:54:32 +04:00
										 |  |  | 	<div class="up-indicator"></div> | 
					
						
							|  |  |  | 	<div class="down-indicator"></div> | 
					
						
							| 
									
										
										
										
											2013-04-26 05:30:56 +04:00
										 |  |  | </div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <!-- vim:set ts=4 sw=4 spell : --> | 
					
						
							|  |  |  | </body> | 
					
						
							|  |  |  | </html> |