<commit_before>$(document).ready(function() {
  // document.addEventListener('DOMContentLoaded', function() {
  // 弹出opUp
  // 冒泡 注册插入点击事件
  // var divs = document.querySelector('body');
  // divs.addEventListener('click', click);

  // 初始化，显示列表页
  if (localStorage.pageAdding) {
    // 如果有保存的状态，恢复状态
    popUp.renderPage({
      id: localStorage.pageID || '',
      inputId1: localStorage.pageInput1 || '',
      inputId2: localStorage.pageInput2 || '',
      name: localStorage.pageName || '',
      userName: localStorage.pageUserName || '',
      passWord: localStorage.pagePassWord || '',
      other: localStorage.pageOther || '',
      host: localStorage.pageHost || ''
    });
    $('#page')
      .transition('scale');
    $('#add')
      .css({
        'visibility': 'hidden'
      });
    $('#back')
      .css({
        'visibility': 'visible'
      });
  } else if ($('#items').hasClass('hidden')) {
    $('#items')
      .transition({
        animation: 'fade',
        duration: 600
      });
  }

  // tooltip提示初始化
  $('.search.link')
    .popup({
      position: 'top center',
    });

  // input框 搜索按钮点击时
  $('.get-input').on('click', function() {
    // 保存当前页面状态
    localStorage.pageAdding = true;
    localStorage.pageID = $("[name=id]").val();
    localStorage.pageName = $("[name=name]").val();
    localStorage.pageUserName = $("[name=username]").val();
    localStorage.pagePassWord = $("[name=password]").val();
    localStorage.pageOther = $("[name=other]").val();
    localStorage.pageHost = $("[name=host]").val();
    localStorage.pageInput1 = $("[name=input1]").val();
    localStorage.pageInput2 = $("[name=input2]").val();
    chrome.tabs.executeScript(null, {
      file: "./js/content_script_get_input.js",
      allFrames: true
    });
    window.close();
  });


  // host框 按钮点击时
  $('.get-host').on('click', function() {
    if (chrome && chrome.tabs)
      chrome.tabs.getSelected(function(tab) {
        $("[name=host]").val(tab.url.replace(/https?:\/\//, '') || '');
      });
  });
  $('.open-host').on('click', function() {
    $('[name=host]').val() ? window.open('http://'+$('[name=host]').val()) : null;
  });
  // 增加按钮点击时
  $('#add').on('click', function() {
    popUp.renderPage({
      id: new Date().getTime(),
    });
    $('#page')
      .transition('scale');
    $('#items')
      .transition('hide');
    $('#add')
      .css({
        'visibility': 'hidden'
      });<commit_msg>优化正则匹配<commit_after>$(document).ready(function() {
  // document.addEventListener('DOMContentLoaded', function() {
  // 弹出opUp
  // 冒泡 注册插入点击事件
  // var divs = document.querySelector('body');
  // divs.addEventListener('click', click);

  // 初始化，显示列表页
  if (localStorage.pageAdding) {
    // 如果有保存的状态，恢复状态
    popUp.renderPage({
      id: localStorage.pageID || '',
      inputId1: localStorage.pageInput1 || '',
      inputId2: localStorage.pageInput2 || '',
      name: localStorage.pageName || '',
      userName: localStorage.pageUserName || '',
      passWord: localStorage.pagePassWord || '',
      other: localStorage.pageOther || '',
      host: localStorage.pageHost || ''
    });
    $('#page')
      .transition('scale');
    $('#add')
      .css({
        'visibility': 'hidden'
      });
    $('#back')
      .css({
        'visibility': 'visible'
      });
  } else if ($('#items').hasClass('hidden')) {
    $('#items')
      .transition({
        animation: 'fade',
        duration: 600
      });
  }

  // tooltip提示初始化
  $('.search.link')
    .popup({
      position: 'top center',
    });

  // input框 搜索按钮点击时
  $('.get-input').on('click', function() {
    // 保存当前页面状态
    localStorage.pageAdding = true;
    localStorage.pageID = $("[name=id]").val();
    localStorage.pageName = $("[name=name]").val();
    localStorage.pageUserName = $("[name=username]").val();
    localStorage.pagePassWord = $("[name=password]").val();
    localStorage.pageOther = $("[name=other]").val();
    localStorage.pageHost = $("[name=host]").val();
    localStorage.pageInput1 = $("[name=input1]").val();
    localStorage.pageInput2 = $("[name=input2]").val();
    chrome.tabs.executeScript(null, {
      file: "./js/content_script_get_input.js",
      allFrames: true
    });
    window.close();
  });


  // host框 按钮点击时
  $('.get-host').on('click', function() {
    if (chrome && chrome.tabs)
      chrome.tabs.getSelected(function(tab) {
        $("[name=host]").val(tab.url.replace(/https?:\/\/([\w\.\-:]+)\/.*/ig, '$1') || '');
      });
  });
  $('.open-host').on('click', function() {
    $('[name=host]').val() ? window.open('http://' + $('[name=host]').val()) : null;
  });
  // 增加按钮点击时
  $('#add').on('click', function() {
    popUp.renderPage({
      id: new Date().getTime(),
    });
    $('#page')
      .transition('scale');
    $('#items')
      .transition('hide');
    $('#add')
      .css({
        'visibility': 'hidden'
      });
{'fraction_non_alphanumeric': 0.23141511365963546, 'fraction_numerical': 0.004710219127585501, 'mean_word_length': 2.7540353574173713, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2174823', 'n_tokens_mistral': 1707, 'n_tokens_neox': 1762, 'n_words': 232}