Changeset 845924
- Timestamp:
- 01/26/2014 10:56:54 PM (12 years ago)
- Location:
- witch/trunk
- Files:
-
- 2 edited
-
leap.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
witch/trunk/leap.php
r841436 r845924 2 2 /** 3 3 * @package WiTCh 4 * @version 0.1. 14 * @version 0.1.2 5 5 */ 6 6 /* … … 9 9 Description: Wordpress moTion Controlling enables your visitors to use motion gestures to interact with your page. 10 10 Author: pattyland 11 Version: 0.1. 111 Version: 0.1.2 12 12 Author URI: http://pattyland.de/ 13 13 License: MIT … … 28 28 var leapopts = {enableGestures: true}; 29 29 var swiped = false; 30 31 30 Leap.loop(leapopts, function(frame) { 32 33 if (frame.gestures.length > 0) { 31 if (frame.gestures.length > 0) { 34 32 for (var i = 0; i < frame.gestures.length; i++) { 35 33 var gesture = frame.gestures[i]; 36 37 if (gesture.type == "swipe" && swiped == false) { 34 if (gesture.type === "swipe" && swiped === false) { 38 35 var h = Math.abs(gesture.direction[0]) > Math.abs(gesture.direction[1]); 39 36 if(h){ 40 37 if(gesture.direction[0] > 0){ 41 <?php if($prev_post) echo 'window.location.href = "'.get_permalink($prev_post->ID).'";' ; ?>38 <?php if($prev_post) echo 'window.location.href = "'.get_permalink($prev_post->ID).'";'."\n swiped = true; \n"; ?> 42 39 } else { 43 <?php if($next_post) echo 'window.location.href = "'.get_permalink($next_post->ID).'";' ; ?>40 <?php if($next_post) echo 'window.location.href = "'.get_permalink($next_post->ID).'";'."\n swiped = true; \n"; ?> 44 41 } 45 42 } 46 console.log(swipeDirection); 47 swiped = true; 48 } 43 44 } 49 45 } 50 46 } 51 52 47 }); 53 48 </script><?php … … 57 52 add_action( 'wp_footer', 'insert_script'); 58 53 59 60 54 ?> -
witch/trunk/readme.txt
r841452 r845924 12 12 WordPress moTion Controlling enables your visitors to use motion gestures to interact with your page. 13 13 14 View a Demo [here](http://youtu.be/4Y-GLTlUgvQ)! 15 14 16 At the moment no options to configure. 17 15 18 16 19 = Features = … … 25 28 26 29 == Changelog == 30 = 0.1.2 = 31 Code Cleanup 27 32 = 0.1.1 = 28 33 Removed CDN for LeapJS
Note: See TracChangeset
for help on using the changeset viewer.