Update this to auto test for compatibility
Browse files
script.js
CHANGED
|
@@ -1,8 +1,35 @@
|
|
| 1 |
|
| 2 |
-
//
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
// Database tables with more complete default data
|
| 7 |
const dbTables = [
|
| 8 |
{
|
|
@@ -90,7 +117,12 @@ function showError(message) {
|
|
| 90 |
}
|
| 91 |
// Initialize the application
|
| 92 |
document.addEventListener('DOMContentLoaded', async () => {
|
| 93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
const loading = document.getElementById('loading');
|
| 96 |
try {
|
|
|
|
| 1 |
|
| 2 |
+
// Browser compatibility test
|
| 3 |
+
function testCompatibility() {
|
| 4 |
+
const requiredFeatures = {
|
| 5 |
+
'Promise': window.Promise,
|
| 6 |
+
'fetch': window.fetch,
|
| 7 |
+
'Web Components': window.customElements,
|
| 8 |
+
'Shadow DOM': 'attachShadow' in Element.prototype,
|
| 9 |
+
'ES6 Modules': 'noModule' in HTMLScriptElement.prototype,
|
| 10 |
+
'CSS Variables': window.CSS && CSS.supports('color', 'var(--test)')
|
| 11 |
+
};
|
| 12 |
+
|
| 13 |
+
const missingFeatures = Object.entries(requiredFeatures)
|
| 14 |
+
.filter(([_, supported]) => !supported)
|
| 15 |
+
.map(([name]) => name);
|
| 16 |
+
|
| 17 |
+
if (missingFeatures.length > 0) {
|
| 18 |
+
const warning = document.createElement('div');
|
| 19 |
+
warning.className = 'compatibility-warning';
|
| 20 |
+
warning.innerHTML = `
|
| 21 |
+
<div class="warning-content">
|
| 22 |
+
<h3>⚠️ Compatibility Warning</h3>
|
| 23 |
+
<p>Your browser is missing these required features:</p>
|
| 24 |
+
<ul>${missingFeatures.map(f => `<li>${f}</li>`).join('')}</ul>
|
| 25 |
+
<p>Please update your browser or use a modern alternative like Chrome, Firefox, or Edge.</p>
|
| 26 |
+
</div>
|
| 27 |
+
`;
|
| 28 |
+
document.body.prepend(warning);
|
| 29 |
+
return false;
|
| 30 |
+
}
|
| 31 |
+
return true;
|
| 32 |
+
}
|
| 33 |
// Database tables with more complete default data
|
| 34 |
const dbTables = [
|
| 35 |
{
|
|
|
|
| 117 |
}
|
| 118 |
// Initialize the application
|
| 119 |
document.addEventListener('DOMContentLoaded', async () => {
|
| 120 |
+
// Check compatibility first
|
| 121 |
+
if (!testCompatibility()) {
|
| 122 |
+
console.error('Browser missing required features');
|
| 123 |
+
return;
|
| 124 |
+
}
|
| 125 |
+
console.log('Application initialized');
|
| 126 |
|
| 127 |
const loading = document.getElementById('loading');
|
| 128 |
try {
|
style.css
CHANGED
|
@@ -31,13 +31,40 @@ body {
|
|
| 31 |
.button-scale:hover {
|
| 32 |
transform: scale(1.02);
|
| 33 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
/* Fade in animation */
|
| 36 |
@keyframes fadeIn {
|
| 37 |
from { opacity: 0; }
|
| 38 |
to { opacity: 1; }
|
| 39 |
}
|
| 40 |
-
|
| 41 |
.fade-in {
|
| 42 |
animation: fadeIn 0.3s ease-in;
|
| 43 |
}
|
|
|
|
| 31 |
.button-scale:hover {
|
| 32 |
transform: scale(1.02);
|
| 33 |
}
|
| 34 |
+
/* Compatibility warning styles */
|
| 35 |
+
.compatibility-warning {
|
| 36 |
+
background: #ffecb3;
|
| 37 |
+
border-bottom: 1px solid #ffc107;
|
| 38 |
+
padding: 1rem;
|
| 39 |
+
text-align: center;
|
| 40 |
+
position: sticky;
|
| 41 |
+
top: 0;
|
| 42 |
+
z-index: 1000;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
.warning-content {
|
| 46 |
+
max-width: 800px;
|
| 47 |
+
margin: 0 auto;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
.warning-content h3 {
|
| 51 |
+
margin: 0 0 0.5rem 0;
|
| 52 |
+
color: #ff6f00;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
.warning-content ul {
|
| 56 |
+
list-style: none;
|
| 57 |
+
padding: 0;
|
| 58 |
+
margin: 0.5rem 0;
|
| 59 |
+
display: inline-block;
|
| 60 |
+
text-align: left;
|
| 61 |
+
}
|
| 62 |
|
| 63 |
/* Fade in animation */
|
| 64 |
@keyframes fadeIn {
|
| 65 |
from { opacity: 0; }
|
| 66 |
to { opacity: 1; }
|
| 67 |
}
|
|
|
|
| 68 |
.fade-in {
|
| 69 |
animation: fadeIn 0.3s ease-in;
|
| 70 |
}
|