This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/resources/views/yuuno/settings/account/master.twig
2016-09-19 21:21:11 +02:00

33 lines
870 B
Twig

{% 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 %}