Changeset 92849 in webkit
- Timestamp:
- Aug 11, 2011, 7:59:15 AM (14 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r92848 r92849 1 2011-08-11 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Web Inspector: Scripts panel: display the current search match index in the toolbar. 4 https://bugs.webkit.org/show_bug.cgi?id=66048 5 6 Reviewed by Pavel Feldman. 7 8 * English.lproj/localizedStrings.js: 9 * inspector/front-end/ScriptsPanel.js: 10 (WebInspector.ScriptsPanel.prototype.performSearch.finishedCallback): 11 (WebInspector.ScriptsPanel.prototype.performSearch): 12 (WebInspector.ScriptsPanel.prototype.jumpToNextSearchResult): 13 (WebInspector.ScriptsPanel.prototype.jumpToPreviousSearchResult): 14 * inspector/front-end/SearchController.js: 15 (WebInspector.SearchController.prototype.updateSearchMatchesCount): 16 (WebInspector.SearchController.prototype.updateCurrentMatchIndex): 17 (WebInspector.SearchController.prototype.activePanelChanged.performPanelSearch): 18 (WebInspector.SearchController.prototype.activePanelChanged): 19 (WebInspector.SearchController.prototype._updateSearchMatchesCountAndCurrentMatchIndex): 20 (WebInspector.SearchController.prototype._performSearch): 21 * inspector/front-end/SourceFrame.js: 22 (WebInspector.SourceFrame.prototype.get currentSearchResultIndex): 23 1 24 2011-08-11 Xan Lopez <xlopez@igalia.com> 2 25 -
trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js
r92842 r92849 1059 1059 WebInspector.searchController.updateSearchMatchesCount(searchMatches, this); 1060 1060 view.jumpToFirstSearchResult(); 1061 WebInspector.searchController.updateCurrentMatchIndex(view.currentSearchResultIndex + 1, this); 1061 1062 } 1062 1063 … … 1078 1079 else 1079 1080 this._searchView.jumpToNextSearchResult(); 1081 WebInspector.searchController.updateCurrentMatchIndex(this._searchView.currentSearchResultIndex + 1, this); 1080 1082 }, 1081 1083 … … 1096 1098 else 1097 1099 this._searchView.jumpToPreviousSearchResult(); 1100 WebInspector.searchController.updateCurrentMatchIndex(this._searchView.currentSearchResultIndex + 1, this); 1098 1101 }, 1099 1102 -
trunk/Source/WebCore/inspector/front-end/SearchController.js
r87894 r92849 50 50 51 51 if (panel === WebInspector.currentPanel) 52 this._updateSearchMatchesCount(WebInspector.currentPanel.currentQuery && matches); 52 this._updateSearchMatchesCountAndCurrentMatchIndex(WebInspector.currentPanel.currentQuery && matches); 53 }, 54 55 updateCurrentMatchIndex: function(currentMatchIndex, panel) 56 { 57 if (panel === WebInspector.currentPanel) 58 this._updateSearchMatchesCountAndCurrentMatchIndex(panel.currentSearchMatches, currentMatchIndex); 53 59 }, 54 60 … … 124 130 function performPanelSearch() 125 131 { 126 this._updateSearchMatchesCount ();132 this._updateSearchMatchesCountAndCurrentMatchIndex(); 127 133 128 134 panel.currentQuery = this._currentQuery; … … 134 140 } else { 135 141 // Update to show Not found for panels that can't be searched. 136 this._updateSearchMatchesCount ();137 } 138 }, 139 140 _updateSearchMatchesCount : function(matches)142 this._updateSearchMatchesCountAndCurrentMatchIndex(); 143 } 144 }, 145 146 _updateSearchMatchesCountAndCurrentMatchIndex: function(matches, currentMatchIndex) 141 147 { 142 148 if (matches == null) { … … 146 152 147 153 if (matches) { 148 if (matches === 1) 149 var matchesString = WebInspector.UIString("1 match"); 150 else 151 var matchesString = WebInspector.UIString("%d matches", matches); 154 if (matches === 1) { 155 if (currentMatchIndex === 1) 156 var matchesString = WebInspector.UIString("1 of 1 match"); 157 else 158 var matchesString = WebInspector.UIString("1 match"); 159 } else { 160 if (currentMatchIndex) 161 var matchesString = WebInspector.UIString("%d of %d matches", currentMatchIndex, matches); 162 else 163 var matchesString = WebInspector.UIString("%d matches", matches); 164 } 152 165 } else 153 166 var matchesString = WebInspector.UIString("Not Found"); … … 239 252 } 240 253 241 this._updateSearchMatchesCount ();254 this._updateSearchMatchesCountAndCurrentMatchIndex(); 242 255 243 256 return; … … 259 272 this._currentQuery = query; 260 273 261 this._updateSearchMatchesCount ();274 this._updateSearchMatchesCountAndCurrentMatchIndex(); 262 275 263 276 if (!currentPanel.performSearch) -
trunk/Source/WebCore/inspector/front-end/SourceFrame.js
r92766 r92849 421 421 }, 422 422 423 get currentSearchResultIndex() 424 { 425 return this._currentSearchResultIndex; 426 }, 427 423 428 jumpToSearchResult: function(index) 424 429 {
Note:
See TracChangeset
for help on using the changeset viewer.