'array', 'sanitize_callback' => 'a11ybridge_sanitize_option_array'));
register_setting('a11ybridge_advanced_settings_group', 'a11ybridge_scanner_settings', array('type' => 'array', 'sanitize_callback' => 'a11ybridge_sanitize_option_array'));
//register_setting('a11ybridge_advanced_settings_group', 'a11ybridge_voice_settings');
}
// Direkt rendern
if (is_admin()) {
$a11ybridge_page_raw = filter_input(INPUT_GET, 'page', FILTER_UNSAFE_RAW);
$a11ybridge_page = is_string($a11ybridge_page_raw) ? sanitize_key(wp_unslash($a11ybridge_page_raw)) : '';
if ($a11ybridge_page === 'a11ybridge-settings') {
a11ybridge_show_advanced_settings();
}
}
function a11ybridge_show_advanced_settings() {
$advanced_settings = get_option('a11ybridge_advanced_settings', [
'enable_accessibility_badge' => false,
'badge_position' => 'bottom-right',
'badge_style' => 'modern',
'enable_analytics' => false,
'debug_mode' => false,
'performance_optimization' => true
]);
$scanner_settings = get_option('a11ybridge_scanner_settings', [
'enable_accessibility_scanner' => false,
'scan_frequency' => 'weekly',
'auto_fix_simple_issues' => false,
'report_generation' => true,
'scan_depth' => 'full',
'email_notifications' => false
]);
?>
🔍 Scanner-Aktionen
Führen Sie manuelle Accessibility-Scans durch und generieren Sie Berichte.
'; ?>
'; ?>
'; ?>
document.addEventListener('DOMContentLoaded', function() {
// Scanner-Funktionen
const runScanBtn = document.getElementById('run-scan-btn');
const quickScanBtn = document.getElementById('quick-scan-btn');
const downloadReportBtn = document.getElementById('download-report-btn');
const scannerStatus = document.getElementById('scanner-status');
if (runScanBtn) {
runScanBtn.addEventListener('click', function() {
this.disabled = true;
this.textContent = '🔄 Scanne...';
showStatus(scannerStatus, 'Vollständiger Accessibility-Scan gestartet...', 'info');
// AJAX-Call für vollständigen Scan
fetch(ajaxurl, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({
action: 'a11ybridge_run_full_scan',
nonce: ''
})
})
.then(response => response.json())
.then(data => {
showStatus(scannerStatus, '✅ Scan erfolgreich abgeschlossen!', 'success');
this.disabled = false;
this.textContent = '🔍 Vollständigen Scan starten';
})
.catch(error => {
showStatus(scannerStatus, '❌ Scan-Fehler: ' + error.message, 'error');
this.disabled = false;
this.textContent = '🔍 Vollständigen Scan starten';
});
});
}
if (quickScanBtn) {
quickScanBtn.addEventListener('click', function() {
this.disabled = true;
this.textContent = '⚡ Scanne...';
showStatus(scannerStatus, 'Schnell-Scan gestartet...', 'info');
// AJAX-Call für Schnell-Scan
setTimeout(() => {
showStatus(scannerStatus, '✅ Schnell-Scan abgeschlossen!', 'success');
this.disabled = false;
this.textContent = '⚡ Schnell-Scan durchführen';
}, 2000);
});
}
// Voice Commands Test
const testVoiceBtn = document.getElementById('test-voice-btn');
const calibrateVoiceBtn = document.getElementById('calibrate-voice-btn');
const voiceTestStatus = document.getElementById('voice-test-status');
if (testVoiceBtn) {
testVoiceBtn.addEventListener('click', function() {
this.disabled = true;
this.textContent = '🎤 Höre zu...';
showStatus(voiceTestStatus, 'Spracherkennung aktiviert. Sagen Sie "Test".', 'info');
// Voice Recognition Test
if ('webkitSpeechRecognition' in window) {
const recognition = new webkitSpeechRecognition();
recognition.lang = '';
recognition.start();
recognition.onresult = function(event) {
const result = event.results[0][0].transcript;
showStatus(voiceTestStatus, `✅ Erkannt: "${result}"`, 'success');
};
recognition.onerror = function() {
showStatus(voiceTestStatus, '❌ Spracherkennung fehlgeschlagen', 'error');
};
setTimeout(() => {
recognition.stop();
testVoiceBtn.disabled = false;
testVoiceBtn.textContent = '🎤 Spracherkennung testen';
}, 3000);
} else {
showStatus(voiceTestStatus, '❌ Spracherkennung nicht unterstützt', 'error');
this.disabled = false;
this.textContent = '🎤 Spracherkennung testen';
}
});
}
// Status-Anzeige Hilfsfunktion
function showStatus(element, message, type) {
if (element) {
element.className = `a11y-status ${type}`;
element.style.display = 'block';
element.textContent = message;
}
}
});
'Scan erfolgreich abgeschlossen']);
});