@@ -160,31 +160,44 @@ export class BeaconsMinionPanel extends Panel {
160
160
this . _addMenuItemBeaconsEnableBeaconWhenNeeded ( beaconMenu , pMinionId , beaconName , beacon ) ;
161
161
this . _addMenuItemBeaconsDelete ( beaconMenu , pMinionId , beaconName ) ;
162
162
163
- // menu comes before this data on purpose
164
- const beaconConfig = Output . formatObject ( beacon ) ;
165
- const beaconConfigTd = Utils . createTd ( "beacon-config" , beaconConfig ) ;
166
- let initialTimestamp = "(waiting)" ;
167
- let initialValue = "(waiting)" ;
163
+ const beaconConfigTd = Utils . createTd ( ) ;
164
+ Output . setHighlightObject ( beaconConfigTd , beacon , "pre" ) ;
165
+ tr . appendChild ( beaconConfigTd ) ;
166
+
167
+ let initialTimestamp ;
168
+ let initialValue ;
169
+ let initialClass ;
168
170
if ( beacon . enabled === false ) {
169
- beaconConfigTd . classList . add ( "beacon-disabled" ) ;
171
+ initialClass = "beacon-disabled" ;
170
172
initialTimestamp = Character . EM_DASH ;
171
173
initialValue = "(beacon" + Character . NO_BREAK_SPACE + "disabled)" ;
172
174
} else if ( beacons . enabled === false ) {
173
- beaconConfigTd . classList . add ( "beacon-disabled" ) ;
175
+ initialClass = "beacon-disabled" ;
174
176
initialTimestamp = Character . EM_DASH ;
175
177
initialValue = "(beacons" + Character . NO_BREAK_SPACE + "disabled)" ;
178
+ } else {
179
+ initialClass = "beacon-waiting" ;
180
+ initialTimestamp = "(waiting)" ;
181
+ initialValue = "(waiting)" ;
176
182
}
177
- tr . appendChild ( beaconConfigTd ) ;
178
183
179
184
const beaconTimestampTd = Utils . createTd ( ) ;
180
- const beaconTimestampSpan = Utils . createSpan ( [ "beacon-timestamp" , "beacon-waiting" ] , initialTimestamp ) ;
185
+ const beaconTimestampSpan = Utils . createSpan ( [ "beacon-timestamp" , initialClass ] , initialTimestamp ) ;
181
186
beaconTimestampTd . appendChild ( beaconTimestampSpan ) ;
182
187
tr . appendChild ( beaconTimestampTd ) ;
183
188
tr . beaconTimestampSpan = beaconTimestampSpan ;
184
189
185
- const beaconValueTd = Utils . createTd ( [ "beacon-value" , "beacon-waiting" ] , initialValue ) ;
190
+ const beaconValueTd = Utils . createTd ( ) ;
191
+ const beaconValueLabelDiv = Utils . createDiv ( ) ;
192
+ beaconValueLabelDiv . style . display = "none" ;
193
+ beaconValueTd . appendChild ( beaconValueLabelDiv ) ;
194
+ const beaconValueValueDiv = Utils . createDiv ( ) ;
195
+ beaconValueValueDiv . innerText = initialValue ;
196
+ beaconValueValueDiv . classList . add ( "beacon-value" , initialClass ) ;
197
+ beaconValueTd . appendChild ( beaconValueValueDiv ) ;
186
198
tr . appendChild ( beaconValueTd ) ;
187
- tr . beaconValueTd = beaconValueTd ;
199
+ tr . beaconValueLabelDiv = beaconValueLabelDiv ;
200
+ tr . beaconValueValueDiv = beaconValueValueDiv ;
188
201
189
202
const tbody = this . table . tBodies [ 0 ] ;
190
203
tbody . appendChild ( tr ) ;
@@ -309,7 +322,6 @@ export class BeaconsMinionPanel extends Panel {
309
322
return ;
310
323
}
311
324
312
- let value = "" ;
313
325
let stamp = "" ;
314
326
if ( pData [ "_stamp" ] ) {
315
327
// keep timestamp for further logic
@@ -321,13 +333,13 @@ export class BeaconsMinionPanel extends Panel {
321
333
322
334
if ( pTag !== prefix + beaconName + "/" ) {
323
335
// Show the tag when it has extra information
324
- value = pTag + "\n" ;
336
+ tr . beaconValueLabelDiv . style . display = "" ;
337
+ tr . beaconValueLabelDiv . innerText = pTag ;
325
338
}
326
339
if ( pData [ "id" ] === minionId ) {
327
340
delete pData [ "id" ] ;
328
341
}
329
- value += Output . formatObject ( pData ) ;
330
- tr . beaconValueTd . classList . remove ( "beacon-waiting" ) ;
342
+ tr . beaconValueValueDiv . classList . remove ( "beacon-waiting" ) ;
331
343
332
344
// round down to 0.1 second
333
345
// secondary events are close, but rarely exact on the same time
@@ -366,7 +378,7 @@ export class BeaconsMinionPanel extends Panel {
366
378
tr . helpButtonSpan . style . display = "none" ;
367
379
}
368
380
369
- tr . beaconValueTd . innerText = value ;
381
+ Output . setHighlightObject ( tr . beaconValueValueDiv , pData , "pre" ) ;
370
382
371
383
tr . prevStamp = stamp ;
372
384
tr . prevTag = pTag ;
0 commit comments