ipad bugfixes
authorveltr
Fri, 22 Mar 2013 17:03:53 +0100
changeset 12 81a8bb1d872a
parent 11 9833f3e24105
child 13 3ba18138e37e
ipad bugfixes
js/playscreen.js
js/startscreen.js
playscreen.html
startscreen-frame.html
startscreen.html
--- a/js/playscreen.js	Thu Mar 21 18:48:12 2013 +0100
+++ b/js/playscreen.js	Fri Mar 22 17:03:53 2013 +0100
@@ -795,8 +795,19 @@
 	.on("touch", function(e) {
 		startLevel = currentlevel;
 	})
-	.on("pinchin", function(e) {
-		var newlevel = Math.max(0, Math.min(zoomlevels.length - 1, startLevel + Math.round(Math.log(e.gesture.scale)*scaleStep)));
+	.on("pinchin pinchout", function(e) {
+		var x = e.gesture.center.pageX - $(this).offset().left;
+		if (x > 380) {
+			return;
+		}
+		var newlevel = Math.max(
+			0,
+			Math.min(
+				zoomlevels.length - 1,
+				startLevel + Math.round(Math.log(e.gesture.scale)*scaleStep) * (x > 140 ? 1 : -1)
+			)
+		);
+		//$("#konsole").text(e.gesture.scale + " => " + newlevel);
 		if (newlevel !== currentlevel) {
 			currentlevel = newlevel;
 			localduration = zoomlevels[currentlevel];
--- a/js/startscreen.js	Thu Mar 21 18:48:12 2013 +0100
+++ b/js/startscreen.js	Fri Mar 22 17:03:53 2013 +0100
@@ -285,7 +285,7 @@
             }
         }
         
-        var url = "playscreen.html#visibletopics="
+        var hash = "#visibletopics="
         	+ Array.prototype.join.call($(".topic:visible").map(function(){return $(this).attr("data-topic-id")}))
         	+ "&selectedtopics="
         	+ Array.prototype.slice.call(topicsAndColors.map(function(t){return t.id}))
@@ -294,7 +294,7 @@
         		return encodeURIComponent(w);
         	}).join(",");
         	
-    	$(".play-button").attr("href",url);
+    	document.querySelector(".play-button").hash = hash;
         
     }
     
--- a/playscreen.html	Thu Mar 21 18:48:12 2013 +0100
+++ b/playscreen.html	Fri Mar 22 17:03:53 2013 +0100
@@ -54,6 +54,7 @@
                 	<div class="local-position"></div>
                 	<ul class="play-localtweets"></ul>
                 	<ul class="play-tagcloud"></ul>
+                	<div id="konsole" style="position: absolute; top: 280px; left: 730px; right: 0;"></div>
                 </div>
             </div>
     </body>
--- a/startscreen-frame.html	Thu Mar 21 18:48:12 2013 +0100
+++ b/startscreen-frame.html	Fri Mar 22 17:03:53 2013 +0100
@@ -29,7 +29,7 @@
                         <h1>Le débat</h1>
                     </div>
                     <div class="play-block shadow-block">
-                        <a class="play-button" href="#">&#9654;</a>
+                        <a class="play-button" href="playscreen-frame.html">&#9654;</a>
                         <div class="duration">0:00:00</div>
                     </div>
                     <div class="explain-block shadow-block">
--- a/startscreen.html	Thu Mar 21 18:48:12 2013 +0100
+++ b/startscreen.html	Fri Mar 22 17:03:53 2013 +0100
@@ -29,7 +29,7 @@
                         <h1>Le débat</h1>
                     </div>
                     <div class="play-block shadow-block">
-                        <a class="play-button" href="#">&#9654;</a>
+                        <a class="play-button" href="playscreen.html">&#9654;</a>
                         <div class="duration">0:00:00</div>
                     </div>
                     <div class="explain-block shadow-block">