@@ -57,8 +57,12 @@ class TypePanel {
57
57
buttonHide = document . createElement ( 'button' ) ;
58
58
buttonLoadState = document . createElement ( 'button' ) ;
59
59
buttonSaveState = document . createElement ( 'button' ) ;
60
+ buttonClear = document . createElement ( 'button' ) ;
60
61
constructor ( ) {
61
- const { div, inputEnable, spanErrors, span, select, option_spam, option_once, option_never, buttonHide, buttonLoadState, buttonSaveState} = this ;
62
+ const {
63
+ div, inputEnable, spanErrors, span, select, option_spam, option_once, option_never,
64
+ buttonHide, buttonLoadState, buttonSaveState, buttonClear
65
+ } = this ;
62
66
div . style . position = "absolute" ;
63
67
div . style . bottom = "0px" ;
64
68
div . style . right = "0px" ;
@@ -100,7 +104,9 @@ class TypePanel {
100
104
buttonLoadState . onclick = ( ) => this . loadState ( ) ;
101
105
buttonSaveState . textContent = 'Save state' ;
102
106
buttonSaveState . onclick = ( ) => this . saveState ( ) ;
103
- div . append ( inputEnable , spanErrors , span , select , buttonHide , buttonLoadState , buttonSaveState , warnedTable ) ;
107
+ buttonClear . textContent = 'Clear' ;
108
+ buttonClear . onclick = ( ) => this . clear ( ) ;
109
+ div . append ( inputEnable , spanErrors , span , select , buttonHide , buttonLoadState , buttonSaveState , buttonClear , warnedTable ) ;
104
110
div . style . maxHeight = '200px' ;
105
111
div . style . overflow = 'scroll' ;
106
112
const finalFunc = ( ) => document . body . append ( div ) ;
@@ -113,6 +119,14 @@ class TypePanel {
113
119
}
114
120
this . loadState ( ) ;
115
121
}
122
+ clear ( ) {
123
+ const { warned} = options ;
124
+ for ( const key in warned ) {
125
+ const warning = warned [ key ] ;
126
+ warning . tr . remove ( ) ;
127
+ delete warned [ key ] ;
128
+ }
129
+ }
116
130
get state ( ) {
117
131
/** @type {object[] } */
118
132
const fullState = [ ] ;
0 commit comments