-
Notifications
You must be signed in to change notification settings - Fork 31
Custom Javascript Library for Libki Server
Kyle M Hall edited this page Mar 23, 2023
·
6 revisions
$(document).ready(function() {
$("#reservations-tab").hide();
});$(document).ready(function() {
$("#reservations-tab").hide();
});$(document).ready(function() {
$('#client-table').on('init.dt', function() {
const mapping = {
"username1": "Location 1",
"username2": "Location 2",
"username3": "Location 3"
}
const username = $("#libki-primary-navbar .fa-user").parent().text().replace(/\s/g, '');
const label = $('a.nav-link:contains("Location:")');
const location = mapping[username];
if (location) {
window.location_filter = location;
const link = $(`a.nav-link:contains(${location})`);
$('#primary-tabs a.nav-link').hide();
label.show();
link.show();
setTimeout(function() {
$("#client-table").dataTable().fnDraw(true);
}, 500);
setTimeout(function() {
$("#client-table").dataTable().fnDraw(true);
}, 1000);
setTimeout(function() {
$("#client-table").dataTable().fnDraw(true);
}, 2000);
}
});
});$(document).ready(function() {
$('.shutdown-button').hide();
$('.nav-item').on('click', function() {
if ($(this).children('a').first().html() === "All") {
$('.shutdown-button').hide();
} else {
$('.shutdown-button').show();
}
});
});$(document).ready(function() {
$('#client-table').on('draw.dt', function() {
$('td:contains(Offline)').parent().css('background-color', 'red');
});
});