| 
									
										
										
										
											2016-05-17 17:42:25 +03:00
										 |  |  | <!DOCTYPE html> | 
					
						
							|  |  |  | <html> | 
					
						
							| 
									
										
										
										
											2017-01-03 02:55:25 +03:00
										 |  |  | <!--
 | 
					
						
							|  |  |  | //--------------------------------------------------------------------- | 
					
						
							|  |  |  | // Experiment: use native scroll for ribbons and view... | 
					
						
							|  |  |  | // 	Factors: | 
					
						
							|  |  |  | // 		+ the browser will do all the heavy lifting and do it faster  | 
					
						
							|  |  |  | // 			than we can ever hope to do it in JS (assumption) | 
					
						
							|  |  |  | // 		- will require us to add an extra container per ribbon  | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | // 	Experiment result: | 
					
						
							|  |  |  | // 		- more uniform and fast across browsers  | 
					
						
							|  |  |  | // 			(except FF - can't disable scrollbars, need to cheat) | 
					
						
							|  |  |  | // 		- less controllable (inertia, gestures, ...) | 
					
						
							|  |  |  | // 		- is affected by scaling in a bad way - paralax... | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | // 	Conclusion: | 
					
						
							|  |  |  | // 		- this again brings us to using code to control the scroll | 
					
						
							|  |  |  | // 		  which in turn defeats the original purpose of avoiding | 
					
						
							|  |  |  | // 		  extra complexity... | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | // 	See:  | 
					
						
							|  |  |  | // 		experiments/native-scroll-ribbon.html | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | --> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-17 17:42:25 +03:00
										 |  |  | <style> | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | .mark-center:after { | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | 	position: absolute; | 
					
						
							|  |  |  | 	display: block; | 
					
						
							|  |  |  | 	content: ""; | 
					
						
							|  |  |  | 	width: 5px; | 
					
						
							|  |  |  | 	height: 5px; | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | 	left: 50%; | 
					
						
							|  |  |  | 	top: 50%; | 
					
						
							|  |  |  | 	border-left: solid 2px red; | 
					
						
							|  |  |  | 	border-top: solid 2px red; | 
					
						
							|  |  |  | 	margin-left: -1px; | 
					
						
							|  |  |  | 	margin-top: -1px; | 
					
						
							|  |  |  | 	opacity: 0.8; | 
					
						
							| 
									
										
										
										
											2016-05-19 22:54:56 +03:00
										 |  |  | 	z-index: 1; | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | .mark-center:before { | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | 	position: absolute; | 
					
						
							|  |  |  | 	display: block; | 
					
						
							|  |  |  | 	content: ""; | 
					
						
							|  |  |  | 	width: 5px; | 
					
						
							|  |  |  | 	height: 5px; | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | 	right: 50%; | 
					
						
							|  |  |  | 	bottom: 50%; | 
					
						
							|  |  |  | 	border-bottom: solid 2px red; | 
					
						
							|  |  |  | 	border-right: solid 2px red; | 
					
						
							|  |  |  | 	margin-bottom: -1px; | 
					
						
							|  |  |  | 	margin-right: -1px; | 
					
						
							|  |  |  | 	opacity: 0.8; | 
					
						
							| 
									
										
										
										
											2016-05-19 22:54:56 +03:00
										 |  |  | 	z-index: 1; | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-17 18:24:00 +03:00
										 |  |  | /* XXX appears that there is no way to hide the scrollbar on FF... | 
					
						
							|  |  |  | *	...one way around this is to use something like iScroll/Scrolly | 
					
						
							|  |  |  | *	on FF or where more control is needed... | 
					
						
							|  |  |  | */ | 
					
						
							| 
									
										
										
										
											2016-05-17 17:42:25 +03:00
										 |  |  | .viewer { | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | 	position: relative; | 
					
						
							| 
									
										
										
										
											2016-05-17 17:42:25 +03:00
										 |  |  | 	display: inline-block; | 
					
						
							|  |  |  | 	border: solid 1px gray; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-17 18:24:00 +03:00
										 |  |  | 	width: 600px; | 
					
						
							|  |  |  | 	height: 500px; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	overflow: hidden; | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | .scaler { | 
					
						
							|  |  |  | 	position: relative; | 
					
						
							|  |  |  | 	width: 100%; | 
					
						
							|  |  |  | 	height: 100%; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	top: 50%; | 
					
						
							|  |  |  | 	left: 50%; | 
					
						
							|  |  |  | 	margin-top: -50%; | 
					
						
							|  |  |  | 	margin-left: -50%; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	transform-origin: 50% 50%; | 
					
						
							| 
									
										
										
										
											2016-05-17 18:24:00 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	overflow-x: hidden; | 
					
						
							|  |  |  | 	overflow-y: scroll; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	-ms-overflow-style: none; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | .scaler::-webkit-scrollbar {  | 
					
						
							| 
									
										
										
										
											2016-05-17 18:24:00 +03:00
										 |  |  |     display: none;  | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-17 18:24:00 +03:00
										 |  |  | /* This is to be used for: | 
					
						
							|  |  |  | *	- vrtical positioning | 
					
						
							|  |  |  | *	- scaling | 
					
						
							|  |  |  | *	  (update width to fit viewer) | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | .ribbon-set { | 
					
						
							| 
									
										
										
										
											2016-05-18 01:31:19 +03:00
										 |  |  | 	position: relative; | 
					
						
							| 
									
										
										
										
											2016-05-17 18:24:00 +03:00
										 |  |  | 	display: inline-block; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* This allways needs to be of viewer width, this mostly applies | 
					
						
							|  |  |  | 	* to scaling... | 
					
						
							|  |  |  | 	*/ | 
					
						
							|  |  |  | 	width: 100%; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	padding-top: 50%; | 
					
						
							|  |  |  | 	padding-bottom: 50%; | 
					
						
							| 
									
										
										
										
											2016-05-17 17:42:25 +03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-17 18:24:00 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-17 17:42:25 +03:00
										 |  |  | .ribbon-container { | 
					
						
							|  |  |  | 	position: relative; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	height: 120px; | 
					
						
							| 
									
										
										
										
											2016-05-17 18:24:00 +03:00
										 |  |  | 	width: 100%; | 
					
						
							| 
									
										
										
										
											2016-05-17 17:42:25 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	overflow-x: scroll; | 
					
						
							|  |  |  | 	overflow-y: hidden; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	-ms-overflow-style: none; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | .ribbon-container::-webkit-scrollbar {  | 
					
						
							|  |  |  |     display: none;  | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-17 18:24:00 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-17 17:42:25 +03:00
										 |  |  | .ribbon { | 
					
						
							|  |  |  | 	position: relative; | 
					
						
							|  |  |  | 	display: inline-block; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	height: 100px; | 
					
						
							|  |  |  | 	width: 1000px; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	background: silver; | 
					
						
							|  |  |  | 	/*box-shadow: 0px 0px 25px -10px rgba(0,0,0,0.75);*/ | 
					
						
							|  |  |  | 	box-shadow: 0px 0px 25px -10px rgba(0,0,0,1); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* start/end markers... */ | 
					
						
							|  |  |  | 	border-left: 100px solid gray; | 
					
						
							|  |  |  | 	border-right: 100px solid gray; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	margin: 10px; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	margin-left: 50%; | 
					
						
							|  |  |  | 	/* XXX for some reason this does not work as expected */ | 
					
						
							|  |  |  | 	margin-right: 50%; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-17 17:42:25 +03:00
										 |  |  | </style> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <script src="../ext-lib/jquery.js"></script> | 
					
						
							|  |  |  | <script src="../ext-lib/jquery-ui.js"></script> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-18 01:31:19 +03:00
										 |  |  | <script src="../ext-lib/velocity.min.js"></script> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | <script src="../ext-lib/iscroll.js"></script> | 
					
						
							|  |  |  | <script src="../ext-lib/iscroll-zoom.js"></script> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-17 17:42:25 +03:00
										 |  |  | <script src="../lib/jli.js"></script> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <script> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | var scale = function(){ | 
					
						
							|  |  |  | 	var s = /scale\(([^\)]+)\)/.exec($('.scaler')[0].style.transform) | 
					
						
							|  |  |  | 	return s ? parseFloat(s.pop()) : 1 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | // XXX when setting origin at scales different from 1, we'll need to  | 
					
						
							|  |  |  | //	adjust offset to compensate for the shift...  | 
					
						
							|  |  |  | // XXX one other simplification might be adding a new element specifically | 
					
						
							|  |  |  | //	dedicated to scaling... | 
					
						
							|  |  |  | var centerOrigin = function(){ | 
					
						
							|  |  |  | 	var H = $('.viewer').height() | 
					
						
							|  |  |  | 	var s = $('.viewer')[0].scrollTop | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	$('.ribbon-set').css({ | 
					
						
							|  |  |  | 		'transform-origin': '50% '+ (s + H/2) +'px' | 
					
						
							|  |  |  | 	}) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-18 01:31:19 +03:00
										 |  |  | // XXX these accumolate errors... | 
					
						
							|  |  |  | var zoomIn = function(c){ | 
					
						
							|  |  |  | 	c = c || 1.2 | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	centerOrigin() | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | 	$('.scaler') | 
					
						
							| 
									
										
										
										
											2016-05-18 01:31:19 +03:00
										 |  |  | 		.velocity('stop') | 
					
						
							|  |  |  | 		.velocity({ | 
					
						
							|  |  |  | 			scale: '*='+c, | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-18 01:31:19 +03:00
										 |  |  | 			width: '/='+c, | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | 			height: '/='+c, | 
					
						
							| 
									
										
										
										
											2016-05-18 01:31:19 +03:00
										 |  |  | 			'margin-left': '/='+c, | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | 			'margin-top': '/='+c, | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | 		}, { | 
					
						
							|  |  |  | 			duration: 300, | 
					
						
							|  |  |  | 			easing: 'linear', | 
					
						
							|  |  |  | 		}) | 
					
						
							| 
									
										
										
										
											2016-05-18 01:31:19 +03:00
										 |  |  | } | 
					
						
							|  |  |  | var zoomOut = function(c){ | 
					
						
							|  |  |  | 	c = c || 1.2 | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	centerOrigin() | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | 	$('.scaler') | 
					
						
							| 
									
										
										
										
											2016-05-18 01:31:19 +03:00
										 |  |  | 		.velocity('stop') | 
					
						
							|  |  |  | 		.velocity({ | 
					
						
							|  |  |  | 			scale: '/='+c, | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-18 01:31:19 +03:00
										 |  |  | 			width: '*='+c, | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | 			height: '*='+c, | 
					
						
							| 
									
										
										
										
											2016-05-18 01:31:19 +03:00
										 |  |  | 			'margin-left': '*='+c, | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | 			'margin-top': '*='+c, | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | 		}, { | 
					
						
							|  |  |  | 			duration: 300, | 
					
						
							|  |  |  | 			easing: 'linear', | 
					
						
							|  |  |  | 		}) | 
					
						
							| 
									
										
										
										
											2016-05-18 01:31:19 +03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | var setup = function(){ | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | 	var H = $('.viewer').height() | 
					
						
							|  |  |  | 	var W = $('.viewer').width() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// set margins to be parant and not content dependant... | 
					
						
							|  |  |  | 	$('.scaler') | 
					
						
							|  |  |  | 		.velocity({ | 
					
						
							|  |  |  | 			'margin-left': -W/2, | 
					
						
							|  |  |  | 			'margin-top': -H/2, | 
					
						
							|  |  |  | 		}, 0) | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-20 03:16:07 +03:00
										 |  |  | var ISCROLL = false | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | $(function(){ | 
					
						
							|  |  |  | 	setup() | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-19 23:52:29 +03:00
										 |  |  | // setup iScroll... | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | if(ISCROLL){ | 
					
						
							| 
									
										
										
										
											2016-05-19 23:52:29 +03:00
										 |  |  | 	// Vertical scroll and zoom... | 
					
						
							| 
									
										
										
										
											2016-05-19 22:54:56 +03:00
										 |  |  | 	$('.scaler') | 
					
						
							|  |  |  | 		.css({ | 
					
						
							|  |  |  | 			overflow: 'hidden', | 
					
						
							|  |  |  | 		}) | 
					
						
							|  |  |  | 	window.scroll_view = new IScroll('.scaler', { | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | 		// XXX setting this to false makes zoom reset x to 0 after it's done... | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | 		scrollX: false, | 
					
						
							|  |  |  | 		scrollY: true, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		disableMouse: false, | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | 		mouseWheel: true, | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		eventPassthrough: 'horizontal', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		zoom: true, | 
					
						
							|  |  |  | 	}) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-19 23:52:29 +03:00
										 |  |  | 	var t | 
					
						
							|  |  |  | 	$('.scaler').on('touchend mouseup', function(){ | 
					
						
							| 
									
										
										
										
											2016-05-20 03:16:07 +03:00
										 |  |  | 		//t = $('.ribbon-set')[0].style.transform | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		t = $('.ribbon-set').offset().left | 
					
						
							| 
									
										
										
										
											2016-05-19 23:52:29 +03:00
										 |  |  | 	}) | 
					
						
							|  |  |  | 	scroll_view.on('zoomEnd', function(){ | 
					
						
							|  |  |  | 		var v = $('.viewer') | 
					
						
							| 
									
										
										
										
											2016-05-19 22:54:56 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-19 23:52:29 +03:00
										 |  |  | 		var s = scroll_view.scale | 
					
						
							|  |  |  | 		var W = v.width() | 
					
						
							|  |  |  | 		var H = v.width() | 
					
						
							| 
									
										
										
										
											2016-05-19 22:54:56 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-20 03:16:07 +03:00
										 |  |  | 		var w = W/s | 
					
						
							|  |  |  | 		var h = H/s | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		var e = $('.ribbon-set') | 
					
						
							| 
									
										
										
										
											2016-05-19 22:54:56 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-19 23:52:29 +03:00
										 |  |  | 		// XXX compensate for offset -- scroll ribbons by to  | 
					
						
							|  |  |  | 		//	place them where they where under user's fingers... | 
					
						
							| 
									
										
										
										
											2016-05-20 03:16:07 +03:00
										 |  |  | 		// XXX this does not work... | 
					
						
							|  |  |  | 		/* | 
					
						
							|  |  |  | 		var d = (e.offset().left - t) * s | 
					
						
							|  |  |  | 		$('.ribbon').each(function(_, r){ | 
					
						
							|  |  |  | 			$(r).velocity({ | 
					
						
							|  |  |  | 				transformX: '+='+d, | 
					
						
							|  |  |  | 			}, 0) | 
					
						
							| 
									
										
										
										
											2016-05-19 22:54:56 +03:00
										 |  |  | 		}) | 
					
						
							| 
									
										
										
										
											2016-05-20 03:16:07 +03:00
										 |  |  | 		*/ | 
					
						
							| 
									
										
										
										
											2016-05-19 22:54:56 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-20 03:16:07 +03:00
										 |  |  | 		e = e[0] | 
					
						
							|  |  |  | 		e.style.width = w + 'px' | 
					
						
							|  |  |  | 		e.style.height = h + 'px' | 
					
						
							| 
									
										
										
										
											2016-05-19 23:52:29 +03:00
										 |  |  | 	}) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Ribbon scroll... | 
					
						
							|  |  |  | 	// | 
					
						
							|  |  |  | 	// Problems: | 
					
						
							|  |  |  | 	//	- iScroll does not account for margins when aclculating  | 
					
						
							|  |  |  | 	//	  scroll width, need to patch this on .update(..)... | 
					
						
							|  |  |  | 	//	- can't scroll ribbons independently | 
					
						
							|  |  |  | 	//		- two fingers will trigger zoom | 
					
						
							|  |  |  | 	//		- for some reason if touching two ribbons while | 
					
						
							|  |  |  | 	//		  zooming they will move in the same direction... | 
					
						
							| 
									
										
										
										
											2016-05-20 03:16:07 +03:00
										 |  |  | 	//	- scrolling a ribbon does not account for scale... | 
					
						
							|  |  |  | 	//	  ...the same problem exists for native scroll... | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | 	window.scroll_ribbon = [] | 
					
						
							|  |  |  | 	$('.ribbon-container')//.eq(0) | 
					
						
							|  |  |  | 		.css({ | 
					
						
							|  |  |  | 			overflow: 'hidden', | 
					
						
							|  |  |  | 		}) | 
					
						
							|  |  |  | 		.each(function(_, e){ | 
					
						
							|  |  |  | 			console.log(e) | 
					
						
							|  |  |  | 			// XXX this calculates the scroll width incorrectly... | 
					
						
							|  |  |  | 			scroll_ribbon.push(new IScroll(e, { | 
					
						
							|  |  |  | 				scrollX: true, | 
					
						
							|  |  |  | 				scrollY: false, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 				disableMouse: false, | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | 				// XXX this only reads vertical mousewheel... | 
					
						
							|  |  |  | 				//	...need this to work in a horizontal direction... | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | 				//mouseWheel: true, | 
					
						
							|  |  |  | 			})) | 
					
						
							|  |  |  | 		}) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-17 17:42:25 +03:00
										 |  |  | </script> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <body> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-19 13:59:52 +03:00
										 |  |  | <div class="viewer mark-center"> | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | 	<div class="scaler"> | 
					
						
							|  |  |  | 		<div class="ribbon-set"> | 
					
						
							|  |  |  | 			<div class="ribbon-container"> | 
					
						
							|  |  |  | 				<div class="ribbon"> | 
					
						
							|  |  |  | 				</div> | 
					
						
							| 
									
										
										
										
											2016-05-17 17:42:25 +03:00
										 |  |  | 			</div> | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | 			<div class="ribbon-container"> | 
					
						
							|  |  |  | 				<div class="ribbon"> | 
					
						
							|  |  |  | 				</div> | 
					
						
							| 
									
										
										
										
											2016-05-17 17:42:25 +03:00
										 |  |  | 			</div> | 
					
						
							| 
									
										
										
										
											2016-05-18 20:23:31 +03:00
										 |  |  | 			<div class="ribbon-container"> | 
					
						
							|  |  |  | 				<div class="ribbon"> | 
					
						
							|  |  |  | 				</div> | 
					
						
							| 
									
										
										
										
											2016-05-17 17:42:25 +03:00
										 |  |  | 			</div> | 
					
						
							|  |  |  | 		</div> | 
					
						
							|  |  |  | 	</div> | 
					
						
							|  |  |  | </div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | </body> | 
					
						
							|  |  |  | </html> |