<commit_before>/*
 * Code that controls the nav that appears on handhelds
 * with RequireJS. Attribution goes to <NAME>'
 * original code at:
 * http://danny-t.co.uk/2012/03/02/really-simple-responsive-menu/
 * 
 * Using documentFragment() to load multiple elements at
 * once instead of one at a time. jsPerf test says this
 * way is faster.
 * http://jsperf.com/add-mobile-buttons-testing/2
 */

// Start RequireJS code

define("menu", ["jquery"], function($) {
  var header = document.getElementById("masthead"),
    loadButtons = document.createDocumentFragment(),
    $navMenu = $("#site-navigation-list"),
    $searchBox = $("#searchbox"),
    menuButton = document.createElement("div"),
    searchButton = document.createElement("div"),
    showMenus;

  menuButton.id = "menu";
  menuButton.setAttribute("class", "mobile-menu-btn-class");

  searchButton.id = "search";
  searchButton.setAttribute("class", "search-btn-class");
  
  
  loadButtons.appendChild(searchButton);
  loadButtons.appendChild(menuButton);

  header.appendChild(loadButtons);<commit_msg>clean up comments on js/buildform.js<commit_after>/*
 * Code that controls the nav and search buttons that appears on handhelds. 
 * Attribution goes to Dan Thomas' original code at:
 * http://danny-t.co.uk/2012/03/02/really-simple-responsive-menu/
 * 
 * Using documentFragment() to load multiple elements at once instead of one 
 * at a time. jsPerf test says this way is faster.
 * http://jsperf.com/add-mobile-buttons-testing/2
 */

// Start RequireJS code

define("menu", ["jquery"], function($) {
  var header = document.getElementById("masthead"),
    loadButtons = document.createDocumentFragment(),
    $navMenu = $("#site-navigation-list"),
    $searchBox = $("#searchbox"),
    menuButton = document.createElement("div"),
    searchButton = document.createElement("div"),
    showMenus;

  menuButton.id = "menu";
  menuButton.setAttribute("class", "mobile-menu-btn-class");

  searchButton.id = "search";
  searchButton.setAttribute("class", "search-btn-class");
  
  
  loadButtons.appendChild(searchButton);
  loadButtons.appendChild(menuButton);

  header.appendChild(loadButtons);
{'fraction_non_alphanumeric': 0.14226327944572748, 'fraction_numerical': 0.008314087759815243, 'mean_word_length': 4.321867321867322, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '2422387', 'n_tokens_mistral': 645, 'n_tokens_neox': 625, 'n_words': 151}