diff options
author | Marvin Borner | 2018-07-20 13:57:57 +0200 |
---|---|---|
committer | Marvin Borner | 2018-07-20 13:57:57 +0200 |
commit | 932d439444f10774bff546923cc0a2e5e2f2857b (patch) | |
tree | ef9bcc039d263f929b4f4991881a52a8343c1dfe /resources/assets/js/profile.js | |
parent | bd04ac097a0a29ba7c48a5f4a46d99ae7d86eea1 (diff) |
Rewrite (only for backend/oauth/api use from now on)
Diffstat (limited to 'resources/assets/js/profile.js')
-rwxr-xr-x | resources/assets/js/profile.js | 39 |
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 |