36
36
import * as Common from '../../core/common/common.js' ;
37
37
import * as i18n from '../../core/i18n/i18n.js' ;
38
38
import * as Platform from '../../core/platform/platform.js' ;
39
+ import * as VisualLogging from '../../ui/visual_logging/visual_logging.js' ;
39
40
40
41
import * as ARIAUtils from './ARIAUtils.js' ;
41
42
import { HistoryInput } from './HistoryInput.js' ;
@@ -137,9 +138,10 @@ export class SearchableView extends VBox {
137
138
this . footerElementContainer = this . contentElement . createChild ( 'div' , 'search-bar hidden' ) ;
138
139
this . footerElementContainer . style . order = '100' ;
139
140
this . footerElement = this . footerElementContainer . createChild ( 'div' , 'toolbar-search' ) ;
141
+ this . footerElement . setAttribute ( 'jslog' , `${ VisualLogging . toolbar ( 'search' ) . track ( { resize : true } ) } ` ) ;
140
142
141
143
const replaceToggleToolbar = new Toolbar ( 'replace-toggle-toolbar' , this . footerElement ) ;
142
- this . replaceToggleButton = new ToolbarToggle ( i18nString ( UIStrings . replace ) , 'replace' ) ;
144
+ this . replaceToggleButton = new ToolbarToggle ( i18nString ( UIStrings . replace ) , 'replace' , undefined , 'repalce' ) ;
143
145
this . replaceToggleButton . addEventListener ( ToolbarButton . Events . Click , this . toggleReplace , this ) ;
144
146
replaceToggleToolbar . appendToolbarItem ( this . replaceToggleButton ) ;
145
147
@@ -151,6 +153,7 @@ export class SearchableView extends VBox {
151
153
this . searchInputElement . classList . add ( 'search-replace' , 'custom-search-input' ) ;
152
154
this . searchInputElement . id = 'search-input-field' ;
153
155
this . searchInputElement . placeholder = i18nString ( UIStrings . findString ) ;
156
+ this . searchInputElement . setAttribute ( 'jslog' , `${ VisualLogging . textField ( 'search' ) . track ( { change : true } ) } ` ) ;
154
157
searchControlElement . appendChild ( this . searchInputElement ) ;
155
158
156
159
this . matchesElement = searchControlElement . createChild ( 'label' , 'search-results-matches' ) ;
@@ -163,34 +166,40 @@ export class SearchableView extends VBox {
163
166
this . searchNavigationPrevElement . addEventListener ( 'click' , this . onPrevButtonSearch . bind ( this ) , false ) ;
164
167
Tooltip . install ( this . searchNavigationPrevElement , i18nString ( UIStrings . searchPrevious ) ) ;
165
168
ARIAUtils . setLabel ( this . searchNavigationPrevElement , i18nString ( UIStrings . searchPrevious ) ) ;
169
+ this . searchNavigationPrevElement . setAttribute (
170
+ 'jslog' , `${ VisualLogging . action ( 'select-previous' ) . track ( { click : true } ) } ` ) ;
166
171
167
172
this . searchNavigationNextElement =
168
173
searchNavigationElement . createChild ( 'div' , 'toolbar-search-navigation toolbar-search-navigation-next' ) ;
169
174
this . searchNavigationNextElement . addEventListener ( 'click' , this . onNextButtonSearch . bind ( this ) , false ) ;
170
175
Tooltip . install ( this . searchNavigationNextElement , i18nString ( UIStrings . searchNext ) ) ;
171
176
ARIAUtils . setLabel ( this . searchNavigationNextElement , i18nString ( UIStrings . searchNext ) ) ;
177
+ this . searchNavigationPrevElement . setAttribute (
178
+ 'jslog' , `${ VisualLogging . action ( 'select-next' ) . track ( { click : true } ) } ` ) ;
172
179
173
180
this . searchInputElement . addEventListener ( 'keydown' , this . onSearchKeyDown . bind ( this ) , true ) ;
174
181
this . searchInputElement . addEventListener ( 'input' , this . onInput . bind ( this ) , false ) ;
175
182
this . replaceInputElement =
176
183
( searchInputElements . createChild ( 'input' , 'search-replace toolbar-replace-control hidden' ) as HTMLInputElement ) ;
177
184
this . replaceInputElement . addEventListener ( 'keydown' , this . onReplaceKeyDown . bind ( this ) , true ) ;
178
185
this . replaceInputElement . placeholder = i18nString ( UIStrings . replace ) ;
186
+ this . replaceInputElement . setAttribute ( 'jslog' , `${ VisualLogging . textField ( 'replace' ) . track ( { change : true } ) } ` ) ;
179
187
180
188
this . buttonsContainer = this . footerElement . createChild ( 'div' , 'toolbar-search-buttons' ) ;
181
189
const firstRowButtons = this . buttonsContainer . createChild ( 'div' , 'first-row-buttons' ) ;
182
190
183
191
const toolbar = new Toolbar ( 'toolbar-search-options' , firstRowButtons ) ;
184
192
185
193
if ( this . searchProvider . supportsCaseSensitiveSearch ( ) ) {
186
- this . caseSensitiveButton = new ToolbarToggle ( i18nString ( UIStrings . matchCase ) ) ;
194
+ this . caseSensitiveButton = new ToolbarToggle ( i18nString ( UIStrings . matchCase ) , undefined , undefined , 'match-case' ) ;
187
195
this . caseSensitiveButton . setText ( 'Aa' ) ;
188
196
this . caseSensitiveButton . addEventListener ( ToolbarButton . Events . Click , this . toggleCaseSensitiveSearch , this ) ;
189
197
toolbar . appendToolbarItem ( this . caseSensitiveButton ) ;
190
198
}
191
199
192
200
if ( this . searchProvider . supportsRegexSearch ( ) ) {
193
- this . regexButton = new ToolbarToggle ( i18nString ( UIStrings . useRegularExpression ) ) ;
201
+ this . regexButton =
202
+ new ToolbarToggle ( i18nString ( UIStrings . useRegularExpression ) , undefined , undefined , 'regex-search' ) ;
194
203
this . regexButton . setText ( '.*' ) ;
195
204
this . regexButton . addEventListener ( ToolbarButton . Events . Click , this . toggleRegexSearch , this ) ;
196
205
toolbar . appendToolbarItem ( this . regexButton ) ;
0 commit comments