Skip to content

Commit

Permalink
added font spacing option
Browse files Browse the repository at this point in the history
  • Loading branch information
unhandyandy committed Sep 10, 2024
1 parent 5ba3ada commit 83921bf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions annotationAid/blank.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<option>Controls</option>
<option>Transl. Win.</option>
<option id="wordStartOpt">Word Start</option>
<option id="fontSpacing">Font Spacing</option>
<option>Find Note</option>
<option>Lang->Search</option>
<option>Export</option>
Expand Down
11 changes: 10 additions & 1 deletion annotationAid/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ function saveInnards(){
"translation":transText.value,
"href":searchStr,
"wordStart":wordStart,
"savePrefix":savePrefix }
"savePrefix":savePrefix,
"fontFamily":inputText.style.fontFamily }
localStorage.setItem(title,JSON.stringify(storageObj));
const langObj = {
"vocabulary":vocabulary,
Expand Down Expand Up @@ -254,6 +255,7 @@ function restore(){
searchStr = storageObj["href"];
wordStart = storageObj["wordStart"];
savePrefix = storageObj["savePrefix"];
inputText.style.fontFamily = storageObj["fontFamily"];
}
restoreLang(savePrefix);
setWSBText();
Expand Down Expand Up @@ -637,11 +639,18 @@ function controlHandler(e){
makeSearchStr(); }
else if(v==="Export"){
exportText(); }
else if(v==="Font Spacing"){
toggleFS(); }
else if(v!=="Controls"){
toggleWS(); }
controlSelector.value = "Controls";
}

function toggleFS(){
const ff = inputText.style.fontFamily;
inputText.style.fontFamily = (ff==="monospace") ? "proportional" : "monospace";
}

function prosodyHandler(e){
const v = e.target.value;
const sel = window.getSelection();
Expand Down
2 changes: 1 addition & 1 deletion annotationAid/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
overflow-y:scroll;
float: left;
font-size:large;
font-family: monospace;
/* font-family: monospace; */
/* writing-mode: vertical-rl; */
}

Expand Down

0 comments on commit 83921bf

Please sign in to comment.