<commit_before><%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<!-- friendlyMineLinkDisplayer.jsp -->

<c:set var="interMineObject" value="${object}"/>

<script type="text/javascript" charset="utf-8">

function getFriendlyMineLinks(mine, url, organisms, identifierList) {

    AjaxServices.getFriendlyMineListLinks(mine, organisms, identifierList, function(mineString) {
        // switch off loading img
        jQuery('#intermine_orthologue_links_' + mine).toggleClass('loading');
        if (mineString) {
            // parse to JSON (requires jQuery 1.4.1+)
            var jSONObject = jQuery.parseJSON(mineString);
            // TODO can be many identifiers, need to post
            // [{"identifiers":["ENSRNOG00000001410","ENSRNOG00000001575"],"isHomologue":false,"shortName":"<NAME>"}]
            generate(jSONObject, "#intermine_orthologue_links_" + mine, url);
        } else {
            jQuery("#intermine_orthologue_links_" + mine).html("No results found.");
        }
    });
}

  function generate(jSONObject, target, url) {
    url =+ "/portal.do";
    jQuery('<ul/>', {
        'class': 'organisms'
      })
      .appendTo(target);
    target += ' ul.organisms';

      // for each organism for which the mine has orthologues
      var i = 3;
      jQuery.each(jSONObject, function(key, entry) {
        if (entry['identifiers'] != undefined) {
            var homologue = '';
            if (entry['isHomologue'] == true) {
                homologue = "&orthologue=" + entry['shortName'];
            }
            jQuery('<li/>', {
                'id': 'organism-' + key,
                'style': (i <= 0) ? 'display:none;' : '',
                'html': jQuery('<a/>', {
                    'href': '#',
                    'text': entry['shortName'],
                    'target': '_blank',
                    'click': function(e) {
                        jQuery.post(url, { externalids: entry['identifiers'], class: "Gene" });
                    }
                })
            }).appendTo(target);
            i--;
        }
      });
      if (i < 0) {
          jQuery('<li/>', {
            'class': 'toggler',
              'html': jQuery('<a/>', {
                  'text': 'Show all',
                  'href': '#',
                  'click': function(e) {
                    jQuery(this).parents(':eq(1)').find('li:hidden').show();
                    jQuery(this).remove();
                    e.preventDefault();
                  }
              })
          }).appendTo(target);
      }
  }
</script>

<h3 class="goog">View homologues in other Mines:</h3>
<commit_msg>revert accidental check in [27910]<commit_after><%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<!-- friendlyMineLinkDisplayer.jsp -->

<c:set var="interMineObject" value="${object}"/>

<script type="text/javascript" charset="utf-8">

function getFriendlyMineLinks(mine, url, organisms, identifierList) {

    AjaxServices.getFriendlyMineListLinks(mine, organisms, identifierList, function(mineString) {
        // switch off loading img
        jQuery('#intermine_orthologue_links_' + mine).toggleClass('loading');
        if (mineString) {
            // parse to JSON (requires jQuery 1.4.1+)
            var jSONObject = jQuery.parseJSON(mineString);
            // TODO can be many identifiers, need to post
            // [{"identifiers":["ENSRNOG00000001410","ENSRNOG00000001575"],"isHomologue":false,"shortName":"<NAME>"}]
            generate(jSONObject, "#intermine_orthologue_links_" + mine, url);
        } else {
            jQuery("#intermine_orthologue_links_" + mine).html("No results found.");
        }
    });
}

  function generate(jSONObject, target, url) {
    jQuery('<ul/>', {
        'class': 'organisms'
      })
      .appendTo(target);
    target += ' ul.organisms';

      // for each organism for which the mine has orthologues
      var i = 3;
      jQuery.each(jSONObject, function(key, entry) {
        if (entry['identifiers'] != undefined) {
            var homologue = '';
            if (entry['isHomologue'] == true) {
                homologue = "&orthologue=" + entry['shortName'];
            }
            jQuery('<li/>', {
                'id': 'organism-' + key,
                'style': (i <= 0) ? 'display:none;' : '',
                'html': jQuery('<a/>', {
                    'href': url + "/portal.do?externalids=" + entry['identifiers']  + "&class=Gene&origin=FlyMine" + homologue,
                    'text': entry['shortName'],
                    'target': '_blank'
                })
            }).appendTo(target);
            i--;
        }
      });
      if (i < 0) {
          jQuery('<li/>', {
            'class': 'toggler',
              'html': jQuery('<a/>', {
                  'text': 'Show all',
                  'href': '#',
                  'click': function(e) {
                    jQuery(this).parents(':eq(1)').find('li:hidden').show();
                    jQuery(this).remove();
                    e.preventDefault();
                  }
              })
          }).appendTo(target);
      }
  }
</script>

<h3 class="goog">View homologues in other Mines:</h3>

{'fraction_non_alphanumeric': 0.17561658212349135, 'fraction_numerical': 0.012768934755990904, 'mean_word_length': 2.014232999472852, 'pattern_counts': {'":': 6, '<': 41, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '3521697', 'n_tokens_mistral': 1815, 'n_tokens_neox': 1675, 'n_words': 310}