Change last updated text on success

This commit is contained in:
billz 2020-04-02 08:12:59 +01:00
parent 86133c80ff
commit 4eb6a5a2f7
2 changed files with 8 additions and 5 deletions

View file

@ -291,9 +291,9 @@ function loadChannelSelect(selected) {
}); });
} }
/* Updates the selected ad blocklist /* Updates the selected blocklist
* Request is passed to an ajax handler to download the associated list * Request is passed to an ajax handler to download the associated list.
* * Interface elements are updated to indicate current progress, status.
*/ */
function updateBlocklist() { function updateBlocklist() {
var blocklist_id = $('#cbxblocklist').val(); var blocklist_id = $('#cbxblocklist').val();
@ -305,6 +305,7 @@ function updateBlocklist() {
if (jsonData['return'] == '0') { if (jsonData['return'] == '0') {
$('#cbxblocklist-status').find('i').removeClass('fas fa-cog fa-spin').addClass('fas fa-check'); $('#cbxblocklist-status').find('i').removeClass('fas fa-cog fa-spin').addClass('fas fa-check');
$('#cbxblocklist-status').removeClass('check-progress').addClass('check-updated').delay(500).animate({ opacity: 1 }, 700); $('#cbxblocklist-status').removeClass('check-progress').addClass('check-updated').delay(500).animate({ opacity: 1 }, 700);
$('#'+blocklist_id).text("Just now");
} }
}) })
} }

View file

@ -19,8 +19,10 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<p id="blocklist-updated"> <p id="blocklist-updated">
<div><small><?php echo _("Hostnames blocklist last updated") ?>: <b><?php echo blocklistUpdated('hostnames.txt') ?></b></small></div> <div><small><?php echo _("Hostnames blocklist last updated") ?>: <span class="font-weight-bold" id="notracking-hostnames">
<div><small><?php echo _("Domains blocklist last updated") ?>: <b><?php echo blocklistUpdated('domains.txt') ?></b></small></div> <?php echo blocklistUpdated('hostnames.txt') ?></span></small></div>
<div><small><?php echo _("Domains blocklist last updated") ?>: <span class="font-weight-bold" id="notracking-domains">
<?php echo blocklistUpdated('domains.txt') ?></b></small></div>
</p> </p>
<div class="input-group col-md-12 mb-4"> <div class="input-group col-md-12 mb-4">
<select class="custom-select custom-select-sm" id="cbxblocklist" onchange="clearBlocklistStatus()"> <select class="custom-select custom-select-sm" id="cbxblocklist" onchange="clearBlocklistStatus()">