Plugin Directory

Changeset 845924


Ignore:
Timestamp:
01/26/2014 10:56:54 PM (12 years ago)
Author:
pattyland
Message:

Code Cleanup

Location:
witch/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • witch/trunk/leap.php

    r841436 r845924  
    22/**
    33 * @package WiTCh
    4  * @version 0.1.1
     4 * @version 0.1.2
    55 */
    66/*
     
    99Description: Wordpress moTion Controlling enables your visitors to use motion gestures to interact with your page.
    1010Author: pattyland
    11 Version: 0.1.1
     11Version: 0.1.2
    1212Author URI: http://pattyland.de/
    1313License: MIT
     
    2828    var leapopts = {enableGestures: true};
    2929    var swiped = false;
    30    
    3130    Leap.loop(leapopts, function(frame) {
    32    
    33       if (frame.gestures.length > 0) {
     31        if (frame.gestures.length > 0) {
    3432        for (var i = 0; i < frame.gestures.length; i++) {
    3533          var gesture = frame.gestures[i];
    36    
    37           if (gesture.type == "swipe" && swiped == false) {
     34          if (gesture.type === "swipe" && swiped === false) {
    3835              var h = Math.abs(gesture.direction[0]) > Math.abs(gesture.direction[1]);
    3936              if(h){
    4037                  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"; ?>
    4239                  } 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"; ?>
    4441                  }
    4542              }
    46               console.log(swipeDirection);
    47               swiped = true;
    48            }
     43             
     44           }       
    4945         }
    5046      }
    51    
    5247    });
    5348    </script><?php
     
    5752add_action( 'wp_footer', 'insert_script');
    5853
    59 
    6054?>
  • witch/trunk/readme.txt

    r841452 r845924  
    1212WordPress moTion Controlling enables your visitors to use motion gestures to interact with your page.
    1313
     14View a Demo [here](http://youtu.be/4Y-GLTlUgvQ)!
     15
    1416At the moment no options to configure.
     17
    1518
    1619= Features =
     
    2528
    2629== Changelog ==
     30= 0.1.2 =
     31Code Cleanup
    2732= 0.1.1 =
    2833Removed CDN for LeapJS
Note: See TracChangeset for help on using the changeset viewer.