Changeset 259748 in webkit
- Timestamp:
- Apr 8, 2020, 1:02:17 PM (6 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
Localizations/en.lproj/localizedStrings.js (modified) (1 diff)
-
UserInterface/Base/Main.js (modified) (2 diffs)
-
UserInterface/Base/Setting.js (modified) (1 diff)
-
UserInterface/Views/SettingsTabContentView.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r259744 r259748 1 2020-04-08 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Search: populate the search field with the current selection when using the global search shortcut 4 https://bugs.webkit.org/show_bug.cgi?id=210207 5 6 Reviewed by Timothy Hatcher. 7 8 Add a setting to control whether the global search (⇧⌘F) should be populated by the current 9 selection (if it exists), allowing for a quicker flow for "show me everywhere this exists". 10 11 * UserInterface/Base/Setting.js: 12 * UserInterface/Views/SettingsTabContentView.js: 13 (WI.SettingsTabContentView.prototype._createGeneralSettingsView): 14 15 * UserInterface/Base/Main.js: 16 (WI._focusSearchField) 17 18 * Localizations/en.lproj/localizedStrings.js: 19 1 20 2020-04-08 Devin Rousso <drousso@apple.com> 2 21 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r259744 r259748 616 616 localizedStrings["Global Code"] = "Global Code"; 617 617 localizedStrings["Global Lexical Environment"] = "Global Lexical Environment"; 618 /* Settings tab checkbox label for whether the global search should populate from the current selection. */ 619 localizedStrings["Global Search From Selection @ Settings"] = "%s from selection"; 618 620 localizedStrings["Global Variables"] = "Global Variables"; 619 621 localizedStrings["Grammar"] = "Grammar"; -
trunk/Source/WebInspectorUI/UserInterface/Base/Main.js
r259277 r259748 1543 1543 WI._focusSearchField = function(event) 1544 1544 { 1545 let searchQuery = ""; 1546 1547 if (WI.settings.searchFromSelection.value) { 1548 let selection = window.getSelection(); 1549 if (selection.type === "Range" || !selection.isCollapsed) 1550 searchQuery = selection.toString().removeWordBreakCharacters(); 1551 } 1552 1545 1553 WI.tabBrowser.showTabForContentView(WI._searchTabContentView, { 1546 1554 // Classify this as a keyboard shortcut, as the only other way to get to Search Tab is via TabBar itself. … … 1549 1557 1550 1558 WI._searchTabContentView.focusSearchField(); 1559 1560 if (searchQuery) 1561 WI._searchTabContentView.performSearch(searchQuery); 1551 1562 }; 1552 1563 -
trunk/Source/WebInspectorUI/UserInterface/Base/Setting.js
r257759 r259748 194 194 resourceCachingDisabled: new WI.Setting("disable-resource-caching", false), 195 195 searchCaseSensitive: new WI.Setting("search-case-sensitive", false), 196 searchFromSelection: new WI.Setting("search-from-selection", false), 196 197 searchRegularExpression: new WI.Setting("search-regular-expression", false), 197 198 selectedNetworkDetailContentViewIdentifier: new WI.Setting("network-detail-content-view-identifier", "preview"), -
trunk/Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js
r259101 r259748 252 252 searchGroup.addSetting(WI.settings.searchCaseSensitive, WI.UIString("Case Sensitive", "Case Sensitive @ Settings", "Settings tab checkbox label for whether searches should be case sensitive.")); 253 253 searchGroup.addSetting(WI.settings.searchRegularExpression, WI.UIString("Regular Expression", "Regular Expression @ Settings", "Settings tab checkbox label for whether searches should be treated as regular expressions.")); 254 searchGroup.addSetting(WI.settings.searchFromSelection, WI.UIString("%s from selection", "Global Search From Selection @ Settings", "Settings tab checkbox label for whether the global search should populate from the current selection.").format(WI.searchKeyboardShortcut.displayName)); 254 255 255 256 generalSettingsView.addSeparator();
Note:
See TracChangeset
for help on using the changeset viewer.