include license for sqlformatter, only show button with js enabled

pull/181/head
Ben Smithgall 2018-04-09 09:52:16 -04:00
rodzic 316b6db666
commit 86ac746cfc
5 zmienionych plików z 16 dodań i 12 usunięć

Wyświetl plik

@ -133,6 +133,7 @@ form input[type=button]{
line-height: 1;
border-radius: .25rem;
-webkit-appearance: button;
margin-right: 10px;
}
.filter-row {

File diff suppressed because one or more lines are too long

Wyświetl plik

@ -16,7 +16,10 @@
return;
}
document.getElementById('js-format-button').addEventListener(
'click', format, false
);
var input = document.createElement('input');
input.id = 'js-format-sql';
input.type = 'button'
input.value = 'Format SQL';
input.addEventListener('click', format, false);
document.getElementById('js-run-sql').parentNode.appendChild(input);
</script>

Wyświetl plik

@ -19,10 +19,7 @@
<form class="sql" action="/{{ database }}-{{ database_hash }}" method="get">
<h3>Custom SQL query</h3>
<p><textarea name="sql">select * from {{ tables[0].name|escape_sqlite }}</textarea></p>
<p><input type="submit" value="Run SQL"></p>
<p>
<input type="button" value="Format SQL" id="js-format-button">
</p>
<p><input id="js-run-sql" type="submit" value="Run SQL"></p>
</form>
{% for table in tables %}

Wyświetl plik

@ -36,10 +36,7 @@
<p><label for="qp{{ loop.index }}">{{ name }}</label> <input type="text" id="qp{{ loop.index }}" name="{{ name }}" value="{{ value }}"></p>
{% endfor %}
{% endif %}
<p>
<input type="submit" value="Run SQL">
<input type="button" value="Format SQL" id="js-format-button">
</p>
<p><input type="submit" value="Run SQL" id="js-run-sql"></p>
</form>
{% if rows %}