@@ -47,10 +47,10 @@ var connectionLostNotification = null; // Reference to "Connection Lost" notific
4747// ===== Notification System =====
4848
4949const NotificationIcons = {
50- success : `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/></svg>` ,
51- error : `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>` ,
52- warning : `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>` ,
53- info : `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>`
50+ success : `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/></svg>` ,
51+ error : `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/></svg>` ,
52+ warning : `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>` ,
53+ info : `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>`
5454} ;
5555
5656/**
@@ -62,7 +62,8 @@ const NotificationIcons = {
6262 */
6363function showNotification ( type , title , message = '' , duration = 4000 ) {
6464 const container = document . getElementById ( 'notificationContainer' ) ;
65- if ( ! container ) return ;
65+ if ( ! container )
66+ return ;
6667
6768 const notification = document . createElement ( 'div' ) ;
6869 notification . className = `notification ${ type } ` ;
@@ -113,7 +114,8 @@ function showConfirmDialog(title, message, options = {}) {
113114 confirmText = 'Confirm' ,
114115 cancelText = 'Cancel' ,
115116 destructive = true
116- } = options ;
117+ }
118+ = options ;
117119
118120 return new Promise ( ( resolve ) => {
119121 const overlay = document . getElementById ( 'confirmDialog' ) ;
@@ -160,7 +162,8 @@ function initConfirmDialog() {
160162 const confirmBtn = document . getElementById ( 'confirmDialogConfirm' ) ;
161163 const cancelBtn = document . getElementById ( 'confirmDialogCancel' ) ;
162164
163- if ( ! overlay || ! confirmBtn || ! cancelBtn ) return ;
165+ if ( ! overlay || ! confirmBtn || ! cancelBtn )
166+ return ;
164167
165168 confirmBtn . addEventListener ( 'click' , ( ) => closeConfirmDialog ( true ) ) ;
166169 cancelBtn . addEventListener ( 'click' , ( ) => closeConfirmDialog ( false ) ) ;
@@ -191,7 +194,8 @@ window.showConfirmDialog = showConfirmDialog;
191194 */
192195function showBluetoothUnsupportedMessage ( ) {
193196 const welcomeDiv = document . querySelector ( '.layout-content.welcome' ) ;
194- if ( ! welcomeDiv ) return ;
197+ if ( ! welcomeDiv )
198+ return ;
195199
196200 welcomeDiv . innerHTML = `
197201 <div class="bt-unsupported">
@@ -507,7 +511,7 @@ window.Application = {
507511 showNotification ( 'success' , 'Program Stopped' , 'Execution has been halted' ) ;
508512 } ) ;
509513 }
510- blocklyEditor . removeAllProfilingOverlays ( ) ;
514+ blocklyEditor . removeAllProfilingOverlays ( ) ;
511515 // clang-format on
512516 } ,
513517
@@ -599,7 +603,9 @@ function setupEventListeners() {
599603 } ) ;
600604
601605 bleClient . addEventListener ( APP_EVENT_TYPE_PORTSTATUS , ( data ) => {
602- const status = JSON . parse ( new TextDecoder ( ) . decode ( data ) ) ;
606+ const portstatustext = new TextDecoder ( ) . decode ( data ) ;
607+ console . log ( "Got Portstatus : " + portstatustext ) ;
608+ const status = JSON . parse ( portstatustext ) ;
603609 portstatus . updateStatus ( status ) ;
604610 } ) ;
605611
@@ -642,9 +648,9 @@ async function attemptReconnection() {
642648 // Attempts: 1=2s, 2=4s, 3=8s, 4=16s, 5=30s, 6+=30s (capped)
643649 const delayMs = Math . min ( 2000 * Math . pow ( 2 , reconnectAttempts - 1 ) , 30000 ) ;
644650
645- console . log ( `Reconnection attempt ${ reconnectAttempts } /${ maxReconnectAttempts } in ${ delayMs / 1000 } s...` ) ;
651+ console . log ( `Reconnection attempt ${ reconnectAttempts } /${ maxReconnectAttempts } in ${ delayMs / 1000 } s...` ) ;
646652 // Notification duration proportional to delay time (90% of delay)
647- showNotification ( 'info' , 'Reconnecting' , `Attempt ${ reconnectAttempts } /${ maxReconnectAttempts } in ${ delayMs / 1000 } s...` , Math . floor ( delayMs * 0.9 ) ) ;
653+ showNotification ( 'info' , 'Reconnecting' , `Attempt ${ reconnectAttempts } /${ maxReconnectAttempts } in ${ delayMs / 1000 } s...` , Math . floor ( delayMs * 0.9 ) ) ;
648654
649655 await new Promise ( resolve => setTimeout ( resolve , delayMs ) ) ;
650656
@@ -815,8 +821,7 @@ document.addEventListener('DOMContentLoaded', () => {
815821 const confirmed = await showConfirmDialog (
816822 'Load Workspace' ,
817823 `This will replace your current workspace with ${ file . name } . Continue?` ,
818- { confirmText : 'Load' , cancelText : 'Cancel' , destructive : true }
819- ) ;
824+ { confirmText : 'Load' , cancelText : 'Cancel' , destructive : true } ) ;
820825
821826 if ( confirmed ) {
822827 const success = blocklyEditor . loadXML ( fileContent ) ;
@@ -958,8 +963,7 @@ document.addEventListener('DOMContentLoaded', () => {
958963 const confirmed = await showConfirmDialog (
959964 'Reset Workspace' ,
960965 'Are you sure you want to reset the workspace? All unsaved changes to your Blockly program will be lost.' ,
961- { confirmText : 'Reset' , cancelText : 'Cancel' , destructive : true }
962- ) ;
966+ { confirmText : 'Reset' , cancelText : 'Cancel' , destructive : true } ) ;
963967 if ( confirmed ) {
964968 blocklyEditor . clearWorkspace ( ) ;
965969 showNotification ( 'success' , 'Workspace Reset' , 'All blocks have been cleared' ) ;
@@ -1018,8 +1022,7 @@ document.addEventListener('DOMContentLoaded', () => {
10181022 const confirmed = await showConfirmDialog (
10191023 'Paste Project' ,
10201024 'This will replace your current workspace with the project from clipboard. Continue?' ,
1021- { confirmText : 'Paste' , cancelText : 'Cancel' , destructive : true }
1022- ) ;
1025+ { confirmText : 'Paste' , cancelText : 'Cancel' , destructive : true } ) ;
10231026
10241027 if ( confirmed ) {
10251028 const success = blocklyEditor . loadXML ( clipboardText ) ;
0 commit comments