Merge pull request 'KA CHING!' (#39) from nmeum/matekasse:ka-ching into master
Reviewed-on: anton/matekasse#39
This commit is contained in:
commit
e5bdad65df
4 changed files with 22 additions and 1 deletions
|
@ -57,6 +57,10 @@ def create_app(test_config=None):
|
|||
def socketiojs():
|
||||
return send_file('../static/socket.io.js')
|
||||
|
||||
@app.route('/ka-ching.wav')
|
||||
def kaching():
|
||||
return send_file('../static/ka-ching.wav')
|
||||
|
||||
@app.route('/new.css')
|
||||
def newcss():
|
||||
return send_file('../static/new.min.css')
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
></script>
|
||||
<link rel="stylesheet" href="/new.css">
|
||||
|
||||
<link rel="prefetch" href="/ka-ching.wav" />
|
||||
<link rel="shortcut icon" type="Logo/png" href="/ccc_logo.png"/>
|
||||
{% block customscript %}{% endblock %}
|
||||
</head>
|
||||
|
|
|
@ -4,6 +4,21 @@ Strichliste
|
|||
{% endblock %}
|
||||
{% block customscript %}
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
function play() {
|
||||
return new Promise((resolve, reject) => {
|
||||
var audio = new Audio('/ka-ching.wav');
|
||||
audio.play();
|
||||
|
||||
audio.addEventListener("ended", function(){
|
||||
resolve()
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function ka_ching(element) {
|
||||
await play();
|
||||
element.parentElement.submit();
|
||||
}
|
||||
var socket = io();
|
||||
socket.on("update", function () {
|
||||
window.location = "http://matekasse.server.c3h/list"
|
||||
|
@ -28,7 +43,8 @@ Strichliste
|
|||
</form>
|
||||
<form action="/change" method="post" style="display: inline">
|
||||
<input name="id" type="hidden" value="{{user[0]}}">
|
||||
<button type="submit" name="change" value={{preis}}>{{preis}}€</button>
|
||||
<input name="change" value={{preis}} type="hidden">
|
||||
<button onclick="ka_ching(this)" type="button">{{preis}}€</button>
|
||||
</form>
|
||||
<br style="line-height: 50%;"></br>
|
||||
{% endfor %}
|
||||
|
|
BIN
static/ka-ching.wav
Normal file
BIN
static/ka-ching.wav
Normal file
Binary file not shown.
Loading…
Reference in a new issue