<commit_before>function kaaSwaggerAdaptor () {

  function shebangWorkaround(url)
  {
    // If shebang has an operation nickname in it..
    // e.g. /docs/#!/words/get_search
    var fragments = $.param.fragment(url).split('/');
    fragments.shift(); // get rid of the bang
    switch (fragments.length) {
    case 1:
      if (fragments[0].length > 0) { // prevent matching "#/"
      // Expand all operations for the resource and scroll to it
      var dom_id = 'resource_' + fragments[0];

      Docs.expandEndpointListForResource(fragments[0]);
        $("#" + dom_id).slideto();
      }
      break;
    case 2:
      // Refer to the endpoint DOM element, e.g. #words_get_search

      // Expand Resource
      Docs.expandEndpointListForResource(fragments[0]);
      //$("#" + dom_id).slideto();
      // Expand operation
      var li_dom_id = fragments.join('_');
      var li_content_dom_id = li_dom_id + "_content";

      console.log('-----', li_dom_id, $('#' + li_dom_id));
      Docs.expandOperation($('#' + li_content_dom_id));
      $('#main').animate({scrollTop: $('#' + li_dom_id).offset().top}, 500);
      console.log('111111');

      //$('#' + li_dom_id).slideto();
      break;
      }
    }

  function addOperationEntry(operation) {
    var operation_entry = document.createElement('LI');
    this.appendChild(operation_entry);
    var operation_link = document.createElement('A');

    operation_link.setAttribute('href','#!/' + operation.encodedParentId + '/' + operation.nickname);
    operation_link.setAttribute('id', 'markdown-toc-' + operation.nickname);
    operation_entry.appendChild(operation_link);<commit_msg>KAA-1108: Fix TOC<commit_after>function kaaSwaggerAdaptor () {

  function shebangWorkaround(url)
  {
    // If shebang has an operation nickname in it..
    // e.g. /docs/#!/words/get_search
    var fragments = $.param.fragment(url).split('/');
    fragments.shift(); // get rid of the bang
    switch (fragments.length) {
    case 1:
      if (fragments[0].length > 0) { // prevent matching "#/"
      // Expand all operations for the resource and scroll to it
      var dom_id = 'resource_' + fragments[0];

      Docs.expandEndpointListForResource(fragments[0]);
        $("#" + dom_id).slideto();
      }
      break;
    case 2:
      // Refer to the endpoint DOM element, e.g. #words_get_search

      // Expand Resource
      Docs.expandEndpointListForResource(fragments[0]);
      //$("#" + dom_id).slideto();
      // Expand operation
      var li_dom_id = fragments.join('_');
      var li_content_dom_id = li_dom_id + "_content";

      console.log('-----', li_dom_id, $('#' + li_dom_id));
      Docs.expandOperation($('#' + li_content_dom_id));
      $('#main').animate({scrollTop: $('#' + li_dom_id).offset().top + $("#main").scrollTop()}, 700);

      //$('#' + li_dom_id).slideto();
      break;
      }
    }

  function addOperationEntry(operation) {
    var operation_entry = document.createElement('LI');
    this.appendChild(operation_entry);
    var operation_link = document.createElement('A');

    operation_link.setAttribute('href','#!/' + operation.encodedParentId + '/' + operation.nickname);
    operation_link.setAttribute('id', 'markdown-toc-' + operation.nickname);
    operation_entry.appendChild(operation_link);
{'fraction_non_alphanumeric': 0.16342648845686514, 'fraction_numerical': 0.009113001215066828, 'mean_word_length': 3.060419235511714, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4332762', 'n_tokens_mistral': 1053, 'n_tokens_neox': 1022, 'n_words': 199}