WIP: Aureplop/kpsul js refactor #501

Draft
delobell wants to merge 215 commits from aureplop/kpsul_js_refactor into master
Showing only changes of commit 72970c6be7 - Show all commits

View file

@ -4,6 +4,7 @@
{% block extra_head %}
<link rel="stylesheet" type="text/css" href="{% static 'kfet/css/transfers_form.css' %}">
<script type="text/javascript" src="{% static 'kfet/js/js.cookie.js' %}"></script>
<script type="text/javascript" src="{% url 'js_reverse' %}"></script>
{% endblock %}
{% block title %}Nouveaux transferts{% endblock %}
@ -51,14 +52,12 @@
<script type="text/javascript">
$(document).ready(function () {
function getAccountData(trigramme, callback = function() {}) {
$.ajax({
dataType: "json",
url : "{% url 'kfet.account.read.json' %}",
method : "POST",
data : { trigramme: trigramme },
success : callback,
});
function getAccountData(trigramme, callback) {
callback = callback || $.noop;
$.getJSON(Urls['kfet.account.read'](trigramme), {
'format': 'json',
})
.done(callback);
}
function updateAccountData(trigramme, $input) {