From: David ‘Bombe’ Roden Date: Fri, 14 Jan 2011 21:14:31 +0000 (+0100) Subject: Add function that deletes a profile field. X-Git-Tag: 0.4^2~9^2~10 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=d6e7b15e85ae5f0b68b3dcf0d4dde47dc46c37ad Add function that deletes a profile field. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 3c229e0..7ab0a76 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -862,6 +862,20 @@ function showNotificationDetails(notificationId) { $("#sone .notification#" + notificationId + " .short-text").hide(); } +/** + * Deletes the field with the given ID from the profile. + * + * @param fieldId + * The ID of the field to delete + */ +function deleteProfileField(fieldId) { + $.getJSON("deleteProfileField.ajax", {"formPassword": getFormPassword(), "field": fieldId}, function(data, textStatus) { + if (data && data.success) { + $("#sone .profile-field#" + data.field.id).slideUp(); + } + }); +} + // // EVERYTHING BELOW HERE IS EXECUTED AFTER LOADING THE PAGE //