kopia lustrzana https://github.com/simonw/datasette
include license for sqlformatter, only show button with js enabled
rodzic
316b6db666
commit
86ac746cfc
|
@ -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
|
@ -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>
|
||||
|
|
|
@ -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 %}
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Ładowanie…
Reference in New Issue