chrome-devtools-frontend 1.0.996595 → 1.0.997048
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/front_end/core/i18n/locales/en-US.json +6 -0
- package/front_end/core/i18n/locales/en-XL.json +6 -0
- package/front_end/core/root/Runtime.ts +5 -0
- package/front_end/core/sdk/DebuggerModel.ts +1 -1
- package/front_end/models/bindings/BreakpointManager.ts +12 -3
- package/front_end/panels/elements/StylesSidebarPane.ts +19 -9
- package/front_end/panels/elements/components/adornerSettingsPane.css +5 -0
- package/front_end/panels/elements/stylesSectionTree.css +4 -4
- package/front_end/panels/sources/DebuggerPlugin.ts +6 -2
- package/front_end/panels/sources/SourcesPanel.ts +22 -6
- package/front_end/panels/sources/sources-legacy.ts +1 -1
- package/front_end/panels/sources/sources-meta.ts +61 -7
- package/front_end/ui/legacy/SplitWidget.ts +17 -7
- package/package.json +1 -1
@@ -10004,6 +10004,12 @@
|
|
10004
10004
|
"panels/sources/sources-meta.ts | toggleBreakpointInputWindow": {
|
10005
10005
|
"message": "Toggle breakpoint input window"
|
10006
10006
|
},
|
10007
|
+
"panels/sources/sources-meta.ts | toggleDebuggerSidebar": {
|
10008
|
+
"message": "Toggle debugger sidebar"
|
10009
|
+
},
|
10010
|
+
"panels/sources/sources-meta.ts | toggleNavigatorSidebar": {
|
10011
|
+
"message": "Toggle navigator sidebar"
|
10012
|
+
},
|
10007
10013
|
"panels/sources/sources-meta.ts | trailing": {
|
10008
10014
|
"message": "Trailing"
|
10009
10015
|
},
|
@@ -10004,6 +10004,12 @@
|
|
10004
10004
|
"panels/sources/sources-meta.ts | toggleBreakpointInputWindow": {
|
10005
10005
|
"message": "T̂óĝǵl̂é b̂ŕêák̂ṕôín̂t́ îńp̂út̂ ẃîńd̂óŵ"
|
10006
10006
|
},
|
10007
|
+
"panels/sources/sources-meta.ts | toggleDebuggerSidebar": {
|
10008
|
+
"message": "T̂óĝǵl̂é d̂éb̂úĝǵêŕ ŝíd̂éb̂ár̂"
|
10009
|
+
},
|
10010
|
+
"panels/sources/sources-meta.ts | toggleNavigatorSidebar": {
|
10011
|
+
"message": "T̂óĝǵl̂é n̂áv̂íĝát̂ór̂ śîd́êb́âŕ"
|
10012
|
+
},
|
10007
10013
|
"panels/sources/sources-meta.ts | trailing": {
|
10008
10014
|
"message": "T̂ŕâíl̂ín̂ǵ"
|
10009
10015
|
},
|
@@ -206,6 +206,11 @@ export class ExperimentsSupport {
|
|
206
206
|
this.#enabledTransiently.add(experimentName);
|
207
207
|
}
|
208
208
|
|
209
|
+
disableForTest(experimentName: string): void {
|
210
|
+
this.checkExperiment(experimentName);
|
211
|
+
this.#enabledTransiently.delete(experimentName);
|
212
|
+
}
|
213
|
+
|
209
214
|
clearForTest(): void {
|
210
215
|
this.#experiments = [];
|
211
216
|
this.#experimentNames.clear();
|
@@ -652,7 +652,7 @@ export class DebuggerModel extends SDKModel<EventTypes> {
|
|
652
652
|
this.evaluateOnCallFrameCallback = callback;
|
653
653
|
}
|
654
654
|
|
655
|
-
setSynchronizeBreakpointsCallback(callback: (script: Script) => Promise<void>): void {
|
655
|
+
setSynchronizeBreakpointsCallback(callback: ((script: Script) => Promise<void>)|null): void {
|
656
656
|
this.#synchronizeBreakpointsCallback = callback;
|
657
657
|
}
|
658
658
|
|
@@ -100,11 +100,12 @@ export class BreakpointManager extends Common.ObjectWrapper.ObjectWrapper<EventT
|
|
100
100
|
|
101
101
|
modelAdded(debuggerModel: SDK.DebuggerModel.DebuggerModel): void {
|
102
102
|
if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.INSTRUMENTATION_BREAKPOINTS)) {
|
103
|
-
debuggerModel.setSynchronizeBreakpointsCallback(this
|
103
|
+
debuggerModel.setSynchronizeBreakpointsCallback(this.restoreBreakpointsForScript.bind(this));
|
104
104
|
}
|
105
105
|
}
|
106
106
|
|
107
|
-
modelRemoved(): void {
|
107
|
+
modelRemoved(debuggerModel: SDK.DebuggerModel.DebuggerModel): void {
|
108
|
+
debuggerModel.setSynchronizeBreakpointsCallback(null);
|
108
109
|
}
|
109
110
|
|
110
111
|
async copyBreakpoints(fromURL: Platform.DevToolsPath.UrlString, toSourceCode: Workspace.UISourceCode.UISourceCode):
|
@@ -117,7 +118,7 @@ export class BreakpointManager extends Common.ObjectWrapper.ObjectWrapper<EventT
|
|
117
118
|
|
118
119
|
// This method explicitly awaits the source map (if necessary) and the uiSourceCodes
|
119
120
|
// required to set all breakpoints that are related to this script.
|
120
|
-
async
|
121
|
+
async restoreBreakpointsForScript(script: SDK.Script.Script): Promise<void> {
|
121
122
|
if (!Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.INSTRUMENTATION_BREAKPOINTS)) {
|
122
123
|
return;
|
123
124
|
}
|
@@ -416,6 +417,10 @@ export class Breakpoint implements SDK.TargetManager.SDKModelObserver<SDK.Debugg
|
|
416
417
|
modelBreakpoint.removeEventListeners();
|
417
418
|
}
|
418
419
|
|
420
|
+
modelBreakpoint(debuggerModel: SDK.DebuggerModel.DebuggerModel): ModelBreakpoint|undefined {
|
421
|
+
return this.#modelBreakpoints.get(debuggerModel);
|
422
|
+
}
|
423
|
+
|
419
424
|
addUISourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode): void {
|
420
425
|
if (!this.uiSourceCodes.has(uiSourceCode)) {
|
421
426
|
this.uiSourceCodes.add(uiSourceCode);
|
@@ -626,6 +631,10 @@ export class ModelBreakpoint {
|
|
626
631
|
}
|
627
632
|
}
|
628
633
|
|
634
|
+
get currentState(): Breakpoint.State|null {
|
635
|
+
return this.#currentState;
|
636
|
+
}
|
637
|
+
|
629
638
|
resetLocations(): void {
|
630
639
|
for (const uiLocation of this.#uiLocations.values()) {
|
631
640
|
this.#breakpoint.uiLocationRemoved(uiLocation);
|
@@ -871,22 +871,32 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
|
|
871
871
|
};
|
872
872
|
});
|
873
873
|
|
874
|
-
let pseudoTypes: Protocol.DOM.PseudoType[] = [];
|
875
|
-
const keys = matchedStyles.pseudoTypes();
|
876
|
-
if (keys.delete(Protocol.DOM.PseudoType.Before)) {
|
877
|
-
pseudoTypes.push(Protocol.DOM.PseudoType.Before);
|
878
|
-
}
|
879
|
-
pseudoTypes = pseudoTypes.concat([...keys].sort());
|
880
|
-
|
881
874
|
const otherPseudoRulesets: {
|
882
875
|
highlightName: string|null,
|
883
876
|
pseudoType: Protocol.DOM.PseudoType,
|
884
877
|
pseudoStyles: SDK.CSSStyleDeclaration.CSSStyleDeclaration[],
|
885
|
-
}[] = pseudoTypes.map(pseudoType => {
|
878
|
+
}[] = [...matchedStyles.pseudoTypes()].map(pseudoType => {
|
886
879
|
return {'highlightName': null, 'pseudoType': pseudoType, 'pseudoStyles': matchedStyles.pseudoStyles(pseudoType)};
|
887
880
|
});
|
888
881
|
|
889
|
-
const pseudoRulesets = customHighlightPseudoRulesets.concat(otherPseudoRulesets)
|
882
|
+
const pseudoRulesets = customHighlightPseudoRulesets.concat(otherPseudoRulesets).sort((a, b) => {
|
883
|
+
// We want to show the ::before pseudos first, followed by the remaining pseudos
|
884
|
+
// in alphabetical order.
|
885
|
+
if (a.pseudoType === Protocol.DOM.PseudoType.Before && b.pseudoType !== Protocol.DOM.PseudoType.Before) {
|
886
|
+
return -1;
|
887
|
+
}
|
888
|
+
if (a.pseudoType !== Protocol.DOM.PseudoType.Before && b.pseudoType === Protocol.DOM.PseudoType.Before) {
|
889
|
+
return 1;
|
890
|
+
}
|
891
|
+
if (a.pseudoType < b.pseudoType) {
|
892
|
+
return -1;
|
893
|
+
}
|
894
|
+
if (a.pseudoType > b.pseudoType) {
|
895
|
+
return 1;
|
896
|
+
}
|
897
|
+
return 0;
|
898
|
+
});
|
899
|
+
|
890
900
|
for (const pseudo of pseudoRulesets) {
|
891
901
|
lastParentNode = null;
|
892
902
|
for (let i = 0; i < pseudo.pseudoStyles.length; ++i) {
|
@@ -126,6 +126,10 @@ ol.expanded {
|
|
126
126
|
opacity: 50%;
|
127
127
|
}
|
128
128
|
|
129
|
+
.changed {
|
130
|
+
background-color: var(--color-accent-green-background);
|
131
|
+
}
|
132
|
+
|
129
133
|
.changed::after {
|
130
134
|
content: "";
|
131
135
|
position: absolute;
|
@@ -140,10 +144,6 @@ ol.expanded {
|
|
140
144
|
display: none;
|
141
145
|
}
|
142
146
|
|
143
|
-
.changed:hover {
|
144
|
-
background-color: var(--color-accent-green-background);
|
145
|
-
}
|
146
|
-
|
147
147
|
.changed:hover .copy {
|
148
148
|
position: absolute;
|
149
149
|
right: -4px;
|
@@ -536,6 +536,10 @@ export class DebuggerPlugin extends Plugin {
|
|
536
536
|
return true;
|
537
537
|
}
|
538
538
|
|
539
|
+
private isVariableIdentifier(tokenType: string): boolean {
|
540
|
+
return tokenType === 'VariableName' || tokenType === 'VariableDefinition';
|
541
|
+
}
|
542
|
+
|
539
543
|
private isIdentifier(tokenType: string): boolean {
|
540
544
|
return tokenType === 'VariableName' || tokenType === 'VariableDefinition' || tokenType === 'PropertyName' ||
|
541
545
|
tokenType === 'PropertyDefinition';
|
@@ -962,8 +966,8 @@ export class DebuggerPlugin extends Plugin {
|
|
962
966
|
tree.iterate({
|
963
967
|
from: fromPos,
|
964
968
|
to: toPos,
|
965
|
-
enter
|
966
|
-
const varName = node.name
|
969
|
+
enter: node => {
|
970
|
+
const varName = this.isVariableIdentifier(node.name) && editorState.sliceDoc(node.from, node.to);
|
967
971
|
if (varName && variableMap.has(varName)) {
|
968
972
|
if (node.from > curLine.to) {
|
969
973
|
curLine = editorState.doc.lineAt(node.from);
|
@@ -439,6 +439,14 @@ export class SourcesPanel extends UI.Panel.Panel implements UI.ContextMenu.Provi
|
|
439
439
|
return this.sourcesViewInternal.searchableView();
|
440
440
|
}
|
441
441
|
|
442
|
+
toggleNavigatorSidebar(): void {
|
443
|
+
this.editorView.toggleSidebar();
|
444
|
+
}
|
445
|
+
|
446
|
+
toggleDebuggerSidebar(): void {
|
447
|
+
this.splitWidget.toggleSidebar();
|
448
|
+
}
|
449
|
+
|
442
450
|
private debuggerPaused(event: Common.EventTarget.EventTargetEvent<SDK.DebuggerModel.DebuggerModel>): void {
|
443
451
|
const debuggerModel = event.data;
|
444
452
|
const details = debuggerModel.debuggerPausedDetails();
|
@@ -1285,18 +1293,18 @@ export class RevealingActionDelegate implements UI.ActionRegistration.ActionDele
|
|
1285
1293
|
}
|
1286
1294
|
}
|
1287
1295
|
|
1288
|
-
let
|
1296
|
+
let actionDelegateInstance: ActionDelegate;
|
1289
1297
|
|
1290
|
-
export class
|
1298
|
+
export class ActionDelegate implements UI.ActionRegistration.ActionDelegate {
|
1291
1299
|
static instance(opts: {
|
1292
1300
|
forceNew: boolean|null,
|
1293
|
-
} = {forceNew: null}):
|
1301
|
+
} = {forceNew: null}): ActionDelegate {
|
1294
1302
|
const {forceNew} = opts;
|
1295
|
-
if (!
|
1296
|
-
|
1303
|
+
if (!actionDelegateInstance || forceNew) {
|
1304
|
+
actionDelegateInstance = new ActionDelegate();
|
1297
1305
|
}
|
1298
1306
|
|
1299
|
-
return
|
1307
|
+
return actionDelegateInstance;
|
1300
1308
|
}
|
1301
1309
|
handleAction(context: UI.Context.Context, actionId: string): boolean {
|
1302
1310
|
const panel = SourcesPanel.instance();
|
@@ -1340,6 +1348,14 @@ export class DebuggingActionDelegate implements UI.ActionRegistration.ActionDele
|
|
1340
1348
|
}
|
1341
1349
|
return true;
|
1342
1350
|
}
|
1351
|
+
case 'sources.toggle-navigator-sidebar': {
|
1352
|
+
panel.toggleNavigatorSidebar();
|
1353
|
+
return true;
|
1354
|
+
}
|
1355
|
+
case 'sources.toggle-debugger-sidebar': {
|
1356
|
+
panel.toggleDebuggerSidebar();
|
1357
|
+
return true;
|
1358
|
+
}
|
1343
1359
|
}
|
1344
1360
|
return false;
|
1345
1361
|
}
|
@@ -189,7 +189,7 @@ Sources.SourcesPanel.DebuggerPausedDetailsRevealer = SourcesModule.SourcesPanel.
|
|
189
189
|
Sources.SourcesPanel.RevealingActionDelegate = SourcesModule.SourcesPanel.RevealingActionDelegate;
|
190
190
|
|
191
191
|
/** @constructor */
|
192
|
-
Sources.SourcesPanel.
|
192
|
+
Sources.SourcesPanel.ActionDelegate = SourcesModule.SourcesPanel.ActionDelegate;
|
193
193
|
|
194
194
|
/** @constructor */
|
195
195
|
Sources.SourcesPanel.WrapperView = SourcesModule.SourcesPanel.WrapperView;
|
@@ -378,6 +378,14 @@ const UIStrings = {
|
|
378
378
|
* comes to a halt.
|
379
379
|
*/
|
380
380
|
enableAutoFocusOnDebuggerPaused: 'Focus Sources panel when triggering a breakpoint',
|
381
|
+
/**
|
382
|
+
* @description Text for command of toggling navigator sidebar in Sources panel
|
383
|
+
*/
|
384
|
+
toggleNavigatorSidebar: 'Toggle navigator sidebar',
|
385
|
+
/**
|
386
|
+
* @description Text for command of toggling debugger sidebar in Sources panel
|
387
|
+
*/
|
388
|
+
toggleDebuggerSidebar: 'Toggle debugger sidebar',
|
381
389
|
|
382
390
|
};
|
383
391
|
const str_ = i18n.i18n.registerUIStrings('panels/sources/sources-meta.ts', UIStrings);
|
@@ -567,7 +575,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
567
575
|
actionId: 'debugger.step-over',
|
568
576
|
async loadActionDelegate() {
|
569
577
|
const Sources = await loadSourcesModule();
|
570
|
-
return Sources.SourcesPanel.
|
578
|
+
return Sources.SourcesPanel.ActionDelegate.instance();
|
571
579
|
},
|
572
580
|
|
573
581
|
title: i18nLazyString(UIStrings.stepOverNextFunctionCall),
|
@@ -599,7 +607,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
599
607
|
actionId: 'debugger.step-into',
|
600
608
|
async loadActionDelegate() {
|
601
609
|
const Sources = await loadSourcesModule();
|
602
|
-
return Sources.SourcesPanel.
|
610
|
+
return Sources.SourcesPanel.ActionDelegate.instance();
|
603
611
|
},
|
604
612
|
title: i18nLazyString(UIStrings.stepIntoNextFunctionCall),
|
605
613
|
iconClass: UI.ActionRegistration.IconClass.LARGE_ICON_STEP_INTO,
|
@@ -630,7 +638,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
630
638
|
actionId: 'debugger.step',
|
631
639
|
async loadActionDelegate() {
|
632
640
|
const Sources = await loadSourcesModule();
|
633
|
-
return Sources.SourcesPanel.
|
641
|
+
return Sources.SourcesPanel.ActionDelegate.instance();
|
634
642
|
},
|
635
643
|
title: i18nLazyString(UIStrings.step),
|
636
644
|
iconClass: UI.ActionRegistration.IconClass.LARGE_ICON_STEP,
|
@@ -652,7 +660,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
652
660
|
actionId: 'debugger.step-out',
|
653
661
|
async loadActionDelegate() {
|
654
662
|
const Sources = await loadSourcesModule();
|
655
|
-
return Sources.SourcesPanel.
|
663
|
+
return Sources.SourcesPanel.ActionDelegate.instance();
|
656
664
|
},
|
657
665
|
title: i18nLazyString(UIStrings.stepOutOfCurrentFunction),
|
658
666
|
iconClass: UI.ActionRegistration.IconClass.LARGE_ICON_STEP_OUT,
|
@@ -683,7 +691,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
683
691
|
category: UI.ActionRegistration.ActionCategory.DEBUGGER,
|
684
692
|
async loadActionDelegate() {
|
685
693
|
const Sources = await loadSourcesModule();
|
686
|
-
return Sources.SourcesPanel.
|
694
|
+
return Sources.SourcesPanel.ActionDelegate.instance();
|
687
695
|
},
|
688
696
|
title: i18nLazyString(UIStrings.runSnippet),
|
689
697
|
iconClass: UI.ActionRegistration.IconClass.LARGEICON_PLAY,
|
@@ -709,7 +717,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
709
717
|
toggleable: true,
|
710
718
|
async loadActionDelegate() {
|
711
719
|
const Sources = await loadSourcesModule();
|
712
|
-
return Sources.SourcesPanel.
|
720
|
+
return Sources.SourcesPanel.ActionDelegate.instance();
|
713
721
|
},
|
714
722
|
contextTypes() {
|
715
723
|
return maybeRetrieveContextTypes(Sources => [Sources.SourcesView.SourcesView]);
|
@@ -764,7 +772,7 @@ UI.ActionRegistration.registerActionExtension({
|
|
764
772
|
category: UI.ActionRegistration.ActionCategory.DEBUGGER,
|
765
773
|
async loadActionDelegate() {
|
766
774
|
const Sources = await loadSourcesModule();
|
767
|
-
return Sources.SourcesPanel.
|
775
|
+
return Sources.SourcesPanel.ActionDelegate.instance();
|
768
776
|
},
|
769
777
|
title: i18nLazyString(UIStrings.evaluateSelectedTextInConsole),
|
770
778
|
contextTypes() {
|
@@ -1240,6 +1248,52 @@ UI.ActionRegistration.registerActionExtension({
|
|
1240
1248
|
],
|
1241
1249
|
});
|
1242
1250
|
|
1251
|
+
UI.ActionRegistration.registerActionExtension({
|
1252
|
+
actionId: 'sources.toggle-navigator-sidebar',
|
1253
|
+
category: UI.ActionRegistration.ActionCategory.SOURCES,
|
1254
|
+
title: i18nLazyString(UIStrings.toggleNavigatorSidebar),
|
1255
|
+
async loadActionDelegate() {
|
1256
|
+
const Sources = await loadSourcesModule();
|
1257
|
+
return Sources.SourcesPanel.ActionDelegate.instance();
|
1258
|
+
},
|
1259
|
+
contextTypes() {
|
1260
|
+
return maybeRetrieveContextTypes(Sources => [Sources.SourcesView.SourcesView]);
|
1261
|
+
},
|
1262
|
+
bindings: [
|
1263
|
+
{
|
1264
|
+
platform: UI.ActionRegistration.Platforms.WindowsLinux,
|
1265
|
+
shortcut: 'Ctrl+Shift+y',
|
1266
|
+
},
|
1267
|
+
{
|
1268
|
+
platform: UI.ActionRegistration.Platforms.Mac,
|
1269
|
+
shortcut: 'Meta+Shift+y',
|
1270
|
+
},
|
1271
|
+
],
|
1272
|
+
});
|
1273
|
+
|
1274
|
+
UI.ActionRegistration.registerActionExtension({
|
1275
|
+
actionId: 'sources.toggle-debugger-sidebar',
|
1276
|
+
category: UI.ActionRegistration.ActionCategory.SOURCES,
|
1277
|
+
title: i18nLazyString(UIStrings.toggleDebuggerSidebar),
|
1278
|
+
async loadActionDelegate() {
|
1279
|
+
const Sources = await loadSourcesModule();
|
1280
|
+
return Sources.SourcesPanel.ActionDelegate.instance();
|
1281
|
+
},
|
1282
|
+
contextTypes() {
|
1283
|
+
return maybeRetrieveContextTypes(Sources => [Sources.SourcesView.SourcesView]);
|
1284
|
+
},
|
1285
|
+
bindings: [
|
1286
|
+
{
|
1287
|
+
platform: UI.ActionRegistration.Platforms.WindowsLinux,
|
1288
|
+
shortcut: 'Ctrl+Shift+h',
|
1289
|
+
},
|
1290
|
+
{
|
1291
|
+
platform: UI.ActionRegistration.Platforms.Mac,
|
1292
|
+
shortcut: 'Meta+Shift+h',
|
1293
|
+
},
|
1294
|
+
],
|
1295
|
+
});
|
1296
|
+
|
1243
1297
|
Common.Settings.registerSettingExtension({
|
1244
1298
|
settingName: 'navigatorGroupByFolder',
|
1245
1299
|
settingType: Common.Settings.SettingType.BOOLEAN,
|
@@ -61,6 +61,8 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
61
61
|
private animationCallback: (() => void)|null;
|
62
62
|
private showSidebarButtonTitle: Common.UIString.LocalizedString;
|
63
63
|
private hideSidebarButtonTitle: Common.UIString.LocalizedString;
|
64
|
+
private shownSidebarString: Common.UIString.LocalizedString;
|
65
|
+
private hiddenSidebarString: Common.UIString.LocalizedString;
|
64
66
|
private showHideSidebarButton: ToolbarButton|null;
|
65
67
|
private isVerticalInternal: boolean;
|
66
68
|
private sidebarMinimized: boolean;
|
@@ -111,6 +113,8 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
111
113
|
this.animationCallback = null;
|
112
114
|
this.showSidebarButtonTitle = Common.UIString.LocalizedEmptyString;
|
113
115
|
this.hideSidebarButtonTitle = Common.UIString.LocalizedEmptyString;
|
116
|
+
this.shownSidebarString = Common.UIString.LocalizedEmptyString;
|
117
|
+
this.hiddenSidebarString = Common.UIString.LocalizedEmptyString;
|
114
118
|
this.showHideSidebarButton = null;
|
115
119
|
this.isVerticalInternal = false;
|
116
120
|
this.sidebarMinimized = false;
|
@@ -821,23 +825,29 @@ export class SplitWidget extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
821
825
|
shownString: Common.UIString.LocalizedString, hiddenString: Common.UIString.LocalizedString): ToolbarButton {
|
822
826
|
this.showSidebarButtonTitle = showTitle;
|
823
827
|
this.hideSidebarButtonTitle = hideTitle;
|
828
|
+
this.shownSidebarString = shownString;
|
829
|
+
this.hiddenSidebarString = hiddenString;
|
824
830
|
this.showHideSidebarButton = new ToolbarButton('', '');
|
825
831
|
this.showHideSidebarButton.addEventListener(ToolbarButton.Events.Click, buttonClicked, this);
|
826
832
|
this.updateShowHideSidebarButton();
|
827
833
|
|
828
834
|
function buttonClicked(this: SplitWidget): void {
|
829
|
-
|
830
|
-
this.showBoth(true);
|
831
|
-
ARIAUtils.alert(shownString);
|
832
|
-
} else {
|
833
|
-
this.hideSidebar(true);
|
834
|
-
ARIAUtils.alert(hiddenString);
|
835
|
-
}
|
835
|
+
this.toggleSidebar();
|
836
836
|
}
|
837
837
|
|
838
838
|
return this.showHideSidebarButton;
|
839
839
|
}
|
840
840
|
|
841
|
+
toggleSidebar(): void {
|
842
|
+
if (this.showModeInternal !== ShowMode.Both) {
|
843
|
+
this.showBoth(true);
|
844
|
+
ARIAUtils.alert(this.shownSidebarString);
|
845
|
+
} else {
|
846
|
+
this.hideSidebar(true);
|
847
|
+
ARIAUtils.alert(this.hiddenSidebarString);
|
848
|
+
}
|
849
|
+
}
|
850
|
+
|
841
851
|
private updateShowHideSidebarButton(): void {
|
842
852
|
if (!this.showHideSidebarButton) {
|
843
853
|
return;
|
package/package.json
CHANGED