enter key

This commit is contained in:
Kyle
2019-04-18 20:12:57 -07:00
parent 3f7a20170a
commit ddb3440cb3
2 changed files with 10 additions and 1 deletions

View File

@@ -28,6 +28,15 @@ function scrollFunction() {
} }
} }
function textAreaKeyPressed() {
if (event.keyCode == 13) {
setTimeout(function() {
cursorIndex = document.getElementById("inputText").selectionStart
document.getElementById("inputText").value = document.getElementById("inputText").value.slice(0, cursorIndex) + "{line}" + document.getElementById("inputText").value.slice(cursorIndex, 0)
}, 5)
}
}

View File

@@ -246,7 +246,7 @@
<br><br> <br><br>
Rules Text Rules Text
<br> <br>
<textarea id="inputText" class="input" rows="5" cols="40" style="width: 100%; resize: none; height: 200px" placeholder="Remember to include curly brackets ('{' and '}') around each code. To skip to the next line use {line}. See 'Mana Symbols' and 'Other Codes' (below) for more information." oninput="sectionTextFunction()"></textarea> <textarea id="inputText" class="input" rows="5" cols="40" style="width: 100%; resize: none; height: 200px" placeholder="Remember to include curly brackets ('{' and '}') around each code. To skip to the next line use {line}. See 'Mana Symbols' and 'Other Codes' (below) for more information." oninput="sectionTextFunction()" onkeypress="textAreaKeyPressed()"></textarea>
<br> <br>
Rules Text Font Size Rules Text Font Size
<input id="inputTextSize" type="number" class="input" min="0" value="37" step="0.5" oninput="sectionTextFunction()"> <input id="inputTextSize" type="number" class="input" min="0" value="37" step="0.5" oninput="sectionTextFunction()">