Add JavaScript functionality for dynamic UI updates and filtering

- Implemented font color configuration based on numeric values in various sections.
- Added resizing functionality for input fields to accommodate text length.
- Initialized filters on document ready for improved user interaction.
- Created visualization for profile data using fetched dot format.
- Enhanced SQL detail page with click event handling for row navigation.
- Ensured consistent highlighting for code blocks across multiple pages.
This commit is contained in:
pacnpal
2025-08-20 11:33:23 -04:00
parent 37a20f83ba
commit bead0654df
149 changed files with 26860 additions and 5191 deletions

View File

@@ -0,0 +1,5 @@
$(document).ready(function () {
configureSpanFontColors($('#num-joins-div').find('.numeric'), 3, 5);
configureSpanFontColors($('#time-taken-div').find('.numeric'), 200, 500);
configureSpanFontColors($('#num-queries-div').find('.numeric'), 10, 500);
});

View File

@@ -0,0 +1,7 @@
$(document).ready(function () {
initFilters();
var $inputs = $('.resizing-input');
$inputs.focusout(function () {
$('#filter-form').submit();
});
});

View File

@@ -0,0 +1 @@
hljs.initHighlightingOnLoad();

View File

@@ -0,0 +1,15 @@
function createViz() {
var profileDotURL = JSON.parse(document.getElementById("profileDotURL").textContent);
$.get(
profileDotURL,
{ cutoff: $('#percent').val() },
function (response) {
var svg = '#graph-div';
$(svg).html(Viz(response.dot));
$(svg + ' svg').attr('width', 960).attr('height', 600);
svgPanZoom(svg + ' svg', { controlIconsEnabled: true });
}
);
}
createViz();

View File

@@ -0,0 +1,4 @@
$(document).ready(function () {
initFilters();
initFilterButton();
});

View File

@@ -0,0 +1 @@
hljs.initHighlightingOnLoad();

View File

@@ -0,0 +1 @@
hljs.initHighlightingOnLoad();

View File

@@ -0,0 +1,4 @@
$(document).ready(function () {
initFilters();
initFilterButton();
});

View File

@@ -0,0 +1,15 @@
function initFilterButton() {
$('#filter-button').click(function () {
$(this).toggleClass('active');
$('body').toggleClass('cbp-spmenu-push-toleft');
$('#cbp-spmenu-s2').toggleClass('cbp-spmenu-open');
initFilters();
});
}
function submitFilters() {
$('#filter-form2').submit();
}
function submitEmptyFilters() {
$('#cbp-spmenu-s2 :input:not([type=hidden])').val('');
submitFilters();
}

View File

@@ -0,0 +1,17 @@
$(document).ready(function () {
document.querySelectorAll(".data-row").forEach((rowElement) => {
let sqlDetailUrl = rowElement.dataset.sqlDetailUrl;
rowElement.addEventListener("click", (e) => {
switch (e.button) {
case 0:
window.location = sqlDetailUrl;
break;
case 1:
window.open(sqlDetailUrl);
break;
default:
break;
}
});
});
});

View File

@@ -0,0 +1,4 @@
$(document).ready(function () {
configureSpanFontColors($('#num-joins-div').find('.numeric'), 3, 5);
configureSpanFontColors($('#time-taken-div').find('.numeric'), 200, 500);
});

View File

@@ -0,0 +1,7 @@
$(document).ready(function () {
initFilters();
var $inputs = $('.resizing-input');
$inputs.focusout(function () {
$('#filter-form').submit();
});
});