-
+
diff --git a/templates/profile.j2 b/templates/profile.j2
index f337ecd..7fef803 100644
--- a/templates/profile.j2
+++ b/templates/profile.j2
@@ -16,16 +16,18 @@
+
+
Your Pastes
Shortened Urls
- {{ table.build(links) }}
+ {{ table.build(links, 'links') }}
Pastes
- {{ table.build(pastes) }}
+ {{ table.build(pastes, 'pastes') }}
Images
- {{ table.build(images) }}
+ {{ table.build(images, 'images') }}
{% endblock %}
@@ -45,11 +47,11 @@ function showSuccess(message) {
$('#success-alert').show();
}
-function hideError(error) {
+function hideError() {
$('#error-alert').hide();
}
-function hideSuccess(error) {
+function hideSuccess() {
$('#success-alert').hide();
}
@@ -57,5 +59,33 @@ function showApps () {
$("#apps").toggle();
$("#overlay").toggle();
}
+
+const deleteEntry = (game, table) => {
+ fetch('/delete', {
+ method: 'POST',
+ headers: { "Content-Type": "application/json; charset=utf-8" },
+ body: JSON.stringify({'table': table, 'id': game})
+ })
+ .then(res => res.json()) // parse response as JSON (can be res.text() for plain response)
+ .then(response => {
+ // here you do what you want with response
+ console.log(response);
+
+ if (response.success) {
+ showSuccess(response.msg);
+ hideError();
+ document.querySelector('#' + table + "-" + game).remove();
+ } else {
+ showError(response.msg);
+ hideSuccess();
+ }
+ })
+ .catch(err => {
+ console.log(err);
+
+ showError('An error occured!');
+ hideSuccess();
+ });
+};
{% endblock %}
\ No newline at end of file
diff --git a/templates/text.html b/templates/text.html
deleted file mode 100644
index b8c442a..0000000
--- a/templates/text.html
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
CodeMirror!
-
-
-
\ No newline at end of file