From 14b922634d52dbcae0725f793299b8113abce052 Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Sat, 18 Mar 2017 02:28:01 -0300 Subject: [PATCH] Remove deprecated history functions --- kfet/templates/kfet/kpsul.html | 127 ++------------------------------- 1 file changed, 6 insertions(+), 121 deletions(-) diff --git a/kfet/templates/kfet/kpsul.html b/kfet/templates/kfet/kpsul.html index f653ae61..e12e836d 100644 --- a/kfet/templates/kfet/kpsul.html +++ b/kfet/templates/kfet/kpsul.html @@ -157,9 +157,6 @@ -
-
- @@ -299,55 +296,6 @@ $(document).ready(function() { performOperations(); }); - // ----- - // Cancel operations - // ----- - - var cancelButton = $('#cancel_operations'); - var cancelForm = $('#cancel_form'); - - function cancelOperations(opes_array, password = '') { - if (lock == 1) - return false - lock = 1; - var data = { 'operations' : opes_array } - $.ajax({ - dataType: "json", - url : "{% url 'kfet.kpsul.cancel_operations' %}", - method : "POST", - data : data, - beforeSend: function ($xhr) { - $xhr.setRequestHeader("X-CSRFToken", csrftoken); - if (password != '') - $xhr.setRequestHeader("KFetPassword", password); - }, - - }) - .done(function(data) { - coolReset(); - lock = 0; - }) - .fail(function($xhr) { - var data = $xhr.responseJSON; - switch ($xhr.status) { - case 403: - requestAuth(data, function(password) { - cancelOperations(opes_array, password); - }, account_manager._$input_trigramme); - break; - case 400: - displayErrors(getErrorsHtml(data)); - break; - } - lock = 0; - }); - } - - // Event listeners - cancelButton.on('click', function() { - cancelOperations(); - }); - // ----- // Articles data // ----- @@ -625,29 +573,6 @@ $(document).ready(function() { formset_container.find('#id_form-'+opeindex+'-DELETE').prop('checked', true); } - // ----- - // History - // ----- - - var khistory = new KHistory(); - - function getHistory() { - var data = { - from: moment().subtract(1, 'days').format('YYYY-MM-DD HH:mm:ss'), - }; - $.ajax({ - dataType: "json", - url : "{% url 'kfet.history.json' %}", - method : "POST", - data : data, - }) - .done(function(data) { - for (var i=0; i 0) - cancelOperations(opes_to_cancel); - } - }); - // ----- // Synchronization // ----- @@ -781,29 +676,19 @@ $(document).ready(function() { socket.onmessage = function(e) { var data = $.extend({}, websocket_msg_default, JSON.parse(e.data)); - for (var i=0; i