diff --git a/templates/index/index.html b/templates/index/index.html index 7280ab8b..7995fadb 100644 --- a/templates/index/index.html +++ b/templates/index/index.html @@ -64,8 +64,12 @@
- Example 1 - Example 2 + Caffeine + Ibuprofen
Advanced
@@ -118,7 +122,6 @@

About enviPath

-

enviPath is a database and prediction system for the microbial biotransformation of organic environmental contaminants. The @@ -301,6 +304,31 @@ checkKetcherReady(); }); + // Handle example link clicks + $('.example-link').on('click', function(e) { + e.preventDefault(); + const smiles = $(this).data('smiles'); + const title = $(this).attr('title'); + + // Check if we're in Ketcher mode or text input mode + if ($('input[type="checkbox"]').is(':checked')) { + // In Ketcher mode - set the SMILES in Ketcher + if (window.indexKetcher && window.indexKetcher.setMolecule) { + window.indexKetcher.setMolecule(smiles); + } + } else { + // In text input mode - set the SMILES in the text input + $('#index-form-text-input').val(smiles); + } + + // Show a brief feedback + const originalText = $(this).text(); + $(this).text(`loaded!`); + setTimeout(() => { + $(this).text(originalText); + }, 1000); + }); + // Handle form submission on Enter $('#index-form').on("submit", function (e) { e.preventDefault();