<commit_before>// remap jQuery to $
(function($) {

  $(function() {
    // Empty iframe if cached
    $("iframe").attr("src", "about:blank")

	// Prepare iframe size and resize it with window
    $('#source').height($(document).height() - $('#pontoon').height());
    $(window).resize(function () {
      $('#source').height($(document).height() - $('#pontoon').height());
    });
		
    // Load website into iframe
    $('.url').keypress(function (e) {
      var code = (e.keyCode ? e.keyCode : e.which);
      if (code === 13) {
        $('#intro').slideUp("fast", function() {

          // TODO: use real URLs
          $('#source').attr('src', /*$('.url').val()*/ '../../projects/testpilot');
          $('#pontoon .url').val(/*$('.url').val()*/'../../projects/testpilot');
        });

        $('#source').unbind("load.pontoon").bind("load.pontoon", function() {
          // Quit if website not specified
          if (!$(this).attr('src')) {
            return;
          }
      
          // Remove any existing pontoon clients
          if (Pontoon._clients.length) {
            Pontoon._clients = [];
          }
      
          // Turn on Pontoon client
          var doc = this.contentDocument,
              pc = new Pontoon.client(doc, document);
          pc.turnOn(pc, doc);
        });
      }
    });
    
    // Send changes to server
    $("#send").click(function () {
      Pontoon._clients[0].send();
    });

    // Click on a test drive icon
    $('#test-drive').click(function() {
      var event = $.Event("keypress");
      event.which = 13;
      $("#intro .url").trigger(event);
    });

	// Generate bookmarklet
    var publicDomain = window.location.href.split("client/www/")[0]; // Transfer public folder location to the bookmarklet
    $("#bookmarklet").attr("href", "javascript:(function(d){if(typeof PontoonBookmarklet==='undefined'){PontoonBookmarklet='" + publicDomain + "';d.body.appendChild(d.createElement('script')).src=PontoonBookmarklet+'/client/bookmarklet/loader.js';}})(document)");

  });

}(this.jQuery));

// usage: log('inside coolFunc',this,arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function() {
  log.history = log.history || [];   // store logs to an array for reference
  log.history.push(arguments);
  if (this.console) {<commit_msg>Disable Bookmarklet on Pontoon Web Client<commit_after>// remap jQuery to $
(function($) {

  $(function() {
    // Empty iframe if cached
    $("iframe").attr("src", "about:blank")

	// Prepare iframe size and resize it with window
    $('#source').height($(document).height() - $('#pontoon').height());
    $(window).resize(function () {
      $('#source').height($(document).height() - $('#pontoon').height());
    });
		
    // Load website into iframe
    $('.url').keypress(function (e) {
      var code = (e.keyCode ? e.keyCode : e.which);
      if (code === 13) {
        $('#intro').slideUp("fast", function() {

          // TODO: use real URLs
          $('#source').attr('src', /*$('.url').val()*/ '../../projects/testpilot');
          $('#pontoon .url').val(/*$('.url').val()*/'../../projects/testpilot');
        });

        $('#source').unbind("load.pontoon").bind("load.pontoon", function() {
          // Quit if website not specified
          if (!$(this).attr('src')) {
            return;
          }
      
          // Remove any existing pontoon clients
          if (Pontoon._clients.length) {
            Pontoon._clients = [];
          }
      
          // Turn on Pontoon client
          var doc = this.contentDocument,
              pc = new Pontoon.client(doc, document);
          pc.turnOn(pc, doc);
        });
      }
    });
    
    // Send changes to server
    $("#send").click(function () {
      Pontoon._clients[0].send();
    });

    // Click on a test drive icon
    $('#test-drive').click(function() {
      var event = $.Event("keypress");
      event.which = 13;
      $("#intro .url").trigger(event);
    });

	// Generate bookmarklet
    var publicDomain = window.location.href.split("client/www/")[0]; // Transfer public folder location to the bookmarklet
    $("#bookmarklet").attr("href", "javascript:(function(d){if(typeof Pontoon==='undefined'){PontoonBookmarklet='" + publicDomain + "';d.body.appendChild(d.createElement('script')).src=PontoonBookmarklet+'/client/bookmarklet/loader.js';}})(document)");

  });

}(this.jQuery));

// usage: log('inside coolFunc',this,arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function() {
  log.history = log.history || [];   // store logs to an array for reference
  log.history.push(arguments);
  if (this.console) {
{'fraction_non_alphanumeric': 0.20387316450308576, 'fraction_numerical': 0.004256224728665673, 'mean_word_length': 2.5285285285285286, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '193018', 'n_tokens_mistral': 1459, 'n_tokens_neox': 1417, 'n_words': 279}