mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2026-02-06 02:45:16 -05:00
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:
24
staticfiles/silk/js/components/cell.js
Normal file
24
staticfiles/silk/js/components/cell.js
Normal file
@@ -0,0 +1,24 @@
|
||||
function configureSpanFontColors(selector, okValue, badValue) {
|
||||
selector.each(function () {
|
||||
var val = parseFloat($(this).text());
|
||||
if (val < okValue) {
|
||||
$(this).addClass('very-good-font-color');
|
||||
}
|
||||
else if (val < badValue) {
|
||||
$(this).addClass('ok-font-color');
|
||||
}
|
||||
else {
|
||||
$(this).addClass('very-bad-font-color');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function configureFontColors() {
|
||||
configureSpanFontColors($('.time-taken-div .numeric'), 200, 500);
|
||||
configureSpanFontColors($('.time-taken-queries-div .numeric'), 50, 200);
|
||||
configureSpanFontColors($('.num-queries-div .numeric'), 10, 50);
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
configureFontColors();
|
||||
});
|
||||
Reference in New Issue
Block a user