<commit_before>
<div class="tab-filenames"></div>

<script type="text/javascript">
'use strict';
$(() => {

  const $tabFilenames = $('.tab-filenames');
  const outputTabNames = ['stdout','stderr','status'];

  cd.isOutputFile = filename => outputTabNames.includes(filename);

  cd.toggleOutputFile = () => {
    //TODO
  };

  cd.setFilenameTab = (filename) => {
    const id = cd.isOutputFile(filename) ? `radio_${filename}` : 'current_filename';
    const tab = $(`#${id}`);
    tab.text(filename);
    $('.tab.filename').removeClass('selected');
    tab.addClass('selected');
  };

  const setupCurrentFilenameTab = () => {
    const $currentFilenameTab = $('<div>', {
      class:'tab filename',
         id:'current_filename',
       text:'readme.txt'
    });
    $tabFilenames.append($currentFilenameTab);
    setupTabFilenameClickHandler($currentFilenameTab);
  };

  const setupOutputTabs = () => {
    outputTabNames.forEach(filename => {
      const $div = $('<div>', {
          class: 'tab filename',
             id: `radio_${filename}`,
           text: filename
      });
      $tabFilenames.append($div);
      setupTabFilenameClickHandler($div);
    });
  };
<commit_msg>Implemented Alt-O to cycle through editor tabs<commit_after>
<div class="tab-filenames"></div>

<script type="text/javascript">
'use strict';
$(() => {

  const $tabFilenames = $('.tab-filenames');
  const outputTabNames = ['stdout','stderr','status'];
  const selectedTabFilename = () => $('.selected', $tabFilenames).text();
  const currentFilename = () => $('#current_filename', $tabFilenames).text();

  cd.isOutputFile = filename => outputTabNames.includes(filename);

  cd.toggleOutputFile = () => {
    switch (selectedTabFilename()) {
    case 'stdout': cd.loadFile('stderr'); break;
    case 'stderr': cd.loadFile('status'); break;
    case 'status': cd.loadFile(currentFilename()); break;
    default      : cd.loadFile('stdout'); break;
    }
  };

  cd.setFilenameTab = (filename) => {
    const id = cd.isOutputFile(filename) ? `radio_${filename}` : 'current_filename';
    const tab = $(`#${id}`);
    tab.text(filename);
    $('.tab.filename').removeClass('selected');
    tab.addClass('selected');
  };

  const setupCurrentFilenameTab = () => {
    const $currentFilenameTab = $('<div>', {
      class:'tab filename',
         id:'current_filename',
       text:'cyber-dojo.sh'
    });
    $tabFilenames.append($currentFilenameTab);
    setupTabFilenameClickHandler($currentFilenameTab);
  };

  const setupOutputTabs = () => {
    outputTabNames.forEach(filename => {
      const $div = $('<div>', {
          class: 'tab filename',
             id: `radio_${filename}`,
           text: filename
      });
      $tabFilenames.append($div);
      setupTabFilenameClickHandler($div);
    });
  };

{'fraction_non_alphanumeric': 0.18480199785943632, 'fraction_numerical': 0.0, 'mean_word_length': 3.4935897435897436, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 29, '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': '6524917', 'n_tokens_mistral': 855, 'n_tokens_neox': 848, 'n_words': 144}