mirror of
https://github.com/kennethreitz/rhymepad.org.git
synced 2026-06-11 17:08:33 +00:00
Multi-anchor rhyme keys + Dictionary mode in the sidebar
KET-a-mine can now rhyme from its first primary stress, not just its dictionary-final one, so it joins meth-am-PHET-a-mine's family; multi buckets claim biggest-first since tokens carry several anchor keys. The lookup panel grew a fourth mode: Dictionary. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+7
-1
@@ -270,8 +270,9 @@ Double-click any word to look it up on the right."></textarea>
|
||||
</div>
|
||||
<div class="seg" id="modeSeg">
|
||||
<button class="active" data-mode="rhyme">Rhymes</button>
|
||||
<button data-mode="near">Near rhymes</button>
|
||||
<button data-mode="near">Near</button>
|
||||
<button data-mode="syn">Synonyms</button>
|
||||
<button data-mode="dict">Dictionary</button>
|
||||
</div>
|
||||
<div id="defBox"></div>
|
||||
<div id="lookupResults">
|
||||
@@ -564,6 +565,11 @@ async function doLookup(){
|
||||
const word = document.getElementById('lookupInput').value.trim();
|
||||
if(!word) return;
|
||||
defBox.innerHTML = '';
|
||||
if(mode === 'dict'){
|
||||
resultsBox.innerHTML = '';
|
||||
showDefinition(word);
|
||||
return;
|
||||
}
|
||||
resultsBox.innerHTML = '<p class="muted">Searching…</p>';
|
||||
try{
|
||||
const r = await fetch(`/api/lookup?word=${encodeURIComponent(word)}&mode=${mode}`);
|
||||
|
||||
Reference in New Issue
Block a user