1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-26 15:23:15 +00:00

SQL console - process query on enter key

This commit is contained in:
Jeremy Ruston 2023-07-19 09:04:38 +01:00
parent 979a1f746d
commit 88c8c2c9f3

View File

@ -9,12 +9,22 @@ SQL console for debugging
(function() {
$tw.SqlConsole = function SqlConsole() {
var self = this;
// Container
this.consoleContainer = document.createElement("div");
this.consoleContainer.appendChild(document.createTextNode("console for sqlite3"));
// Input box
this.consoleInput = document.createElement("textarea");
this.consoleInput.setAttribute("rows","10");
this.consoleInput.style.width = "100%";
this.consoleInput.addEventListener("keypress",function(event) {
if(event.key === "Enter") {
console.log("Gto enter")
self.consoleRunButton.click();
event.preventDefault();
return false;
}
});
this.consoleContainer.appendChild(this.consoleInput);
// Run button
this.consoleRunButton = document.createElement("button");