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