public/js/pipe.js
function wireUsePhotoHandlers(){
    
    $usePhoto.bind('click submit', function(e){
       
      if(e.target.id === 'facebook-use-photo'){
        
        // We don't want to show the facebook option, because
        // it is the source of the image.
        $facebookDestination.hide()

        _photoToUse = localStorage.imageToPipe || $('.one-up:visible').find('img')[0].src
        
        closeOneUp()
        
        $stepFourDestinationWrapper.show()

        progressToNextStep($stepThree, function(){

          $stepFour.slideDown(333)

        })

      }

      if(e.target.id === 'twitter-use-photo'){
        
        // We don't want to show the facebook option, because
        // it is the source of the image.
        $twitterDestination.hide()
        
        _photoToUse = localStorage.imageToPipe || $('.one-up:visible').find('img')[0].src
                
        closeOneUp()

        $stepThreeDestinationWrapper.show()
        
        progressToNextStep($stepTwo, function(){

          $stepThree.slideDown(333)

        })

      }


      if(e.target.id === 'url-use-photo'){
        
        _photoToUse = $photoFromUrl.val() || localStorage.imageToPipe
        
        $stepThreeDestinationWrapper.show()
        
        progressToNextStep($stepTwo, function(){

          $stepThree.slideDown(333)

        })

      }
      
      localStorage.imageToPipe = _photoToUse

      console.log(_photoToUse)
      console.log(localStorage.imageToPipe)
      return false

    }) // end bind()
    
  }
function wireUsePhotoHandlers(){
    
    $usePhoto.bind('click submit', function(e){
       
      if(e.target.id === 'facebook-use-photo'){
        
        // We don't want to show the facebook option, because
        // it is the source of the image.
        $facebookDestination.hide()

        _photoToUse = localStorage.imageToPipe || $('.one-up:visible').find('img')[0].src
        
        closeOneUp()
        
        $stepFourDestinationWrapper.show()

        progressToNextStep($stepThree, function(){

          $stepFour.slideDown(333)

        })

      }

      if(e.target.id === 'twitter-use-photo'){
        
        // We don't want to show the facebook option, because
        // it is the source of the image.
        $twitterDestination.hide()
        
        _photoToUse = localStorage.imageToPipe || $('.one-up:visible').find('img')[0].src
                
        closeOneUp()

        $stepThreeDestinationWrapper.show()
        
        progressToNextStep($stepTwo, function(){

          $stepThree.slideDown(333)

        })

      }


      if(e.target.id === 'url-use-photo'){
        
        _photoToUse = $photoFromUrl.val() || localStorage.imageToPipe
        
        $stepThreeDestinationWrapper.show()
        
        progressToNextStep($stepTwo, function(){

          $stepThree.slideDown(333)

        })

      }
      
      localStorage.imageToPipe = _photoToUse

      console.log(_photoToUse)
      console.log(localStorage.imageToPipe)
      return false

    }) // end bind()
    
  }
function wireUsePhotoHandlers ( ) { $usePhoto . bind ( 'click submit' , function ( e ) { if ( e . target . id === 'facebook-use-photo' ) { // We don't want to show the facebook option, because // it is the source of the image. $facebookDestination . hide ( ) _photoToUse = localStorage . imageToPipe || $ ( '.one-up:visible' ) . find ( 'img' ) [ 0 ] . src closeOneUp ( ) $stepFourDestinationWrapper . show ( ) progressToNextStep ( $stepThree , function ( ) { $stepFour . slideDown ( 333 ) } ) } if ( e . target . id === 'twitter-use-photo' ) { // We don't want to show the facebook option, because // it is the source of the image. $twitterDestination . hide ( ) _photoToUse = localStorage . imageToPipe || $ ( '.one-up:visible' ) . find ( 'img' ) [ 0 ] . src closeOneUp ( ) $stepThreeDestinationWrapper . show ( ) progressToNextStep ( $stepTwo , function ( ) { $stepThree . slideDown ( 333 ) } ) } if ( e . target . id === 'url-use-photo' ) { _photoToUse = $photoFromUrl . val ( ) || localStorage . imageToPipe $stepThreeDestinationWrapper . show ( ) progressToNextStep ( $stepTwo , function ( ) { $stepThree . slideDown ( 333 ) } ) } localStorage . imageToPipe = _photoToUse console . log ( _photoToUse ) console . log ( localStorage . imageToPipe ) return false } ) // end bind() }
Bind up the click handlers for one-up view when a user selects the photo they want to pipe
Bind up the click handlers for one - up view when a user selects the photo they want to pipe