return sheet;
}}}
-globalThis.tdSqltextSheet = getTdSqltextSheet();
-const show_spaces = document.getElementById('show_spaces_id');
-if (show_spaces !== null) {
- whitespaceDisplay(show_spaces.checked);
+function initializeStyling() {
+ // Apply a checkbox when it exists
+ function applyCheckbox(id, initFunc) {
+ const elmt = document.getElementById(id);
+ if (elmt !== null) {
+ initFunc(elmt.checked);
+ }
+ }
+ applyCheckbox('show_spaces_id', whitespaceDisplay);
}
+
+/* Initialization */
+globalThis.tdSqltextSheet = getTdSqltextSheet();
+initializeStyling();