<commit_before>const electron = require('electron')
const $ = require('jquery');

const ipc = electron.ipcRenderer
const remote = electron.remote
const shell = electron.shell

const currentWindow = remote.getCurrentWindow()

const { createGroceryList } = remote.require('./main')

$('#save-recipe-btn').on('click', () => {
  const title = $('#title-field').val()
  const link = $('#url-field').val()
  const newLink = validateUrl(link)
  saveRecipe(title, newLink)
})

const saveRecipe = (title, link) => {

  $('#recipe-box').append(`<li>
    <h2>${title}</h2>
    <a href="${link}">link</a>
  </li>`)
}

const validateUrl = (link) => {
  const urlRegex = /^(http|https)?:\/\/[w]{2,4}[a-zA-Z0-9-\.]+\.[a-z]{1,10}/
  if(!urlRegex.test(link)){
    link = 'https://' + link
  }
  return link
}

$('#grocery-list-btn').on('click', (e) => {<commit_msg>Start function to send info<commit_after>const electron = require('electron')
const $ = require('jquery');

const ipc = electron.ipcRenderer
const remote = electron.remote
const shell = electron.shell

const currentWindow = remote.getCurrentWindow()

const { createGroceryList } = remote.require('./main')

$('#save-recipe-btn').on('click', () => {
  const title = $('#title-field').val()
  const link = $('#url-field').val()
  const newLink = validateUrl(link)
  saveRecipe(title, newLink)
})

const saveRecipe = (title, link) => {

  $('#recipe-box').append(`<li>
    <h2>${title}</h2>
    <a href="${link}">link</a>
  </li>`)
}

const validateUrl = (link) => {
  const urlRegex = /^(http|https)?:\/\/[w]{2,4}[a-zA-Z0-9-\.]+\.[a-z]{1,10}/
  if(!urlRegex.test(link)){
    link = 'https://' + link
  }
  return link
}

const sendUrl = () => {
  ipc.send()
}

$('#grocery-list-btn').on('click', (e) => {
{'fraction_non_alphanumeric': 0.23657142857142857, 'fraction_numerical': 0.010285714285714285, 'mean_word_length': 4.046109510086455, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 24, 'https://': 2, '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': '6145022', 'n_tokens_mistral': 643, 'n_tokens_neox': 632, 'n_words': 117}