<%include include/head.html>
<script language="javascript">
+ function recheckMoveButtons() {
+ $("#sone .profile-field").each(function() {
+ $(".move-up-field", this).toggleClass("hidden", $(this).prev(".profile-field").length == 0);
+ $(".move-down-field", this).toggleClass("hidden", $(this).next(".profile-field").length == 0);
+ });
+ }
+
$(function() {
getTranslation("WebInterface.DefaultText.FirstName", function(firstNameDefaultText) {
registerInputTextareaSwap("#sone #edit-profile input[name=first-name]", firstNameDefaultText, "first-name", true, true);
buttonName = confirmButton.attr("name");
fieldId = buttonName.substring("delete-field-".length);
deleteProfileField(fieldId);
+ recheckMoveButtons();
return false;
});
})($(this), confirmButton);
});
})($(this), inputField, confirmButton, cancelButton, fieldNameElement);
});
+
+ /* ajaxify “move up” and “move down” buttons. */
+ $("#sone .profile-field .move-down-field button").click(function() {
+ profileField = $(this).parents(".profile-field");
+ moveProfileFieldDown(profileField.attr("id"), function() {
+ next = profileField.next();
+ current = profileField.insertAfter(next);
+ recheckMoveButtons();
+ });
+ return false;
+ });
+ $("#sone .profile-field .move-up-field button").click(function() {
+ profileField = $(this).parents(".profile-field");
+ moveProfileFieldUp(profileField.attr("id"), function() {
+ previous = profileField.prev();
+ current = profileField.insertBefore(previous);
+ recheckMoveButtons();
+ });
+ return false;
+ });
});
</script>