mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-28 23:10:46 +00:00
SQL console - process query on enter key
This commit is contained in:
parent
979a1f746d
commit
88c8c2c9f3
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user