Skip to content

Latest commit

 

History

History
137 lines (128 loc) · 5.8 KB

search.md

File metadata and controls

137 lines (128 loc) · 5.8 KB
title
Search Results
<script> let hasInputListener = false; </script> <script src="/assets/js/simple-jekyll-search-ap.js"></script> <script> //hide search widget document.getElementById("search-widget").style.display = "none"; </script>
Pro-tip: Start typing any keywords for pathway titles, descriptions, genes or metabolites and the results will begin to appear. You can include organisms, ontology annotations, WPIDs, and even last-edited dates in your query. Multi-term queries are processed as AND queries.

Alternative search options:

Additional ways to find pathways:

    {% assign sorted_browse = site.browse | where:"btn-class","btn-front" | sort: "order" %} {% for bp in sorted_browse %}
  • {{ bp.display-title }}
  • {% endfor %} {% assign sorted_browse = site.browse | where_exp:"item","item.btn-class contains 'pill'" | sort: "order" %} {% for bp in sorted_browse %}
  • {{ bp.display-title }}
  • {% endfor %}
<script> SimpleJekyllSearch({ searchInput: document.getElementById('search-input'), resultsContainer: document.getElementById('results-container'), json: '/search.json', searchResultTemplate: ' ' + '' + '
Pathway thumbnail{title}' + '
{wpid} - {organisms}' + '
{description}' + '
Last edited: {last-edited}' + '
', noResultsText: 'No results found', limit: 40, fuzzy: false, exclude: ['url'], sortMiddleware: function(a, b) { const aNum = parseInt(a.wpid.match(/\d+/)[0]); const bNum = parseInt(b.wpid.match(/\d+/)[0]); return bNum - aNum; }, searchResultsCallback: function(results) { allResults = results; const showMoreContainer = document.getElementById('show-more-container'); showMoreContainer.style.display = results.length > currentLimit ? 'block' : 'none'; }, inputCallback: function(query) { currentQuery = query; currentLimit = 40; // Reset limit when new search is performed } }) </script> <script> function triggerInputEvent() { //AP: Support multiple searchboxes and query params const searchInput = document.getElementById('search-input') const loadingGif = document.getElementById('loading-gif'); // Get the loading gif element const searchParams = new URLSearchParams(window.location.search); const query = searchParams.get('query'); loadingGif.style.display = 'block'; // Show the loading gif searchInput.value = query; const registerInputPromise = new Promise((resolve) => { if (hasInputListener) { resolve(); } else { const intervalId = setInterval(() => { if (hasInputListener) { //console.log("now!") clearInterval(intervalId); resolve(); } else { //console.log("not yet...") } }, 100); } }); registerInputPromise.then(() => { //console.log(query); loadingGif.style.display = 'none'; // Hide the loading gif searchInput.value = query; const inputEvent = new InputEvent('input', { inputType: 'insertText' }); searchInput.dispatchEvent(inputEvent); }); } triggerInputEvent(); document.getElementById("pfocr-search").addEventListener("click", function() { const formElement = document.getElementById("search-input"); const url = "https://pfocr.wikipathways.org/search.html?query=" + encodeURIComponent(formElement.value); window.open(url, '_blank'); }); </script>