aboutsummaryrefslogtreecommitdiff
path: root/javascript/edit-attention.js
diff options
context:
space:
mode:
authorAarni Koskela <akx@iki.fi>2023-04-30 22:08:52 +0300
committerAarni Koskela <akx@iki.fi>2023-04-30 22:08:52 +0300
commit8ccc27127bd5abcba05f30f8a72fc37025b588ac (patch)
treed9bd30fb6e301ff996d2889d54304c089c73bee8 /javascript/edit-attention.js
parent34a6ad80d5a3d6670a9e89089558e724d8c9f8bd (diff)
Fix a whole bunch of implicit globals
Diffstat (limited to 'javascript/edit-attention.js')
-rw-r--r--javascript/edit-attention.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/javascript/edit-attention.js b/javascript/edit-attention.js
index 588c7b77..d2c2f190 100644
--- a/javascript/edit-attention.js
+++ b/javascript/edit-attention.js
@@ -69,8 +69,8 @@ function keyupEditAttention(event){
event.preventDefault();
- closeCharacter = ')'
- delta = opts.keyedit_precision_attention
+ var closeCharacter = ')'
+ var delta = opts.keyedit_precision_attention
if (selectionStart > 0 && text[selectionStart - 1] == '<'){
closeCharacter = '>'
@@ -91,8 +91,8 @@ function keyupEditAttention(event){
selectionEnd += 1;
}
- end = text.slice(selectionEnd + 1).indexOf(closeCharacter) + 1;
- weight = parseFloat(text.slice(selectionEnd + 1, selectionEnd + 1 + end));
+ var end = text.slice(selectionEnd + 1).indexOf(closeCharacter) + 1;
+ var weight = parseFloat(text.slice(selectionEnd + 1, selectionEnd + 1 + end));
if (isNaN(weight)) return;
weight += isPlus ? delta : -delta;