aboutsummaryrefslogtreecommitdiffhomepage
path: root/resources/assets/js/profile.js
diff options
context:
space:
mode:
Diffstat (limited to 'resources/assets/js/profile.js')
-rwxr-xr-xresources/assets/js/profile.js39
1 files changed, 0 insertions, 39 deletions
diff --git a/resources/assets/js/profile.js b/resources/assets/js/profile.js
deleted file mode 100755
index d834542..0000000
--- a/resources/assets/js/profile.js
+++ /dev/null
@@ -1,39 +0,0 @@
-$("#avatarFile").on("change", () => {
- var preview = document.querySelector('#image-preview');
- var file = document.querySelector("#avatarFile").files[0];
- var reader = new FileReader();
-
- reader.addEventListener("load", () => {
- preview.src = reader.result;
- }, false);
-
- if (file) {
- reader.readAsDataURL(file);
- }
-});
-
-$("#avatarForm").submit(function (e) {
- var url = "/avatar";
- var data = new FormData();
- $.each(jQuery('#avatarFile')[0].files, (i, file) => {
- data.append('avatar', file);
- });
-
- e.preventDefault();
- $.ajax({
- url: url,
- data: data,
- cache: false,
- contentType: false,
- processData: false,
- method: 'POST',
- type: 'POST',
- success: (data) => {
- $("#avatarUploadSucceededAlert").show();
- $("#avatarUploadSucceededMessage").text(data.success);
- },
- error: () => {
- $("#avatarUploadFailedAlert").show();
- }
- });
-}); \ No newline at end of file