<commit_before>(function($,$TD){
  //
  // Variable: Says whether TweetDick events was initialized.
  //
  var isInitialized = false;
  
  //
  // Function: Initializes TweetDick events. Called after the website app is loaded.
  //
  var initializeTweetDick = function(){
    $("[data-action='settings-menu']").click(function(){
      setTimeout(function(){
        var menu = $(".js-dropdown-content").children("ul").first();
        if (menu.length == 0)return;
        
        menu.children(".drp-h-divider").last().after('<li class="is-selectable" data-tweetdick><a href="#" data-action>TweetDick</a></li><li class="drp-h-divider"></li>');
        
        var tweetDickBtn = menu.children("[data-tweetdick]");
        
        tweetDickBtn.on("click","a",function(){
          $TD.openSettingsMenu();
        });
        
        tweetDickBtn.hover(function(){
          $(this).addClass("is-selected");
        },function(){
          $(this).removeClass("is-selected");
        });
      },0);
    });
    
    isInitialized = true;
  };
  
  //
  // Block: Observe the app <div> element and initialize TweetDick whenever possible.
  //
  var app = $("body").children(".js-app");
  
  new MutationObserver(function(mutations){
    if (mutations.some(mutation => mutation.attributeName === "class")){
      if (isInitialized && app.hasClass("is-hidden")){
        isInitialized = false;
      }
      else if (!isInitialized && !app.hasClass("is-hidden")){
        initializeTweetDick();
      }
    }
  }).observe(app[0],{
    attributes: true
  });
})($,$TD);<commit_msg>Minor refactoring (fix FormBrowser formatting, tweak JS init code)<commit_after>(function($,$TD){
  //
  // Variable: Says whether TweetDick events was initialized.
  //
  var isInitialized = false;
  
  //
  // Function: Initializes TweetDick events. Called after the website app is loaded.
  //
  var initializeTweetDick = function(){
    $("[data-action='settings-menu']").click(function(){
      setTimeout(function(){
        var menu = $(".js-dropdown-content").children("ul").first();
        if (menu.length == 0)return;
        
        menu.children(".drp-h-divider").last().after('<li class="is-selectable" data-tweetdick><a href="#" data-action>TweetDick</a></li><li class="drp-h-divider"></li>');
        
        var tweetDickBtn = menu.children("[data-tweetdick]");
        
        tweetDickBtn.on("click","a",function(){
          $TD.openSettingsMenu();
        });
        
        tweetDickBtn.hover(function(){
          $(this).addClass("is-selected");
        },function(){
          $(this).removeClass("is-selected");
        });
      },0);
    });
    
    isInitialized = true;
  };
  
  //
  // Block: Observe the app <div> element and initialize TweetDick whenever possible.
  //
  var app = $("body").children(".js-app");
  
  new MutationObserver(function(mutations){
    if (isInitialized && app.hasClass("is-hidden")){
      isInitialized = false;
    }
    else if (!isInitialized && !app.hasClass("is-hidden")){
      initializeTweetDick();
    }
  }).observe(app[0],{
    attributes: true,
    attributeFilter: [ "class" ]
  });
})($,$TD);
{'fraction_non_alphanumeric': 0.18314321926489227, 'fraction_numerical': 0.0019011406844106464, 'mean_word_length': 2.6624129930394433, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 18, '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': '62825', 'n_tokens_mistral': 982, 'n_tokens_neox': 967, 'n_words': 175}