<commit_before>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

$(function(){
  navigator.id.watch({
    loggedInUser: currentUser,
    onlogin: function(assertion) {
      $.ajax({
        type: 'POST',
        url: '/persona/verify',
        data: {assertion: assertion},
        success: function(res, status, xhr) {
          window.location.reload();
        },
        error: function(xhr, status, err) { alert("Login failure: " + err); }
      });
    },
    onlogout: function() {
      // A user has logged out! Here you need to:
      // Tear down the user's session by redirecting the user or making a call to your backend.
      // Also, make sure loggedInUser will get set to null on the next page load.
      // (That's a literal JavaScript null. Not false, 0, or undefined. null.)
      $.ajax({
        type: 'POST',
        url: '/persona/logout',
        success: function(res, status, xhr) { 
          window.location.reload();
        },
        error: function(xhr, status, err) { alert("Logout failure: " + err); }
      });
    }
  });
  
  $("#login").click(function(){
    navigator.id.request();
    return false;
  });

  $("#logout").click(function(){
    navigator.id.logout();
    return false;
  });

  $("#year").text((new Date).getFullYear());

});<commit_msg>Oops, should have been part of the website commit.<commit_after>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

$(function(){
  $("#login").click(function(){
    navigator.id.request();
    return false;
  });

  $("#logout").click(function(){
    navigator.id.logout();
    return false;
  });

  $("#year").text((new Date).getFullYear());

  $('.carousel').carousel({
    interval: 0
  });

  var cursorPositions = [
    {top: 150, left: 50},
    {top: 340, left: 160},
    {top: 220, left: 190},
    {top: 90, left: 80}
  ];

  var animateCursor = function(){
    var cursor = $('#towtruck_demo_cursor');
    var position = cursorPositions.pop();
    cursorPositions.unshift(position);
    cursor.animate(position, 'slow', function(){
      setTimeout(animateCursor, 900);
    });
  };

  animateCursor();

  $('.copy-input').click(function(){
    $(this).select();
  });
});
{'fraction_non_alphanumeric': 0.16606353035786087, 'fraction_numerical': 0.013671089666264576, 'mean_word_length': 2.691394658753709, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6514591', 'n_tokens_mistral': 807, 'n_tokens_neox': 761, 'n_words': 233}