- provide(:page_name, 'landing_page full landing_product product_jamblaster')
- provide(:description, 'Learn more about the JamBlaster, a device designed from the ground up to meet the unique requirements of real-time, online, distributed music performance')

.two_by_two
  .row
    .column
      h1.product-headline
        | The JamBlaster by JamKazam
      p.product-description
        | The JamBlaster is a device designed from the ground up to meet the unique requirements of real-time, online, distributed music performance. This device vastly extends the range/distance over which musicians can play together across the Internet.
      ul
        li Radically reduces audio processing latency compared to today's industry standard computers and audio interfaces.
        li Delivers plug-and-play ease of use, with no worries about hardware and software incompatibilities, driver problems, and arcane configurations.
        li Combines both a computer and an audio interface into a single elegant device.
        li Works with computers (even old crappy ones), tablets or smartphones.
        li Works with your favorite recording software applications like Garage Band, Reaper, Pro Tools, etc.
    .column
      h1 See What You Can Do With The JamBlaster
      .video-wrapper
        .video-container
          iframe src="//www.youtube.com/embed/YHZQHfKDdMc" frameborder="0" allowfullscreen="allowfullscreen"
    br clear="all"
  .row
    .column
      h1
        | Want a JamBlaster? Need One?
      p If you are a registered member of the JamKazam community, and if you "know" you will buy a JamBlaster for $199 as soon as they become available, then click the button below to add yourself to our wait list.  When we get enough "virtual orders", we'll reach back out to all signups to take real orders.

      .cta-big-button
        a.white-bordered-button href="#" SIGN UP TO BUY A JAMBLASTER
    .column
      h1 Want To Know More About Latency?
      p
        | How is it possible that someone hundreds of miles away could feel like they are 20 feet away from you? Check out this video on latency to understand more:
      .linked-video-holder
        a href="https://www.youtube.com/watch?v=mB3_KMse-J4" rel="external" Watch Video About Latency - It's Pretty Fascinating
    br clear="all"
  br clear="all"

javascript:

  function promptConfirmed(app) {
    window.JK.Banner.show({
      title: 'virtual order placed',
      html: '<p>Thank you for signing up for a JamBlaster.</p>  <p>When it becomes available, we will reach back out to you via email.</p>',
      buttons: [
        {
          name: 'CLOSE', click: function () {
        }
        }
      ]
    })
  }
  function confirmOrder(app) {
    app.updateUserModel({want_jamblaster: true})
            .done(function () {
              promptConfirmed(app)
            })
            .fail(function () {
              data.app.layout.notify("Unable to take your virtual order at this time. Please try again later.")
            })
  }

  $(document).on('JAMKAZAM_READY', function (e, data) {
    if($.QueryString['want_jamblaster'] == 'true') {
      data.app.user()
        .done(function() {
          // if we have a user, then mark them as having
          confirmOrder(data.app);
        })
    }
    else if(window.JK.signupData  && window.JK.signupData.want_jamblaster) {
      // if the user has come here as a result of a signup attempt, and if they indicated that they want the jamblaster, tell em it's done
       promptConfirmed(data.app)
    }

    $('.product_jamblaster a.white-bordered-button').on('click', function () {
      var rest = window.JK.Rest();
      if (window.JK.currentUserId) {
        window.JK.Banner.showYesNo({
          title: "please confirm",
          html: "Are you sure you want to make a virtual order for a JamBlaster?",
          yes: function () {
           confirmOrder(data.app)
          },
          no: function () {
            window.JK.Banner.hide();
          }
        })
      }
      else {
        window.JK.Banner.showAlert({
          buttons: [
            {
              name: 'CANCEL', click: function () {

              }
            },
            {
              name: 'SIGN IN', buttonStyle: 'button-orange', click: function () {
                var redirectPath = '?redirect-to=' + encodeURIComponent('/products/jamblaster?want_jamblaster=true');
                window.location.href = '/signin' + redirectPath;
              }
            },
            {
              name: 'SIGN UP', click: function () {
                rest.createSignupHint({redirect_location: '/products/jamblaster', want_jamblaster:true})
                        .done(function() {
                          window.location.href = '/signup'
                        })
                        .fail(function() {
                          data.app.layout.notify("Unable to take your virtual order at this time. Please try again later.")
                        })
              }
            }
          ],
          title: 'please sign in or sign up',
          html: "<p>In order to place a virtual order for a JamBlaster, you must be a registered JamKazam user. Please sign in or sign up to place your order.</p>"
        })
      }

      return false;
    })
  })