Skip to content

Commit

Permalink
Add control to show DB details for selected characters. Move Characte…
Browse files Browse the repository at this point in the history
…r Markup control into pulldown.
  • Loading branch information
r12a committed Nov 12, 2024
1 parent 96980e6 commit 8052b2a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
11 changes: 11 additions & 0 deletions shared29/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,17 @@ function openEscapeWindow () {
converter.focus()
}

function openCharNoteWindow () {
var output, chars, char
output = document.getElementById('output')
chars = getHighlightedText(output)
suppchars = [... chars].join('')

var notes = window.open(`../../scripts/${ template.noteslocation }-characters.html?q=${ suppchars }`, 'notes')
output.focus()
notes.focus()
}

function openUniViewWindow () {
var output = document.getElementById('output')
var chars = getHighlightedText(output)
Expand Down
11 changes: 7 additions & 4 deletions shared29/pagetemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@ for (let i=0;i<window.controls.length;i++){
}

out += `
<button id="makeExample" onclick="makeExample(defaults.language,template.direction)" title="Create source code for an example. native|meaning|IPA|transcription" onMouseOver="showMenuText(this.title,'tan')" onMouseOut="hideMenuText()">Example<br>markup</button>
<button onclick="openVocabWindow(template.vocablocation); return false;" title="Search for examples containing the highlighted text." onMouseOver="showMenuText(this.title,'tan')" onMouseOut="hideMenuText()">Find<br>examples</button>
<button id="makeExample" onclick="makeExample(defaults.language,template.direction)" title="Create source code for an example. native|meaning|IPA|transcription" onMouseOver="showMenuText(this.title,'tan')" onMouseOut="hideMenuText()">Example<br>markup</button>
<button id="makeCharLink" type="button" onclick="makeCharLink(template.blocklocation,defaults.language,template.direction)" title="Create source code for a character link." onMouseOver="showMenuText(this.title,'tan')" onMouseOut="hideMenuText()">Character<br/>markup</button>
<button id="showNotesLink" type="button" onclick="openCharNoteWindow()" title="Show detailed notes for the first character." onMouseOver="showMenuText(this.title,'tan')" onMouseOut="hideMenuText()">Show DB<br/>details</button>
<img src="../shared29/images/toprow/export.svg" alt="Export to other apps" style="vertical-align: middle; margin-block-end:.2rem; margin-inline-start:1rem; margin-inline-end:.3rem; cursor:pointer; height:1.7rem;" onclick="if (document.getElementById(\'shuttle\').style.display===\'none\'){document.getElementById(\'shuttle\').style.display=\'block\'} else { document.getElementById(\'shuttle\').style.display=\'none\' }; document.getElementById(\'pulldown\').style.display=\'none\'; document.getElementById(\'output\').focus();" onmouseover="showMenuText('Export the text in the text area to another app. Many options work on highlighted ranges.','tan');" onmouseout="hideMenuText()">
Expand All @@ -350,11 +350,12 @@ out += `
<div id="shuttle" style="display:none;" onMouseUp="this.style.display=\'none\'; document.getElementById(\'output\').focus();">
<div>
`

/*
if (template.vocablocation) out += `
<button onclick="openVocabWindow(template.vocablocation); return false;" title="Search for examples containing the highlighted text." onMouseOver="showMenuText(this.title,'tan')" onMouseOut="hideMenuText()">Find examples</button>
`
*/

out += `
<button onclick="openEscapeWindow(); return false;" title="Convert to escapes." onMouseOver="showMenuText(this.title,'tan')" onMouseOut="hideMenuText()">Convert to escapes</button>
Expand Down Expand Up @@ -398,6 +399,8 @@ out += `
<!--button onclick="openEscapeWindow(); return false;" title="Convert to escapes (in a separate window)." onMouseOver="showMenuText(this.title,'tan')" onMouseOut="hideMenuText()">Convert to<br/>escapes</button><br/-->
<button id="makeCharLink" type="button" onclick="makeCharLink(template.blocklocation,defaults.language,template.direction)" title="Create source code for a character link." onMouseOver="showMenuText(this.title,'tan')" onMouseOut="hideMenuText()">Create character markup</button>
<button id="showDBAll" type="button" onclick="getDBInfo(template.blocklocation,defaults.language,template.direction, true)" title="Show all information in the database for each character." onMouseOver="showMenuText(this.title,'tan')" onMouseOut="hideMenuText()">Show all db entries</button>
<button id="vocab2Markup" type="button" onclick="vocab2Markup(getHighlightedText(document.getElementById('output')))" title="Convert a vocab entry to example markup." onMouseOver="showMenuText(this.title,'tan')" onMouseOut="hideMenuText()">Vocab to markup</button>
Expand Down
2 changes: 1 addition & 1 deletion tayo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
<span class="g"><span class="c">&#x1E6CD;</span><span class="hint">t</span></span>
<span class="g"><span class="c">&#x1E6CB;</span><span class="hint">d</span></span>
<span class="g"><span class="c"> </span><span class="hint"> </span></span>
<span class="g"><span class="c">&#x1E6C1;</span><span class="hint">k</span></span>
<span class="g"><span class="c">&#x1E6C1;</span><span class="hint">g</span></span>
<span class="g"><span class="c">&#x1E6C3;</span><span class="hint"></span></span>
<span class="g"><span class="c">&#x1E6C4;</span><span class="hint">g</span></span>
</div>
Expand Down

0 comments on commit 8052b2a

Please sign in to comment.