pages/assets/js/no_defer.js
Maruan beb6f27d59
format code with prettier.io (#2048)
summary:
- adds prettier formatter configuration
- formats the entire repo using prettier, ignoring minified files
(`*.min.css`) and heavy generated html
- changes extensions of all `.html` files to `.liquid`, which is more
correct and necessary for prettier to work correctly
- replaces "%-" and "-%" with just "%" — manual liquid formatting using
minus signs is superfluous since we are compressing and minifying the
code anyway
- adds CI action for running prettier check on PR and pushes to master
2024-01-10 00:10:51 -05:00

20 lines
760 B
JavaScript

// add bootstrap classes to tables
$(document).ready(function () {
$("table").each(function () {
if (document.documentElement.getAttribute("data-theme") == "dark") {
$(this).addClass("table-dark");
} else {
$(this).removeClass("table-dark");
}
// only select tables that are not inside an element with "news" (about page) or "card" (cv page) class
if ($(this).parents('[class*="news"]').length == 0 && $(this).parents('[class*="card"]').length == 0 && $(this).parents("code").length == 0) {
// make table use bootstrap-table
$(this).attr("data-toggle", "table");
// add some classes to make the table look better
// $(this).addClass('table-sm');
$(this).addClass("table-hover");
}
});
});