| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 | 898 |
| 899 searchCanceled: function() | 899 searchCanceled: function() |
| 900 { | 900 { |
| 901 this._clearCurrentSearchResultHighlight(); | 901 this._clearCurrentSearchResultHighlight(); |
| 902 delete this._searchResults; | 902 delete this._searchResults; |
| 903 delete this._searchRegex; | 903 delete this._searchRegex; |
| 904 this._viewport.refresh(); | 904 this._viewport.refresh(); |
| 905 }, | 905 }, |
| 906 | 906 |
| 907 /** | 907 /** |
| 908 * @param {string} query | 908 * @param {!WebInspector.SearchableView.SearchConfig} searchConfig |
| 909 * @param {boolean} shouldJump | 909 * @param {boolean} shouldJump |
| 910 * @param {boolean=} jumpBackwards | 910 * @param {boolean=} jumpBackwards |
| 911 */ | 911 */ |
| 912 performSearch: function(query, shouldJump, jumpBackwards) | 912 performSearch: function(searchConfig, shouldJump, jumpBackwards) |
| 913 { | 913 { |
| 914 var query = searchConfig.query; |
| 914 this.searchCanceled(); | 915 this.searchCanceled(); |
| 915 this._searchableView.updateSearchMatchesCount(0); | 916 this._searchableView.updateSearchMatchesCount(0); |
| 916 this._searchRegex = createPlainTextSearchRegex(query, "gi"); | 917 this._searchRegex = createPlainTextSearchRegex(query, "gi"); |
| 917 | 918 |
| 918 /** @type {!Array.<number>} */ | 919 /** @type {!Array.<number>} */ |
| 919 this._searchResults = []; | 920 this._searchResults = []; |
| 920 for (var i = 0; i < this._visibleViewMessages.length; i++) { | 921 for (var i = 0; i < this._visibleViewMessages.length; i++) { |
| 921 if (this._visibleViewMessages[i].matchesRegex(this._searchRegex)) | 922 if (this._visibleViewMessages[i].matchesRegex(this._searchRegex)) |
| 922 this._searchResults.push(i); | 923 this._searchResults.push(i); |
| 923 } | 924 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 935 this._jumpToSearchResult(this._currentSearchResultIndex + 1); | 936 this._jumpToSearchResult(this._currentSearchResultIndex + 1); |
| 936 }, | 937 }, |
| 937 | 938 |
| 938 jumpToPreviousSearchResult: function() | 939 jumpToPreviousSearchResult: function() |
| 939 { | 940 { |
| 940 if (!this._searchResults || !this._searchResults.length) | 941 if (!this._searchResults || !this._searchResults.length) |
| 941 return; | 942 return; |
| 942 this._jumpToSearchResult(this._currentSearchResultIndex - 1); | 943 this._jumpToSearchResult(this._currentSearchResultIndex - 1); |
| 943 }, | 944 }, |
| 944 | 945 |
| 946 /** |
| 947 * @return {boolean} |
| 948 */ |
| 949 supportsCaseSensitiveSearch: function() |
| 950 { |
| 951 return false; |
| 952 }, |
| 953 |
| 954 /** |
| 955 * @return {boolean} |
| 956 */ |
| 957 supportsRegexSearch: function() |
| 958 { |
| 959 return false; |
| 960 }, |
| 961 |
| 945 _clearCurrentSearchResultHighlight: function() | 962 _clearCurrentSearchResultHighlight: function() |
| 946 { | 963 { |
| 947 if (!this._searchResults) | 964 if (!this._searchResults) |
| 948 return; | 965 return; |
| 949 | 966 |
| 950 var highlightedViewMessage = this._visibleViewMessages[this._searchResul
ts[this._currentSearchResultIndex]]; | 967 var highlightedViewMessage = this._visibleViewMessages[this._searchResul
ts[this._currentSearchResultIndex]]; |
| 951 if (highlightedViewMessage) | 968 if (highlightedViewMessage) |
| 952 highlightedViewMessage.clearHighlight(); | 969 highlightedViewMessage.clearHighlight(); |
| 953 this._currentSearchResultIndex = -1; | 970 this._currentSearchResultIndex = -1; |
| 954 }, | 971 }, |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1266 WebInspector.ConsoleView.ShowConsoleActionDelegate.prototype = { | 1283 WebInspector.ConsoleView.ShowConsoleActionDelegate.prototype = { |
| 1267 /** | 1284 /** |
| 1268 * @return {boolean} | 1285 * @return {boolean} |
| 1269 */ | 1286 */ |
| 1270 handleAction: function() | 1287 handleAction: function() |
| 1271 { | 1288 { |
| 1272 WebInspector.console.show(); | 1289 WebInspector.console.show(); |
| 1273 return true; | 1290 return true; |
| 1274 } | 1291 } |
| 1275 } | 1292 } |
| OLD | NEW |