<commit_before>// Generated by CoffeeScript 1.3.3
(function() {

  $(function() {
    var $clazzRadios, $generate, $taxaSelectors;
    $clazzRadios = $('#selectionpanel .clazz_selection');
    $taxaSelectors = $('#selectionpanel .taxa_selector');
    $taxaSelectors.hide();
    $clazzRadios.each(function(index, clazzRadio) {
      var $familyDD, $genusDD, $taxaDDs, $taxaRadios, $taxaSelector;
      $taxaSelector = $taxaSelectors.filter('.' + clazzRadio.value);
      $(clazzRadio).change(function(event) {
        var selectedClazz;
        $taxaSelectors.hide();
        selectedClazz = $clazzRadios.filter(':checked').prop('value');
        if (selectedClazz !== 'all') {
          return $taxaSelectors.filter('.' + selectedClazz).show('blind');
        }
      });
      if (clazzRadio.value !== 'all') {
        $taxaRadios = $taxaSelector.find('.taxa');
        $taxaDDs = $taxaSelector.find('.taxa_dd');
        $familyDD = $taxaSelector.find('.taxa_dd.family');
        $genusDD = $taxaSelector.find('.taxa_dd.genus');
        return $taxaRadios.change(function(event) {
          $taxaDDs.css('visibility', 'hidden');
          switch (event.srcElement.value) {
            case 'family':
              return $familyDD.css('visibility', 'visible');
            case 'genus':
              return $genusDD.css('visibility', 'visible');
          }
        });
      }
    });
    $('#prebakeform .year').change(function(event) {
      if ($('#prebakeform .year:checked').prop('value') === 'current') {
        $('#prebakeform input:radio[name="scenario"]').attr('disabled', true);
        return $('#prebakeform .scenario').addClass('disabled');
      } else {
        $('#prebakeform input:radio[name="scenario"]').attr('disabled', false);
        return $('#prebakeform .scenario').removeClass('disabled');
      }
    });
    $('#prebakeform .year').first().change();
    $generate = $('#prebakeform .generate');
    $('#prebakeform input').add('#prebakeform select').change(function(event) {
      var clazz, formIncomplete, groupName, taxaLevel;
      formIncomplete = false;
      clazz = $('#prebakeform input:radio[name="clazztype"]:checked').val();
      if ((clazz != null) && clazz !== 'all') {
        taxaLevel = $("#prebakeform input:radio[name='" + clazz + "_taxatype']:checked").val();
        if (taxaLevel !== 'all') {
          groupName = $("#prebakeform select[name='chosen_" + taxaLevel + "_" + clazz + "']").val();
          if (groupName === 'invalid') {
            formIncomplete = true;
          }
        }
      }
      return $('#prebakeform .generate').attr('disabled', formIncomplete);
    });
    return $generate.click(function(e) {
      var clazz, groupLevel, groupName, output, scenario, taxaLevel, year;
      year = $('#prebakeform input:radio[name="year"]:checked').val();
      scenario = $('#prebakeform input:radio[name="scenario"]:checked').val();
      output = $('#prebakeform input:radio[name="output"]:checked').val();
      clazz = $('#prebakeform input:radio[name="clazztype"]:checked').val();
      groupLevel = 'clazz';
      groupName = clazz;
      if ((clazz != null) && clazz !== 'all') {
        taxaLevel = $("#prebakeform input:radio[name='" + clazz + "_taxatype']:checked").val();
        if (taxaLevel === 'all') {

        } else {
          groupLevel = taxaLevel;
          groupName = $("#prebakeform select[name='chosen_" + taxaLevel + "_" + clazz + "']").val();
        }
      }
      $.ajax('BiodiversityPrep.php', {
        cache: false,
        dataType: 'json',
        data: {
          "class": clazz,
          taxon: groupName,
          settings: "" + scenario + "_" + year
        },
        success: function(data, testStatus, jqx) {
          var layer_name, map, maptitle;
          if (!data.map_path) {
            return alert("Sorry, data for that selection is not available.");
          } else if (output === 'view') {
            String.prototype.capped = function() {
              return this[0].toUpperCase() + this.slice(1).toLowerCase();
            };
            maptitle = 'Biodiversity of terrestrial ';
            if (groupLevel === 'clazz' && clazz === 'all') {
              maptitle += 'vertebrates';
            } else if (groupLevel === 'clazz') {
              maptitle += clazz.capped();
            } else {
              maptitle += "" + (clazz.capped()) + " " + groupLevel + " '" + (groupName.capped()) + "'";
            }
            if (year !== '1990') {
              maptitle += " in " + year + " at emission level " + scenario;
            }
            $("<div class=\"popupwrapper\" style=\"display: none\">\n    <div class=\"toolbar north\"><div id=\"maptitle\">" + maptitle + "</div>\n    <button class=\"close\">close &times;</button></div>\n    <div id=\"popupmap\" class=\"popupmap\"></div>\n    <div class=\"toolbar south\"><div id=\"legend\"></div><button class=\"close\">close &times;</button></div>").appendTo('body').show('fade', 1000);
            layer_name = data.map_path.slice(5, -4);
            $('#legend').load('http://tdh-tools-2.hpc.jcu.edu.au/cgi-bin/mapserv?mode=browse&layer=' + layer_name + '&map=' + data.map_path);
            $('.popupwrapper button.close').click(function(e) {
              return $('.popupwrapper').hide('fade', function() {<commit_msg>adding heading to popup biodiversity map<commit_after>// Generated by CoffeeScript 1.3.3
(function() {

  $(function() {
    var $clazzRadios, $generate, $taxaSelectors;
    $clazzRadios = $('#selectionpanel .clazz_selection');
    $taxaSelectors = $('#selectionpanel .taxa_selector');
    $taxaSelectors.hide();
    $clazzRadios.each(function(index, clazzRadio) {
      var $familyDD, $genusDD, $taxaDDs, $taxaRadios, $taxaSelector;
      $taxaSelector = $taxaSelectors.filter('.' + clazzRadio.value);
      $(clazzRadio).change(function(event) {
        var selectedClazz;
        $taxaSelectors.hide();
        selectedClazz = $clazzRadios.filter(':checked').prop('value');
        if (selectedClazz !== 'all') {
          return $taxaSelectors.filter('.' + selectedClazz).show('blind');
        }
      });
      if (clazzRadio.value !== 'all') {
        $taxaRadios = $taxaSelector.find('.taxa');
        $taxaDDs = $taxaSelector.find('.taxa_dd');
        $familyDD = $taxaSelector.find('.taxa_dd.family');
        $genusDD = $taxaSelector.find('.taxa_dd.genus');
        return $taxaRadios.change(function(event) {
          $taxaDDs.css('visibility', 'hidden');
          switch (event.srcElement.value) {
            case 'family':
              return $familyDD.css('visibility', 'visible');
            case 'genus':
              return $genusDD.css('visibility', 'visible');
          }
        });
      }
    });
    $('#prebakeform .year').change(function(event) {
      if ($('#prebakeform .year:checked').prop('value') === 'current') {
        $('#prebakeform input:radio[name="scenario"]').attr('disabled', true);
        return $('#prebakeform .scenario').addClass('disabled');
      } else {
        $('#prebakeform input:radio[name="scenario"]').attr('disabled', false);
        return $('#prebakeform .scenario').removeClass('disabled');
      }
    });
    $('#prebakeform .year').first().change();
    $generate = $('#prebakeform .generate');
    $('#prebakeform input').add('#prebakeform select').change(function(event) {
      var clazz, formIncomplete, groupName, taxaLevel;
      formIncomplete = false;
      clazz = $('#prebakeform input:radio[name="clazztype"]:checked').val();
      if ((clazz != null) && clazz !== 'all') {
        taxaLevel = $("#prebakeform input:radio[name='" + clazz + "_taxatype']:checked").val();
        if (taxaLevel !== 'all') {
          groupName = $("#prebakeform select[name='chosen_" + taxaLevel + "_" + clazz + "']").val();
          if (groupName === 'invalid') {
            formIncomplete = true;
          }
        }
      }
      return $('#prebakeform .generate').attr('disabled', formIncomplete);
    });
    return $generate.click(function(e) {
      var clazz, groupLevel, groupName, output, scenario, taxaLevel, year;
      year = $('#prebakeform input:radio[name="year"]:checked').val();
      scenario = $('#prebakeform input:radio[name="scenario"]:checked').val();
      output = $('#prebakeform input:radio[name="output"]:checked').val();
      clazz = $('#prebakeform input:radio[name="clazztype"]:checked').val();
      groupLevel = 'clazz';
      groupName = clazz;
      if ((clazz != null) && clazz !== 'all') {
        taxaLevel = $("#prebakeform input:radio[name='" + clazz + "_taxatype']:checked").val();
        if (taxaLevel === 'all') {

        } else {
          groupLevel = taxaLevel;
          groupName = $("#prebakeform select[name='chosen_" + taxaLevel + "_" + clazz + "']").val();
        }
      }
      $.ajax('BiodiversityPrep.php', {
        cache: false,
        dataType: 'json',
        data: {
          "class": clazz,
          taxon: groupName,
          settings: "" + scenario + "_" + year
        },
        success: function(data, testStatus, jqx) {
          var layer_name, map, maptitle;
          if (!data.map_path) {
            return alert("Sorry, data for that selection is not available.");
          } else if (output === 'view') {
            String.prototype.capped = function() {
              return this[0].toUpperCase() + this.slice(1).toLowerCase();
            };
            maptitle = 'Biodiversity of terrestrial ';
            if (groupLevel === 'clazz' && clazz === 'all') {
              maptitle += 'vertebrates';
            } else if (groupLevel === 'clazz') {
              maptitle += clazz.capped();
            } else {
              maptitle += "" + (clazz.capped()) + " " + groupLevel + " '" + (groupName.capped()) + "'";
            }
            if (year !== 'current') {
              maptitle += " in " + year + " at emission level " + scenario;
            }
            $("<div class=\"popupwrapper\" style=\"display: none\">\n    <div class=\"toolbar north\"><div id=\"maptitle\">" + maptitle + "</div>\n    <button class=\"close\">close &times;</button></div>\n    <div id=\"popupmap\" class=\"popupmap\"></div>\n    <div class=\"toolbar south\"><div id=\"legend\"></div><button class=\"close\">close &times;</button></div>").appendTo('body').show('fade', 1000);
            layer_name = data.map_path.slice(5, -4);
            $('#legend').load('http://tdh-tools-2.hpc.jcu.edu.au/cgi-bin/mapserv?mode=browse&layer=' + layer_name + '&map=' + data.map_path);
            $('.popupwrapper button.close').click(function(e) {
              return $('.popupwrapper').hide('fade', function() {
{'fraction_non_alphanumeric': 0.19271908425595796, 'fraction_numerical': 0.0026271345468192905, 'mean_word_length': 2.6279782164737915, 'pattern_counts': {'":': 2, '<': 33, '<?xml version=': 0, '>': 33, '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': '3716469', 'n_tokens_mistral': 3287, 'n_tokens_neox': 3239, 'n_words': 583}