Commit 4f66669f authored by Lukas Böhm's avatar Lukas Böhm
Browse files

first steps

parent 02984a14
......@@ -96,8 +96,4 @@ def media(share_id, file_id):
@app.route('/upload', methods=['GET', 'POST'])
def upload():
if request.method == 'POST':
# finalize
return render_template('Shared.html', url='HALLO')
return render_template('Upload.html')
return render_template('Upload.html')
\ No newline at end of file
......@@ -11,7 +11,7 @@
<h1>Über</h1>
<p>
Diese Seite ist aus Trauer um Firefox Send entstanden.
<a class="nav-link" href="https://gitlab.cs.fau.de/ib49uquh/chiefsend">Quellcode</a>
<a class="nav-link" href="https://gitlab.cs.fau.de/chiefs/chiefsend2">Quellcode</a>
</p>
<h2>Impressum</h2>
......
......@@ -7,7 +7,7 @@
</div>
<div class="card mb-4 text-center shadow" id="app">
<form method="post" enctype="multipart/form-data">
<form enctype="multipart/form-data" id="form">
<div class="card-header">
<h4 class="my-0 font-weight-normal">
<input autocomplete="off" class="form-control" id="name" maxlength="64" name="name" placeholder="Name vergeben (optional)" size="64" type="text" value="">
......@@ -40,25 +40,14 @@
</div>
<div class="form-group">
<input class="btn btn-lg btn-block btn-primary" id="submit" name="submit" type="button" value="Hochladen">
<input class="btn btn-lg btn-block btn-primary" id="submit" name="submit" type="button" value="Hochladen" onclick="openShare()">
</div>
</div>
</form>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script src="{{ url_for('static', filename='js/jquery.form.min.js') }}"></script>
<script>
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
}
})
</script>
{# <script src="{{ url_for('static', filename='js/jquery.form.min.js') }}"></script>#}
<style>
.truncate {
width: 100%;
......@@ -80,16 +69,40 @@
});
</script>
<script>
let share = {}
function openShare() {
$.ajax()
$.ajax({
"url": "http://localhost:6969/shares",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json"
},
"data": JSON.stringify({}),
}).done((response) => {
share = response;
disableAll();
uploadFile();
});
}
function uploadFile() {
closeShare();
}
function closeShare() {
$.ajax({
"url": `http://localhost:6969/share/${ share.id }`,
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json"
},
"data": JSON.stringify({}),
}).done(() => {
window.location.href = "/d/" + share.id
});
}
</script>
<script>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment