<commit_before>/**
 * Creates releases' JSON
 * @param collectionId
 * @param releaseDate
 * @param pageType
 * @param parentUrl
 */

function loadT16Creator(collectionId, releaseDate, pageType, parentUrl) {
  var releaseDate = null;             //overwrite scheduled collection date
  var pageType, pageTitle, uriSection, pageTitleTrimmed;
  var parentUrlData = "/data"; //home page
  $.ajax({
    url: parentUrlData,
    dataType: 'json',
    crossDomain: true,
    success: function (checkData) {
      //Checks page is built in correct location
      if (checkData.type === 'home_page') {
        submitFormHandler();
        return true;
      } else {
        alert("This is not a valid place to create this page.");
        loadCreateScreen(collectionId);
      }
    },
    error: function () {
      console.log('No page data returned');
    }
  });

  function submitFormHandler() {
    $('.edition').append(
      '<label for="releaseDate">Release date</label>' +
      '<input id="releaseDate" type="text" placeholder="day month year" />' +
      '<select id="hour" style="width: 50%;" class="selectbg--small">' +
      '  <option value="0">00</option>' +
      '  <option value="3600000">01</option>' +
      '  <option value="7200000">02</option>' +
      '  <option value="10800000">03</option>' +
      '  <option value="14400000">04</option>' +
      '  <option value="18000000">05</option>' +
      '  <option value="21600000">06</option>' +
      '  <option value="25200000">07</option>' +
      '  <option value="28800000">08</option>' +
      '  <option value="32400000" selected="selected">09</option>' +
      '  <option value="36000000">10</option>' +
      '  <option value="39600000">11</option>' +
      '  <option value="43200000">12</option>' +
      '  <option value="46800000">13</option>' +
      '  <option value="50400000">14</option>' +
      '  <option value="54000000">15</option>' +
      '  <option value="57600000">16</option>' +
      '  <option value="61200000">17</option>' +
      '  <option value="64800000">18</option>' +
      '  <option value="68400000">19</option>' +
      '  <option value="72000000">20</option>' +
      '  <option value="75600000">21</option>' +
      '  <option value="79200000">22</option>' +
      '  <option value="82800000">23</option>' +
      '</select>' +
      '<select id="min" style="width: 50%;" class="selectbg--small">' +
      '  <option value="0">00</option>' +
      '  <option value="1800000" selected="selected">30</option>' +
      '</select>'
    );
    $('#releaseDate').datepicker({dateFormat: 'dd MM yy'});

    //Submits inherited and added information to JSON
    $('form').submit(function (e) {
      //Check for reserved words
      if ($('#pagename').val().toLowerCase() === 'current' || $('#pagename').val().toLowerCase() === 'latest' || $('#pagename').val().toLowerCase() === 'data') {
        alert ('That is not an accepted value for a title');
        $('#pagename').val('');
        return false;
      }
      if ($('#edition').val().toLowerCase() === 'current' || $('#edition').val().toLowerCase() === 'latest' || $('#edition').val().toLowerCase() === 'data') {
        alert ('That is not an accepted value for an edition');
        $('#edition').val('');
        return false;
      }
      pageData = pageTypeDataT16(pageType);
      var publishTime  = parseInt($('#hour').val()) + parseInt($('#min').val());
      var toIsoDate = $('#releaseDate').datepicker("getDate");
      pageData.description.releaseDate = new Date(parseInt(new Date(toIsoDate).getTime()) + publishTime).toISOString();
      pageData.description.edition = $('#edition').val();
      pageTitle = $('#pagename').val();
      pageData.description.title = pageTitle;
      uriSection = "releases";
      pageTitleTrimmed = pageTitle.replace(/[^A-Z0-9]+/ig, "").toLowerCase();
      newUri = makeUrl(parentUrl, uriSection, pageTitleTrimmed);
      safeNewUri = checkPathSlashes(newUri);

      if (!pageData.description.releaseDate) {
        alert('Release date can not be empty');
        return true;
      }
      if (pageTitle.length < 5) {
        alert("This is not a valid file title");
        return true;
      } else {
        Florence.globalVars.pagePath = safeNewUri;
        checkSaveContent(collectionId, safeNewUri, pageData);
      }
      e.preventDefault();
    });
  }<commit_msg>Take out edition check out of calendar entry<commit_after>/**
 * Creates releases' JSON
 * @param collectionId
 * @param releaseDate
 * @param pageType
 * @param parentUrl
 */

function loadT16Creator(collectionId, releaseDate, pageType, parentUrl) {
  var releaseDate = null;             //overwrite scheduled collection date
  var pageType, pageTitle, uriSection, pageTitleTrimmed;
  var parentUrlData = "/data"; //home page
  $.ajax({
    url: parentUrlData,
    dataType: 'json',
    crossDomain: true,
    success: function (checkData) {
      //Checks page is built in correct location
      if (checkData.type === 'home_page') {
        submitFormHandler();
        return true;
      } else {
        alert("This is not a valid place to create this page.");
        loadCreateScreen(collectionId);
      }
    },
    error: function () {
      console.log('No page data returned');
    }
  });

  function submitFormHandler() {
    $('.edition').append(
      '<label for="releaseDate">Release date</label>' +
      '<input id="releaseDate" type="text" placeholder="day month year" />' +
      '<select id="hour" style="width: 50%;" class="selectbg--small">' +
      '  <option value="0">00</option>' +
      '  <option value="3600000">01</option>' +
      '  <option value="7200000">02</option>' +
      '  <option value="10800000">03</option>' +
      '  <option value="14400000">04</option>' +
      '  <option value="18000000">05</option>' +
      '  <option value="21600000">06</option>' +
      '  <option value="25200000">07</option>' +
      '  <option value="28800000">08</option>' +
      '  <option value="32400000" selected="selected">09</option>' +
      '  <option value="36000000">10</option>' +
      '  <option value="39600000">11</option>' +
      '  <option value="43200000">12</option>' +
      '  <option value="46800000">13</option>' +
      '  <option value="50400000">14</option>' +
      '  <option value="54000000">15</option>' +
      '  <option value="57600000">16</option>' +
      '  <option value="61200000">17</option>' +
      '  <option value="64800000">18</option>' +
      '  <option value="68400000">19</option>' +
      '  <option value="72000000">20</option>' +
      '  <option value="75600000">21</option>' +
      '  <option value="79200000">22</option>' +
      '  <option value="82800000">23</option>' +
      '</select>' +
      '<select id="min" style="width: 50%;" class="selectbg--small">' +
      '  <option value="0">00</option>' +
      '  <option value="1800000" selected="selected">30</option>' +
      '</select>'
    );
    $('#releaseDate').datepicker({dateFormat: 'dd MM yy'});

    //Submits inherited and added information to JSON
    $('form').submit(function (e) {
      //Check for reserved words
      if ($('#pagename').val().toLowerCase() === 'current' || $('#pagename').val().toLowerCase() === 'latest' || $('#pagename').val().toLowerCase() === 'data') {
        alert ('That is not an accepted value for a title');
        $('#pagename').val('');
        return false;
      }

      pageData = pageTypeDataT16(pageType);
      var publishTime  = parseInt($('#hour').val()) + parseInt($('#min').val());
      var toIsoDate = $('#releaseDate').datepicker("getDate");
      pageData.description.releaseDate = new Date(parseInt(new Date(toIsoDate).getTime()) + publishTime).toISOString();
      pageData.description.edition = $('#edition').val();
      pageTitle = $('#pagename').val();
      pageData.description.title = pageTitle;
      uriSection = "releases";
      pageTitleTrimmed = pageTitle.replace(/[^A-Z0-9]+/ig, "").toLowerCase();
      newUri = makeUrl(parentUrl, uriSection, pageTitleTrimmed);
      safeNewUri = checkPathSlashes(newUri);

      if (!pageData.description.releaseDate) {
        alert('Release date can not be empty');
        return true;
      }
      if (pageTitle.length < 5) {
        alert("This is not a valid file title");
        return true;
      } else {
        Florence.globalVars.pagePath = safeNewUri;
        checkSaveContent(collectionId, safeNewUri, pageData);
      }
      e.preventDefault();
    });
  }
{'fraction_non_alphanumeric': 0.18497177798682973, 'fraction_numerical': 0.05973659454374412, 'mean_word_length': 3.059665871121718, 'pattern_counts': {'":': 0, '<': 123, '<?xml version=': 0, '>': 121, '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': '7655565', 'n_tokens_mistral': 2871, 'n_tokens_neox': 2565, 'n_words': 527}