Automatically save last executed query to localStorage
This commit is contained in:
parent
2aacab44ec
commit
fb13ce8b07
File diff suppressed because one or more lines are too long
@ -291,6 +291,9 @@ function runQuery() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Automatically save last executed query so its not lost
|
||||||
|
localStorage.setItem("pgweb_query", query);
|
||||||
|
|
||||||
executeQuery(query, function(data) {
|
executeQuery(query, function(data) {
|
||||||
buildTable(data);
|
buildTable(data);
|
||||||
|
|
||||||
@ -360,6 +363,7 @@ function initEditor() {
|
|||||||
editor.getSession().setMode("ace/mode/pgsql");
|
editor.getSession().setMode("ace/mode/pgsql");
|
||||||
editor.getSession().setTabSize(2);
|
editor.getSession().setTabSize(2);
|
||||||
editor.getSession().setUseSoftTabs(true);
|
editor.getSession().setUseSoftTabs(true);
|
||||||
|
|
||||||
editor.commands.addCommands([{
|
editor.commands.addCommands([{
|
||||||
name: "run_query",
|
name: "run_query",
|
||||||
bindKey: {
|
bindKey: {
|
||||||
@ -379,6 +383,12 @@ function initEditor() {
|
|||||||
runExplain();
|
runExplain();
|
||||||
}
|
}
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
var query = localStorage.getItem("pgweb_query");
|
||||||
|
if (query && query.length > 0) {
|
||||||
|
editor.setValue(query);
|
||||||
|
editor.clearSelection();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addShortcutTooltips() {
|
function addShortcutTooltips() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user