From: David ‘Bombe’ Roden Date: Sat, 15 Jan 2011 00:09:05 +0000 (+0100) Subject: Add method that renames a profile field. X-Git-Tag: 0.4^2~9^2~7 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=74268996ef69be1af6166dac0ef5f38e58ed6ad5 Add method that renames a profile field. --- diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 7ab0a76..2decb69 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -876,6 +876,24 @@ function deleteProfileField(fieldId) { }); } +/** + * Renames a profile field. + * + * @param fieldId + * The ID of the field to rename + * @param newName + * The new name of the field + * @param successFunction + * Called when the renaming was successful + */ +function editProfileField(fieldId, newName, successFunction) { + $.getJSON("editProfileField.ajax", {"formPassword": getFormPassword(), "field": fieldId, "name": newName}, function(data, textStatus) { + if (data && data.success) { + successFunction(); + } + }); +} + // // EVERYTHING BELOW HERE IS EXECUTED AFTER LOADING THE PAGE //