<commit_before>import $ from 'jquery';

export default function (recordModel) {
  const links = recordModel.get('properties').links;
  const url = links.find(link => link.rel === 'enclosure').href;

  // TODO: improve rudimentary translation from KVP -> inputs
  const parts = url.split('?');
  let inputs = '';
  if (parts.length > 1) {
    inputs = parts[1]
      .split('&')
      .map(param => {
        const kv = param.split('=');
        return `<input name="${kv[0]}" value="${kv[1]}">`;
      })
      .join('');
  }

  return $(`
    <form method="get" action="${url}" target="iframe-download-post">${inputs}</form><commit_msg>Using blank window for URL based download.<commit_after>import $ from 'jquery';

export default function (recordModel) {
  const links = recordModel.get('properties').links;
  const url = links.find(link => link.rel === 'enclosure').href;

  // TODO: improve rudimentary translation from KVP -> inputs
  const parts = url.split('?');
  let inputs = '';
  if (parts.length > 1) {
    inputs = parts[1]
      .split('&')
      .map(param => {
        const kv = param.split('=');
        return `<input name="${kv[0]}" value="${kv[1]}">`;
      })
      .join('');
  }

  return $(`
    <form method="get" action="${url}" target="_blank">${inputs}</form>
{'fraction_non_alphanumeric': 0.20248254460822343, 'fraction_numerical': 0.0062063615205585725, 'mean_word_length': 3.215686274509804, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6917615', 'n_tokens_mistral': 411, 'n_tokens_neox': 401, 'n_words': 99}