From 74268996ef69be1af6166dac0ef5f38e58ed6ad5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 15 Jan 2011 01:09:05 +0100 Subject: [PATCH] Add method that renames a profile field. --- src/main/resources/static/javascript/sone.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 // -- 2.7.4