mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-07-01 09:43:16 +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() {
|
(function() {
|
||||||
|
|
||||||
$tw.SqlConsole = function SqlConsole() {
|
$tw.SqlConsole = function SqlConsole() {
|
||||||
|
var self = this;
|
||||||
// Container
|
// Container
|
||||||
this.consoleContainer = document.createElement("div");
|
this.consoleContainer = document.createElement("div");
|
||||||
this.consoleContainer.appendChild(document.createTextNode("console for sqlite3"));
|
this.consoleContainer.appendChild(document.createTextNode("console for sqlite3"));
|
||||||
// Input box
|
// Input box
|
||||||
this.consoleInput = document.createElement("textarea");
|
this.consoleInput = document.createElement("textarea");
|
||||||
|
this.consoleInput.setAttribute("rows","10");
|
||||||
this.consoleInput.style.width = "100%";
|
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);
|
this.consoleContainer.appendChild(this.consoleInput);
|
||||||
// Run button
|
// Run button
|
||||||
this.consoleRunButton = document.createElement("button");
|
this.consoleRunButton = document.createElement("button");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user