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): ...@@ -96,8 +96,4 @@ def media(share_id, file_id):
@app.route('/upload', methods=['GET', 'POST']) @app.route('/upload', methods=['GET', 'POST'])
def upload(): def upload():
if request.method == 'POST': return render_template('Upload.html')
# finalize \ No newline at end of file
return render_template('Shared.html', url='HALLO')
return render_template('Upload.html')
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<h1>Über</h1> <h1>Über</h1>
<p> <p>
Diese Seite ist aus Trauer um Firefox Send entstanden. 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> </p>
<h2>Impressum</h2> <h2>Impressum</h2>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</div> </div>
<div class="card mb-4 text-center shadow" id="app"> <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"> <div class="card-header">
<h4 class="my-0 font-weight-normal"> <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=""> <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 @@ ...@@ -40,25 +40,14 @@
</div> </div>
<div class="form-group"> <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>
</div> </div>
</form> </form>
</div> </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 src="{{ url_for('static', filename='js/jquery.form.min.js') }}"></script>
<script>
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
}
})
</script>
<style> <style>
.truncate { .truncate {
width: 100%; width: 100%;
...@@ -80,16 +69,40 @@ ...@@ -80,16 +69,40 @@
}); });
</script> </script>
<script> <script>
let share = {}
function openShare() { 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() { function uploadFile() {
closeShare();
} }
function 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>
<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