From 0a4febf1eba98366d70331512b02aa9e515a782d Mon Sep 17 00:00:00 2001 From: kondou <kondou@ts.unde.re> Date: Sun, 18 Aug 2013 22:10:23 +0200 Subject: Integrate newavatar.php into avatar.php by using GET, POST & DELETE --- settings/js/personal.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'settings/js') diff --git a/settings/js/personal.js b/settings/js/personal.js index 74ea7f26ebf..dd2d15052d1 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -45,7 +45,7 @@ function changeDisplayName(){ } function selectAvatar (path) { - $.post(OC.filePath('settings', 'ajax', 'newavatar.php'), {path: path}, function(data) { + $.post(OC.filePath('', '', 'avatar.php'), {path: path}, function(data) { if (data.status === "success") { updateAvatar(); } else { @@ -168,8 +168,13 @@ $(document).ready(function(){ }); $('#removeavatar').click(function(){ - $.post(OC.filePath('settings', 'ajax', 'newavatar.php'), {path: false}); - updateAvatar(); + $.ajax({ + type: 'DELETE', + url: OC.filePath('', '', 'avatar.php'), + success: function(msg) { + updateAvatar(); + } + }); }); } ); -- cgit v1.2.3