From 0a4febf1eba98366d70331512b02aa9e515a782d Mon Sep 17 00:00:00 2001 From: kondou Date: Sun, 18 Aug 2013 22:10:23 +0200 Subject: Integrate newavatar.php into avatar.php by using GET, POST & DELETE --- settings/ajax/newavatar.php | 33 --------------------------------- settings/js/personal.js | 11 ++++++++--- settings/routes.php | 2 -- settings/templates/personal.php | 2 +- 4 files changed, 9 insertions(+), 39 deletions(-) delete mode 100644 settings/ajax/newavatar.php (limited to 'settings') diff --git a/settings/ajax/newavatar.php b/settings/ajax/newavatar.php deleted file mode 100644 index 126f3283fb3..00000000000 --- a/settings/ajax/newavatar.php +++ /dev/null @@ -1,33 +0,0 @@ - array ("message" => $e->getMessage()) )); -} 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(); + } + }); }); } ); diff --git a/settings/routes.php b/settings/routes.php index 7d323008419..9a27c3e439b 100644 --- a/settings/routes.php +++ b/settings/routes.php @@ -72,5 +72,3 @@ $this->create('isadmin', '/settings/js/isadmin.js') ->actionInclude('settings/js/isadmin.php'); $this->create('settings_ajax_setavatarmode', '/settings/ajax/setavatarmode.php') ->actionInclude('settings/ajax/setavatarmode.php'); -$this->create('settings_ajax_newavatar', '/settings/ajax/newavatar.php') - ->actionInclude('settings/ajax/newavatar.php'); diff --git a/settings/templates/personal.php b/settings/templates/personal.php index 8d0667f9564..7832c79894b 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -84,7 +84,7 @@ if($_['passwordChangeSupported']) { ?> -
+
t('Profile Image')); ?>
-- cgit v1.2.3