<commit_before>
<script type="text/javascript"><!--

$(function() {

  const hotkeysButton = $('#hotkeys-button');

  const hotkeysDialog = function() {
    var html = '';
    html += '<div id="hotkeys-dialog">';
    html += '<table>';
    html += tr('Alt-T', 'runs the tests');
    html += tr('Alt-O', 'moves to/from the output file');
    html += tr('Alt-J', 'cycles forwards through the source files');
    html += tr('Alt-K', 'cycles bakwards through the source files');
    html += '</table>';
    html += '<hr/>';
    html += '<table>';
    html += tr('start searching', 'Ctrl-F / Cmd-F', );
    html += tr('find next', 'Ctrl-G / Cmd-G');
    html += tr('find previous', 'Shift-Ctrl-G / Shift-Cmd-G');
    html += tr('replace', 'Shift-Ctrl-F / Cmd-Option-F');
    html += tr('replace all', 'Shift-Ctrl-R / Shift-Cmd-Option-F');
    html += tr('jump to line', 'Alt-G');
    html += '</table>';
    html += '</div>';

    const node = $(html);
    node.dialog({
              width: '500',
           autoOpen: true,
      closeOnEscape: true,
              modal: true,
              title: cd.dialogTitle('hotkeys'),
            buttons: { close:
              function() {
                $(this).remove();
                cd.editorRefocus();
              }
            },
        beforeClose: function(event) {
          if (event.keyCode === $.ui.keyCode.ESCAPE) {
            $(this).remove();
            cd.editorRefocus();
            return true;
          }
        }
    });
  };

  const tr = function(key, what) {
    return '<tr>' +
      '<td style="text-align:right;">' + key + '</td>' +
      '<td>==</td>' +
      '<td>' + what + '</td>' +
    '</tr>';
  };

  if (window.location.href.indexOf('kata/edit') != -1) {
    hotkeysButton.show().click(function() { hotkeysDialog(); });
  } else {
    hotkeysButton.hide();
  }

});

//--></script>

<button type="button"
        id="hotkeys-button">
  hotkeys
</button><commit_msg>refactoring; put hotkeys info in alphabetical order<commit_after>
<script type="text/javascript"><!--

$(function() {

  const hotkeysButton = $('#hotkeys-button');

  const hotkeysDialog = () => {
    let html = '';
    html += '<div id="hotkeys-dialog">';
    html += '<table>';
    html += tr('Alt-J', 'cycles forwards through the source files');
    html += tr('Alt-K', 'cycles bakwards through the source files');
    html += tr('Alt-O', 'moves to/from the output file');
    html += tr('Alt-T', 'runs the tests');
    html += '</table>';
    html += '<hr/>';
    html += '<table>';
    html += tr('start searching', 'Ctrl-F / Cmd-F', );
    html += tr('find next', 'Ctrl-G / Cmd-G');
    html += tr('find previous', 'Shift-Ctrl-G / Shift-Cmd-G');
    html += tr('replace', 'Shift-Ctrl-F / Cmd-Option-F');
    html += tr('replace all', 'Shift-Ctrl-R / Shift-Cmd-Option-F');
    html += tr('jump to line', 'Alt-G');
    html += '</table>';
    html += '</div>';

    const node = $(html);
    node.dialog({
              width: '500',
           autoOpen: true,
      closeOnEscape: true,
              modal: true,
              title: cd.dialogTitle('hotkeys'),
            buttons: { close: () => {
                node.remove();
                cd.editorRefocus();
              }
            },
        beforeClose: (event) => {
          if (event.keyCode === $.ui.keyCode.ESCAPE) {
            node.remove();
            cd.editorRefocus();
            return true;
          }
        }
    });
  };

  const tr = (key, what) => {
    return '<tr>' +
      '<td style="text-align:right;">' + key + '</td>' +
      '<td>==</td>' +
      '<td>' + what + '</td>' +
    '</tr>';
  };

  if (window.location.href.indexOf('kata/edit') != -1) {
    hotkeysButton.show().click(function() { hotkeysDialog(); });
  } else {
    hotkeysButton.hide();
  }

});

//--></script>

<button type="button"
        id="hotkeys-button">
  hotkeys
</button>
{'fraction_non_alphanumeric': 0.2142124166239097, 'fraction_numerical': 0.002052334530528476, 'mean_word_length': 2.082213438735178, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 47, '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': '4606315', 'n_tokens_mistral': 1272, 'n_tokens_neox': 1244, 'n_words': 283}