| 
									
										
										
										
											2012-08-05 22:53:38 +04:00
										 |  |  | <html> | 
					
						
							|  |  |  | <head> | 
					
						
							| 
									
										
										
										
											2012-08-11 03:24:28 +04:00
										 |  |  | <link rel="stylesheet" href="transitions.css"> | 
					
						
							| 
									
										
										
										
											2012-08-05 22:53:38 +04:00
										 |  |  | <link rel="stylesheet" href="gallery.css"> | 
					
						
							| 
									
										
										
										
											2012-08-11 03:24:28 +04:00
										 |  |  | <!-- this must come after the transitions.css to work correctly --> | 
					
						
							| 
									
										
										
										
											2012-08-05 22:53:38 +04:00
										 |  |  | <link rel="stylesheet" href="single-image-mode.css"> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <link rel="stylesheet" href="markers.css"> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <style> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | body { | 
					
						
							|  |  |  | 	margin: 0; | 
					
						
							|  |  |  | 	padding: 0; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | .viewer { | 
					
						
							|  |  |  | 	position: absolute; | 
					
						
							|  |  |  | 	top: 0px; | 
					
						
							|  |  |  | 	left: 0px; | 
					
						
							|  |  |  | 	width: 100%; | 
					
						
							|  |  |  | 	height: 100%; | 
					
						
							|  |  |  | 	margin: 0px; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | </style> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <script src="jquery.js"></script> | 
					
						
							|  |  |  | <script src="jquery-ui-1.8.22.custom.min.js"></script> | 
					
						
							| 
									
										
										
										
											2012-08-28 02:45:32 +04:00
										 |  |  | <script src="jstorage.js"></script> | 
					
						
							| 
									
										
										
										
											2012-08-05 22:53:38 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | <script src="jquery.touchSwipe.js"></script> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <!-- XXX STUB --> | 
					
						
							|  |  |  | <script src="images.js"></script> | 
					
						
							|  |  |  | <script src="gallery-prototype.js"></script> | 
					
						
							|  |  |  | <script src="ui.js"></script> | 
					
						
							| 
									
										
										
										
											2012-08-31 03:11:19 +04:00
										 |  |  | <script src="persistance.js"></script> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-08-05 22:53:38 +04:00
										 |  |  | <script src="markers.js"></script> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-08-08 23:19:40 +04:00
										 |  |  | <!-- keep this after anything it uses --> | 
					
						
							|  |  |  | <script src="keybindings.js"></script> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-08-05 22:53:38 +04:00
										 |  |  | <!--script src="gallery.js"></script--> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <script> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-08-25 03:16:44 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-08-25 01:58:27 +04:00
										 |  |  | // XXX stub DnD handlers... | 
					
						
							|  |  |  | $(document) | 
					
						
							|  |  |  | 	.bind('dragover', function(e){ | 
					
						
							|  |  |  | 		e.stopPropagation() | 
					
						
							|  |  |  | 		e.preventDefault() | 
					
						
							|  |  |  | 		// XXX is there a jQuery way out of this?? | 
					
						
							|  |  |  | 		e.originalEvent.dataTransfer.dropEffect = 'copy' // Explicitly show this is a copy. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-08-25 03:16:44 +04:00
										 |  |  | 		overlayMessage('Drop files anywhere on the the screen...') | 
					
						
							| 
									
										
										
										
											2012-08-25 01:58:27 +04:00
										 |  |  | 	}) | 
					
						
							|  |  |  | 	.bind('drop', function(e){ | 
					
						
							|  |  |  | 		e.stopPropagation() | 
					
						
							|  |  |  | 		e.preventDefault() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		// XXX is there a jQuery way out of this?? | 
					
						
							|  |  |  | 		var files = e.originalEvent.dataTransfer.files | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		// XXX should we be using the loadJSON here??? | 
					
						
							|  |  |  | 		// XXX desperatly need image caching and preview generation... | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		$('.field').children('.ribbon').remove() | 
					
						
							|  |  |  | 		var ribbon = $('<div class="ribbon"></div>') | 
					
						
							|  |  |  | 			.appendTo($('.field')) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		for (var i = 0, f; f = files[i]; i++) { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			if (!f.type.match('image.*')) { | 
					
						
							|  |  |  | 				continue | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			var reader = new FileReader() | 
					
						
							|  |  |  | 			reader.onload = function(i, ribbon){ | 
					
						
							|  |  |  | 				return function(e){ | 
					
						
							|  |  |  | 					// XXX need to avoid data URLs here and use plain old paths... | 
					
						
							|  |  |  | 					ribbon.append(makeImage(e.target.result, i)) | 
					
						
							| 
									
										
										
										
											2012-08-25 03:25:30 +04:00
										 |  |  | 					$('.image').first().click() | 
					
						
							| 
									
										
										
										
											2012-09-04 03:50:16 +04:00
										 |  |  | 					// XXX really UGLY and bad... | 
					
						
							|  |  |  | 					ImageGrid.image_data = buildJSON() | 
					
						
							| 
									
										
										
										
											2012-08-25 01:58:27 +04:00
										 |  |  | 				} | 
					
						
							|  |  |  | 			}(i, ribbon) | 
					
						
							|  |  |  | 			reader.readAsDataURL(f) | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		$('.image').first().click() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		$('.overlay').click() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	}) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-08-05 22:53:38 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | function setup(){ | 
					
						
							|  |  |  | 	// XXX load state... | 
					
						
							|  |  |  | 	// initial state (default)... | 
					
						
							|  |  |  | 	setDefaultInitialState() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// XXX | 
					
						
							| 
									
										
										
										
											2012-08-14 23:40:26 +04:00
										 |  |  | 	ImageGrid.toggleSingleImageMode('off') | 
					
						
							| 
									
										
										
										
											2012-08-15 04:03:11 +04:00
										 |  |  | 	ImageGrid.toggleTransitions('on') | 
					
						
							| 
									
										
										
										
											2012-08-05 22:53:38 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// setup event handlers... | 
					
						
							| 
									
										
										
										
											2012-08-06 16:24:20 +04:00
										 |  |  | 	setupEvents() | 
					
						
							| 
									
										
										
										
											2012-08-05 22:53:38 +04:00
										 |  |  | 	setupControlElements() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// XXX | 
					
						
							|  |  |  | 	//fieldSize(800, 500) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// load images... | 
					
						
							|  |  |  | 	// XXX not allowed... | 
					
						
							|  |  |  | 	//$.getJSON('images.js', loadImages}) | 
					
						
							| 
									
										
										
										
											2012-08-29 19:14:57 +04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-08-30 04:26:59 +04:00
										 |  |  | 	ImageGrid.load(null, image_list) | 
					
						
							| 
									
										
										
										
											2012-08-05 22:53:38 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// set the default position and init... | 
					
						
							|  |  |  | 	$('.current.image').click() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// XXX get the timing right | 
					
						
							|  |  |  | 	// XXX fire this when all is done, via an event... | 
					
						
							| 
									
										
										
										
											2012-08-17 22:23:48 +04:00
										 |  |  | 	$('.splash').delay(500).fadeOut(700) | 
					
						
							| 
									
										
										
										
											2012-08-05 22:53:38 +04:00
										 |  |  | } | 
					
						
							|  |  |  | $(document).ready(setup); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | </script> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <style> | 
					
						
							|  |  |  | </style> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | </head> | 
					
						
							| 
									
										
										
										
											2012-08-05 22:56:14 +04:00
										 |  |  | <body> | 
					
						
							| 
									
										
										
										
											2012-08-05 22:53:38 +04:00
										 |  |  | <div class="viewer no-single-image-transitions"> | 
					
						
							| 
									
										
										
										
											2012-08-22 19:39:20 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	<!-- Splash screen --> | 
					
						
							| 
									
										
										
										
											2012-08-17 22:23:48 +04:00
										 |  |  | 	<div class="splash"> | 
					
						
							| 
									
										
										
										
											2012-08-05 22:53:38 +04:00
										 |  |  | 		<!-- XXX replace this with a background-image logo... --> | 
					
						
							|  |  |  | 		<table width="100%" height="100%"><tr><td align="center" valign="middle"> | 
					
						
							|  |  |  | 			<big><b>ImageGrid</b></big><br> | 
					
						
							|  |  |  | 			<small><i>loading...</i></small> | 
					
						
							|  |  |  | 		</td></tr></table> | 
					
						
							|  |  |  | 	</div> | 
					
						
							| 
									
										
										
										
											2012-08-22 19:39:20 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	<!-- overlay --> | 
					
						
							| 
									
										
										
										
											2012-08-17 22:23:48 +04:00
										 |  |  | 	<div class="overlay"> | 
					
						
							|  |  |  | 		<div class="background"> | 
					
						
							|  |  |  | 		</div> | 
					
						
							|  |  |  | 		<div class="content"> | 
					
						
							|  |  |  | 		</div> | 
					
						
							|  |  |  | 	</div> | 
					
						
							| 
									
										
										
										
											2012-08-22 19:39:20 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	<!-- button bars --> | 
					
						
							| 
									
										
										
										
											2012-08-05 22:53:38 +04:00
										 |  |  | 	<div class="controller-mini left"> | 
					
						
							|  |  |  | 		<div class="screen-button show-controls">*</div> | 
					
						
							|  |  |  | 		<div class="screen-button"></div> | 
					
						
							|  |  |  | 	</div> | 
					
						
							|  |  |  | 	<div class="controller left"> | 
					
						
							|  |  |  | 		<div class="screen-button demote">^</div> | 
					
						
							|  |  |  | 		<div class="screen-button prev-image"><</div> | 
					
						
							|  |  |  | 		<div class="screen-button promote">v</div> | 
					
						
							|  |  |  | 		<div class="screen-button toggle-single">[ ]</div> | 
					
						
							|  |  |  | 		<div class="screen-button fit-three">ooo</div> | 
					
						
							|  |  |  | 		<div class="screen-button settings">?</div> | 
					
						
							|  |  |  | 	</div> | 
					
						
							| 
									
										
										
										
											2012-08-22 19:39:20 +04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	<!-- image container --> | 
					
						
							| 
									
										
										
										
											2012-08-05 22:53:38 +04:00
										 |  |  | 	<div class="container"> | 
					
						
							|  |  |  | 		<div class="field"> | 
					
						
							| 
									
										
										
										
											2012-08-22 19:39:20 +04:00
										 |  |  | 			<div class="current-indicator"> | 
					
						
							|  |  |  | 				<div></div> | 
					
						
							|  |  |  | 			</div> | 
					
						
							| 
									
										
										
										
											2012-08-05 22:53:38 +04:00
										 |  |  | 			<div class="ribbon"> | 
					
						
							|  |  |  | 			</div> | 
					
						
							|  |  |  | 		</div> | 
					
						
							|  |  |  | 		<div class="h-marker"></div> | 
					
						
							|  |  |  | 		<div class="v-marker"></div> | 
					
						
							|  |  |  | 	</div> | 
					
						
							|  |  |  | 	<div class="controller-mini right"> | 
					
						
							|  |  |  | 		<div class="screen-button settings">?</div> | 
					
						
							|  |  |  | 		<div class="screen-button"></div> | 
					
						
							|  |  |  | 	</div> | 
					
						
							|  |  |  | 	<div class="controller right"> | 
					
						
							|  |  |  | 		<div class="screen-button demote">^</div> | 
					
						
							|  |  |  | 		<div class="screen-button next-image">></div> | 
					
						
							|  |  |  | 		<div class="screen-button promote">v</div> | 
					
						
							|  |  |  | 		<div class="screen-button zoom-in">+</div> | 
					
						
							|  |  |  | 		<div class="screen-button zoom-out">-</div> | 
					
						
							|  |  |  | 		<div class="screen-button toggle-wide">...</div> | 
					
						
							|  |  |  | 	</div> | 
					
						
							|  |  |  | </div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | </body> | 
					
						
							|  |  |  | </html> | 
					
						
							|  |  |  | <!-- vim:set ts=4 sw=4 nowrap : --> |