|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | +<head> |
| 4 | + <title>Double Click Test</title> |
| 5 | +</head> |
| 6 | +<body> |
| 7 | + <style> |
| 8 | + button { padding: 10px; margin: 5px; font-size: 16px; } |
| 9 | + .logs { margin-top: 20px; border: 1px solid black; padding: 10px; max-height: 200px; overflow: auto; } |
| 10 | + .log-entry { font-family: monospace; font-size: 12px; } |
| 11 | + </style> |
| 12 | + |
| 13 | + <h1>Test Output Panel Double-Click Handlers</h1> |
| 14 | + |
| 15 | + <div> |
| 16 | + <button id="compiler-btn" data-tab="compiler">Compiler</button> |
| 17 | + <button id="messages-btn" data-tab="messages">Messages</button> |
| 18 | + <button id="registry-btn" data-tab="registry">I/O Registry</button> |
| 19 | + <button id="debug-btn" data-tab="debug">Debug</button> |
| 20 | + </div> |
| 21 | + |
| 22 | + <div class="logs" id="logs"></div> |
| 23 | + |
| 24 | + <script> |
| 25 | + const logsDiv = document.getElementById('logs'); |
| 26 | + |
| 27 | + function log(message) { |
| 28 | + const entry = document.createElement('div'); |
| 29 | + entry.className = 'log-entry'; |
| 30 | + entry.textContent = `[${new Date().toLocaleTimeString()}] ${message}`; |
| 31 | + logsDiv.appendChild(entry); |
| 32 | + logsDiv.scrollTop = logsDiv.scrollHeight; |
| 33 | + } |
| 34 | + |
| 35 | + // Simulating the output-panel structure |
| 36 | + const handlers = { |
| 37 | + 'compiler': () => log('openOutputPanel("compiler") called'), |
| 38 | + 'messages': () => log('openOutputPanel("messages") called'), |
| 39 | + 'registry': () => log('openOutputPanel("registry") called'), |
| 40 | + 'debug': () => log('openOutputPanel("debug") called'), |
| 41 | + }; |
| 42 | + |
| 43 | + document.querySelectorAll('[data-tab]').forEach(btn => { |
| 44 | + btn.addEventListener('click', () => { |
| 45 | + const tab = btn.dataset.tab; |
| 46 | + log(`>>> Single Click: ${tab}`); |
| 47 | + }); |
| 48 | + |
| 49 | + btn.addEventListener('dblclick', (e) => { |
| 50 | + e.preventDefault(); |
| 51 | + const tab = btn.dataset.tab; |
| 52 | + log(`>>> Double Click: ${tab}`); |
| 53 | + handlers[tab](); |
| 54 | + }); |
| 55 | + }); |
| 56 | + |
| 57 | + log('Test page loaded'); |
| 58 | + </script> |
| 59 | +</body> |
| 60 | +</html> |
0 commit comments