{% extends 'settings/master.twig' %}
{% set category = 'Account' %}
{% block js %}
<script>
function updateSettings(form, action) {
var forms = {},
dialogue = new Sakura.Dialogue,
updater = new Sakura.AJAX;
dialogue.AddCallback(Sakura.DialogueButton.Ok, function () {
this.Close();
});
for (var a = 0; a < form.elements.length; a++) {
forms[form.elements.item(a).name] = form.elements.item(a).value;
}
updater.SetUrl(action);
updater.Form();
updater.SetSend(forms);
updater.AddCallback(0, function () {
var resp = updater.JSON();
dialogue.Text = resp.error || 'Updated!';
dialogue.Display();
updater.Start(Sakura.HTTPMethod.POST);
return false;
</script>
{% endblock %}