<commit_before>var frozenpreview = null;

var switchframe = function(event) {
  event.preventDefault();
  if (frozenpreview) {
    $('#viewercontainer').show(150);
    frozenpreview.appendTo('#viewercontainer');
    frozenpreview = null;
  } else {
    frozenpreview = $('#viewerframe').detach();
    $('#viewercontainer').hide(150);
  }
};

var frameoff = function() {
  if (frozenpreview === null) {
    frozenpreview = $('#viewerframe').detach();
    $('#viewercontainer').hide(150);
  }
};

$('#previewonoff').click(switchframe);
$('#openinnewwindow').click(frameoff);<commit_msg>Opening the playground in a window should not turn preview off, there's another button for that.<commit_after>var frozenpreview = null;

var switchframe = function(event) {
  event.preventDefault();
  if (frozenpreview) {
    $('#viewercontainer').show(150);
    frozenpreview.appendTo('#viewercontainer');
    frozenpreview = null;
  } else {
    frozenpreview = $('#viewerframe').detach();
    $('#viewercontainer').hide(150);
  }
};

$('#previewonoff').click(switchframe);
{'fraction_non_alphanumeric': 0.17847025495750707, 'fraction_numerical': 0.014164305949008499, 'mean_word_length': 5.0227272727272725, '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': '3386858', 'n_tokens_mistral': 327, 'n_tokens_neox': 329, 'n_words': 60}