<commit_before>;(function() {

now.ready(function() {
  now.setUrl = function(url) {
    console.log('Loading url in iframe');
    $('#container').html(
      $('<iframe>', {sandbox: true, src: url})
    );
  };

  now.setImage = function(url) {
    console.log('Loading image');
    $('#container').html(
      $('<div class="imgbg"/>').css({
        'background-image': 'url(' + url + ')'
      })
    );
  };

  now.reset = function() {
    console.log('reset');
    $('#container').html('');
  };
});

function resize() {
  $('#container').css({
    width: window.innerWidth,
    height: window.innerHeight
  });
}

$(function() {
  $(window).on('resize', resize);
  resize();

  $(document).keyup(function(e) {
    if (e.keyCode == 27) { // Esc
      now.reset();
    }
  });
});


})();
<commit_msg>Allow ajax in sandboxed iframes? yay!<commit_after>;(function() {

now.ready(function() {
  now.setUrl = function(url) {
    console.log('Loading url in iframe');
    $('#container').html(
      $('<iframe>', {sandbox: 'allow-same-origin', src: url})
    );
  };

  now.setImage = function(url) {
    console.log('Loading image');
    $('#container').html(
      $('<div class="imgbg"/>').css({
        'background-image': 'url(' + url + ')'
      })
    );
  };

  now.reset = function() {
    console.log('reset');
    $('#container').html('');
  };
});

function resize() {
  $('#container').css({
    width: window.innerWidth,
    height: window.innerHeight
  });
}

$(function() {
  $(window).on('resize', resize);
  resize();

  $(document).keyup(function(e) {
    if (e.keyCode == 27) { // Esc
      now.reset();
    }
  });
});


})();

{'fraction_non_alphanumeric': 0.24499696785930866, 'fraction_numerical': 0.002425712553062462, 'mean_word_length': 2.8732394366197185, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5733573', 'n_tokens_mistral': 585, 'n_tokens_neox': 569, 'n_words': 95}