Skip to content

Commit

Permalink
Merge pull request #11 from metrico/query-presets
Browse files Browse the repository at this point in the history
add query presets to playground
  • Loading branch information
lmangani authored Apr 13, 2023
2 parents bbf2ee8 + d30ce59 commit f663dcc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions play.html
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,10 @@
<span class="hint">&nbsp;(Ctrl/Cmd+Enter)</span>
<span id="hourglass"></span>
<span id="check-mark"></span>
<select class="shadow" id="dropdown" style="margin-left: 5px;">
<option value=""></option>
<option value='SELECT version();'>Version</option>
</select>
<span id="stats"></span>
<span id="toggle-dark">🌑</span><span id="toggle-light">🌞</span>
</div>
Expand All @@ -480,6 +484,14 @@
/// This is to avoid race conditions.
let request_num = 0;

// query presets
var querybox = document.getElementById('query');
var querypresets = document.getElementById('dropdown');
querypresets.onchange = function() {
var newquery = querypresets.options[querypresets.selectedIndex].value;
querybox.value = newquery;
}

/// Save query in history only if it is different.
let previous_query = '';

Expand Down

0 comments on commit f663dcc

Please sign in to comment.