Changeset 3386688
- Timestamp:
- 10/29/2025 10:10:00 PM (5 months ago)
- Location:
- joan/trunk
- Files:
-
- 5 edited
-
assets/css/joan.css (modified) (3 diffs)
-
assets/js/joan.js (modified) (3 diffs)
-
includes/shortcodes.php (modified) (2 diffs)
-
joan.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
joan/trunk/assets/css/joan.css
r3374022 r3386688 875 875 background: white !important; 876 876 color: #333 !important; 877 /* Prevent browsers (particularly Android/Chrome) from automatically inverting 878 * colours when the system is in dark mode. Declaring a light colour scheme 879 * opts these tables out of forced dark mode so that our explicit colours 880 * remain intact. See https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme 881 * for details. 882 */ 883 color-scheme: light; 884 } 885 886 /* 887 * Use a dedicated header class on schedule table header cells to guarantee 888 * consistent styling regardless of theme interference. When in light mode 889 * apply our standard blue header background and opt out of forced dark 890 * mode. These rules have high specificity to override theme styles. 891 */ 892 .joan-light-mode .joan-schedule-header { 893 background: #0073aa !important; 894 color: #ffffff !important; 895 color-scheme: light; 896 } 897 898 /* Duplicate specificity for the nuclear option (double class) */ 899 .joan-light-mode.joan-light-mode .joan-schedule-header { 900 background: #0073aa !important; 901 color: #ffffff !important; 902 color-scheme: light; 903 } 904 905 /* 906 * In dark mode, set a dark background on header cells using our custom 907 * header class. This mirrors the defaults used for the schedule tables 908 * themselves. The high specificity ensures consistency in dark mode. 909 */ 910 .joan-dark-mode .joan-schedule-header { 911 background: #34495e !important; 912 color: #ffffff !important; 913 } 914 .joan-dark-mode.joan-dark-mode .joan-schedule-header { 915 background: #34495e !important; 916 color: #ffffff !important; 877 917 } 878 918 879 919 .joan-light-mode .joan-schedule-day-table th, 880 920 .joan-light-mode table.joan-schedule th { 881 color: white !important; 921 /* 922 * In light mode the overall table background is forced to white. Without 923 * explicitly setting the header background, the default header colour is 924 * overridden to white as well, resulting in white text on a white 925 * background. Restore the primary header background colour and ensure 926 * header text remains readable. 927 */ 928 background: #0073aa !important; 929 color: #ffffff !important; 882 930 } 883 931 … … 991 1039 992 1040 /* Light mode overrides for general schedule table headers */ 1041 /* 1042 * In light mode we explicitly set a coloured background on the table headers of 1043 * the main schedule table. Without this rule the default dark themed 1044 * gradient might be inverted by browser auto‑darkening on mobile, leading to 1045 * white text on a white background. The high specificity and !important 1046 * flags ensure this rule overrides both the base dark mode styles and any 1047 * vendor forced dark mode heuristics. 1048 */ 993 1049 .joan-light-mode table.joan-schedule th { 994 1050 background: #0073aa !important; 995 color: white !important; 1051 color: #ffffff !important; 1052 } 1053 1054 /* 1055 * When the dark/light class is added twice to increase specificity (see the 1056 * “nuclear option” rules below), we still need to restore the coloured 1057 * header background. Without this override the header inherits only the 1058 * text colour from the nuclear rule and remains on a white background. 1059 */ 1060 .joan-light-mode.joan-light-mode table.joan-schedule th { 1061 background: #0073aa !important; 1062 color: #ffffff !important; 1063 } 1064 1065 /* Apply the same coloured background to day separated schedule tables. */ 1066 .joan-light-mode .joan-schedule-day-table th { 1067 background: #0073aa !important; 1068 color: #ffffff !important; 1069 } 1070 1071 /* Ensure the high specificity override for day tables retains the coloured 1072 * header when the class is duplicated. 1073 */ 1074 .joan-light-mode.joan-light-mode .joan-schedule-day-table th { 1075 background: #0073aa !important; 1076 color: #ffffff !important; 996 1077 } 997 1078 … … 1479 1560 display: block !important; 1480 1561 } 1562 1563 /* 1564 * Final override for schedule headers. By placing these rules at the end of the 1565 * stylesheet they will supersede earlier declarations with the same 1566 * specificity. This ensures the "Show / Time / Jock" headings remain 1567 * visible on all devices, including Android browsers that may apply auto 1568 * darkening. The light mode version uses our standard blue and opts out of 1569 * forced dark mode; the dark mode version reuses the default dark header 1570 * background. 1571 */ 1572 .joan-light-mode .joan-schedule-header, 1573 .joan-light-mode.joan-light-mode .joan-schedule-header { 1574 background: #0073aa !important; 1575 color: #ffffff !important; 1576 color-scheme: light; 1577 } 1578 1579 .joan-dark-mode .joan-schedule-header, 1580 .joan-dark-mode.joan-dark-mode .joan-schedule-header { 1581 background: #34495e !important; 1582 color: #ffffff !important; 1583 } -
joan/trunk/assets/js/joan.js
r3374022 r3386688 84 84 85 85 function applyDarkMode(isDark) { 86 const body = document.body; 87 88 if (isDark) { 89 body.classList.add('joan-dark-mode'); 90 body.classList.remove('joan-light-mode'); 91 92 // Apply dark mode to JOAN elements 86 const body = document.body; 87 // Define selectors for all JOAN elements that support theme switching 93 88 const selectors = [ 94 89 '.joan-now-playing', 95 '.joan-schedule-container', 90 '.joan-schedule-container', 96 91 'table.joan-schedule', 97 92 '.joan-schedule-day-section', … … 101 96 '.joan-schedule-empty-day', 102 97 '.joan-sunday-header', 103 '.joan-monday-header', 98 '.joan-monday-header', 104 99 '.joan-tuesday-header', 105 100 '.joan-wednesday-header', … … 109 104 '.joan-sunday-table', 110 105 '.joan-monday-table', 111 '.joan-tuesday-table', 106 '.joan-tuesday-table', 112 107 '.joan-wednesday-table', 113 108 '.joan-thursday-table', 114 109 '.joan-friday-table', 115 '.joan-saturday-table' 110 '.joan-saturday-table', 111 '.joan-today-highlight', 112 '.joan-current-show-highlight' 116 113 ]; 117 114 // Toggle body classes based on dark/light state 115 if (isDark) { 116 body.classList.add('joan-dark-mode'); 117 body.classList.remove('joan-light-mode'); 118 } else { 119 body.classList.add('joan-light-mode'); 120 body.classList.remove('joan-dark-mode'); 121 } 122 // Toggle corresponding classes on all JOAN elements 118 123 selectors.forEach(selector => { 119 124 const elements = document.querySelectorAll(selector); 120 125 elements.forEach(element => { 121 element.classList.add('joan-dark-mode'); 122 element.classList.remove('joan-light-mode'); 126 if (isDark) { 127 element.classList.add('joan-dark-mode'); 128 element.classList.remove('joan-light-mode'); 129 } else { 130 element.classList.add('joan-light-mode'); 131 element.classList.remove('joan-dark-mode'); 132 } 123 133 }); 124 134 }); 125 } else { 126 // CRITICAL FIX: Remove ALL JOAN mode classes when not in dark mode 127 // This allows the theme's native CSS to style tables normally 128 body.classList.remove('joan-dark-mode', 'joan-light-mode'); 129 130 // Remove mode classes from all JOAN elements 131 const allJoanElements = document.querySelectorAll('[class*="joan-"]'); 132 allJoanElements.forEach(element => { 133 element.classList.remove('joan-dark-mode', 'joan-light-mode'); 134 }); 135 } 136 } 135 } 137 136 138 137 function addDarkModeToggles(currentState) { -
joan/trunk/includes/shortcodes.php
r3375309 r3386688 101 101 102 102 echo '><thead><tr>'; 103 echo '<th>' . esc_html__('Show', 'joan') . '</th>'; 103 // Add a specific class to all header cells so we can target them reliably in CSS 104 echo '<th class="joan-schedule-header">' . esc_html__('Show', 'joan') . '</th>'; 104 105 105 106 // FIXED: Only show Day column when not filtering by specific day 106 107 if ($show_day_column) { 107 echo '<th >' . esc_html__('Day', 'joan') . '</th>';108 } 109 110 echo '<th >' . esc_html__('Time', 'joan') . '</th>';111 echo '<th >' . esc_html__('Jock', 'joan') . '</th>';108 echo '<th class="joan-schedule-header">' . esc_html__('Day', 'joan') . '</th>'; 109 } 110 111 echo '<th class="joan-schedule-header">' . esc_html__('Time', 'joan') . '</th>'; 112 echo '<th class="joan-schedule-header">' . esc_html__('Jock', 'joan') . '</th>'; 112 113 if ($atts['show_images'] === 'yes') { 113 echo '<th >' . esc_html__('Image', 'joan') . '</th>';114 echo '<th class="joan-schedule-header">' . esc_html__('Image', 'joan') . '</th>'; 114 115 } 115 116 echo '</tr></thead><tbody>'; … … 205 206 echo '<table class="joan-schedule joan-filtered-schedule joan-today-table" data-filter-day="' . esc_attr($today) . '">'; 206 207 echo '<thead><tr>'; 207 echo '<th >' . esc_html__('Show', 'joan') . '</th>';208 // FIXED: No Day column for today 's schedule (redundant)209 echo '<th >' . esc_html__('Time', 'joan') . '</th>';210 echo '<th >' . esc_html__('Jock', 'joan') . '</th>';208 echo '<th class="joan-schedule-header">' . esc_html__('Show', 'joan') . '</th>'; 209 // FIXED: No Day column for today\'s schedule (redundant) 210 echo '<th class="joan-schedule-header">' . esc_html__('Time', 'joan') . '</th>'; 211 echo '<th class="joan-schedule-header">' . esc_html__('Jock', 'joan') . '</th>'; 211 212 if ($atts['show_images'] === 'yes') { 212 echo '<th >' . esc_html__('Image', 'joan') . '</th>';213 echo '<th class="joan-schedule-header">' . esc_html__('Image', 'joan') . '</th>'; 213 214 } 214 215 echo '</tr></thead><tbody>'; -
joan/trunk/joan.php
r3386662 r3386688 4 4 * Plugin URI: https://gandenterprisesinc.com/plugins/joan 5 5 * Description: Display your station's current and upcoming on-air schedule in real-time with timezone awareness, Elementor & Visual Composer support, and modern code practices. 6 * Version: 6.1. 16 * Version: 6.1.2 7 7 * Author: G & D Enterprises, Inc. 8 8 * Author URI: https://gandenterprisesinc.com … … 18 18 19 19 // Update plugin version constant to reflect the latest release. 20 define('JOAN_VERSION', '6.1. 1');20 define('JOAN_VERSION', '6.1.2'); 21 21 define('JOAN_PLUGIN_DIR', plugin_dir_path(__FILE__)); 22 22 define('JOAN_PLUGIN_URL', plugin_dir_url(__FILE__)); -
joan/trunk/readme.txt
r3386662 r3386688 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.2 8 Stable tag: 6.1. 18 Stable tag: 6.1.2 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 141 141 == Changelog == 142 142 143 = 6.1.2 - 2025-10-29 = 144 145 * **FIXED**: Resolved persistent schedule header issues on Android by introducing a dedicated `joan-schedule-header` class on all `<th>` cells, then adding late‑loading CSS overrides. These rules force a blue background in light mode and a dark background in dark mode, with `color-scheme: light` to opt out of browser forced dark mode. The headers now remain visible across all devices. 146 147 143 148 = 6.1.1 - 2025-10-29 = 144 149 145 * **FIXED**: Elementor "JOAN - On Air Now" widget now registers properly. The earlier JOANchecked for `elementor/loaded` too soon, causing the widget to never appear. We removed the premature check and now register the widget whenever Elementor is active.150 * **FIXED**: Elementor "JOAN - On Air Now" widget now registers properly. The earlier code checked for `elementor/loaded` too soon, causing the widget to never appear. We removed the premature check and now register the widget whenever Elementor is active. 146 151 * **FIXED**: Resolved an issue where show titles containing apostrophes accumulated backslashes each time they were edited. Inputs are now unslashed before saving, and existing values are unslashed for the admin interface. 152 * **FIXED**: WPBakery Page Builder widget integration confirmed and unchanged; no additional fixes were necessary. 153 * **FIXED**: On Android devices in light mode, schedule table headers (Show/Time/Jock) could become invisible because forced dark mode inverted colors. We now explicitly set a colored background on the header cells and opt the schedule tables into a light color scheme. This prevents forced dark mode from overriding the styles and keeps the headers visible across all browsers. 147 154 148 155 = 6.1.0 - 2025-10-08 =
Note: See TracChangeset
for help on using the changeset viewer.