|
309 | 309 | Blockly JavaScript Builder |
310 | 310 | </h2> |
311 | 311 | <div class="right-buttons"> |
312 | | - <button onclick="window.open('https://discord.gg/xzPTxqNR', '_blank')">💬 Join Discord</button> |
| 312 | + <button onclick="window.open('https://discord.gg/QzajRf5H', '_blank')">💬 Join Discord</button> |
313 | 313 | <button id="settingsToggle">⚙️ Settings</button> |
314 | 314 | </div> |
315 | 315 | </div> |
|
323 | 323 | <button onclick="workspace.zoomCenter(-1)">➖ Zoom Out</button> |
324 | 324 | <button onclick="workspace.zoomToFit()">🧭 Fit</button> |
325 | 325 | <button onclick="workspace.setScale(1)">🔄 Reset Zoom</button><br><br> |
| 326 | + <button id="debugToggle">🐛 Toggle Debug Mode</button> |
326 | 327 | </div> |
327 | 328 |
|
328 | 329 | <div id="main"> |
@@ -357,6 +358,10 @@ <h2> |
357 | 358 | <div id="successMessage"></div> |
358 | 359 | </div> |
359 | 360 |
|
| 361 | + <div id="debugPanel"> |
| 362 | + <strong>🐛 Debug Info:</strong> |
| 363 | + <div id="debugMessage"></div> |
| 364 | + </div> |
360 | 365 |
|
361 | 366 | <div class="button-group"> |
362 | 367 | <button onclick="runCode()" class="tooltip"> |
@@ -509,6 +514,10 @@ <h2> |
509 | 514 | issues.push('Null value detected - consider null checking'); |
510 | 515 | } |
511 | 516 |
|
| 517 | + // Check for infinite loops |
| 518 | + if (code.includes('while (true)') || code.includes('while(true)')) { |
| 519 | + issues.push('Potential infinite loop detected'); |
| 520 | + } |
512 | 521 |
|
513 | 522 | // Check for empty blocks |
514 | 523 | if (code.trim() === '') { |
@@ -1138,7 +1147,9 @@ <h2> |
1138 | 1147 | if (workspace) { |
1139 | 1148 | setTimeout(() => workspace.resize(), 100); |
1140 | 1149 | } |
1141 | | - }}; |
| 1150 | + }); |
| 1151 | + |
| 1152 | + console.log('🎉 Blockly with Enhanced Error Handling initialized successfully!'); |
1142 | 1153 | </script> |
1143 | 1154 | </body> |
1144 | 1155 | </html> |
0 commit comments