WIP: Aureplop/kpsul js refactor #501
3 changed files with 15 additions and 15 deletions
|
@ -135,7 +135,7 @@ $(document).ready(function() {
|
|||
// Synchronization
|
||||
// -----
|
||||
|
||||
OperationWebSocket.add_handler(history.update_data);
|
||||
OperationWebSocket.add_handler(data => history.update_data(data));
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -667,19 +667,6 @@ $(document).ready(function() {
|
|||
}
|
||||
|
||||
|
||||
// -----
|
||||
// Synchronization
|
||||
// -----
|
||||
|
||||
OperationWebSocket.add_handler(kpsul.history.update_data);
|
||||
OperationWebSocket.add_handler(kpsul.article_manager.update_data);
|
||||
OperationWebSocket.add_handler(function(data) {
|
||||
if (data['addcost']) {
|
||||
Config.set('addcost_for', data['addcost']['for']);
|
||||
Config.set('addcost_amount', data['addcost']['amount']);
|
||||
displayAddcost();
|
||||
}
|
||||
});
|
||||
|
||||
// -----
|
||||
// General
|
||||
|
@ -789,6 +776,20 @@ $(document).ready(function() {
|
|||
|
||||
window.kpsul = new KPsulManager(env);
|
||||
|
||||
// -----
|
||||
// Synchronization
|
||||
// -----
|
||||
|
||||
OperationWebSocket.add_handler(data => kpsul.history.update_data(data));
|
||||
OperationWebSocket.add_handler(data => kpsul.article_manager.update_data(data));
|
||||
OperationWebSocket.add_handler(function(data) {
|
||||
if (data['addcost']) {
|
||||
Config.set('addcost_for', data['addcost']['for']);
|
||||
Config.set('addcost_amount', data['addcost']['amount']);
|
||||
displayAddcost();
|
||||
}
|
||||
});
|
||||
|
||||
hardReset();
|
||||
|
||||
});
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
<script type="text/javascript" src="{% static 'kfet/js/moment-fr.js' %}"></script>
|
||||
<script type="text/javascript" src="{% static 'kfet/js/moment-timezone-with-data-2010-2020.js' %}"></script>
|
||||
<script type="text/javascript" src="{% url 'js_reverse' %}"></script>
|
||||
<script type="text/javascript" src="{% static 'kfet/js/kfet.js' %}"></script>
|
||||
<script type="text/javascript" src="{% static 'kfet/js/kfet.api.js' %}"></script>
|
||||
<script type="text/javascript" src="{% static 'kfet/js/history.js' %}"></script>
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue