| 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 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 }, | 988 }, |
| 989 | 989 |
| 990 /** | 990 /** |
| 991 * @param {number} index | 991 * @param {number} index |
| 992 */ | 992 */ |
| 993 _jumpToMatch: function(index) | 993 _jumpToMatch: function(index) |
| 994 { | 994 { |
| 995 if (!this._regexMatchRanges.length) | 995 if (!this._regexMatchRanges.length) |
| 996 return; | 996 return; |
| 997 | 997 |
| 998 var currentSearchResultClassName = "current-search-result"; | |
| 999 | |
| 1000 var matchRange; | 998 var matchRange; |
| 1001 if (this._currentMatchRangeIndex >= 0) { | 999 if (this._currentMatchRangeIndex >= 0) { |
| 1002 matchRange = this._regexMatchRanges[this._currentMatchRangeIndex]; | 1000 matchRange = this._regexMatchRanges[this._currentMatchRangeIndex]; |
| 1003 var message = this._visibleViewMessages[matchRange.messageIndex]; | 1001 var message = this._visibleViewMessages[matchRange.messageIndex]; |
| 1004 message.searchHighlightNode(matchRange.matchIndex).classList.remove(
currentSearchResultClassName); | 1002 message.searchHighlightNode(matchRange.matchIndex).classList.remove(
WebInspector.highlightedCurrentSearchResultClassName); |
| 1005 } | 1003 } |
| 1006 | 1004 |
| 1007 index = mod(index, this._regexMatchRanges.length); | 1005 index = mod(index, this._regexMatchRanges.length); |
| 1008 this._currentMatchRangeIndex = index; | 1006 this._currentMatchRangeIndex = index; |
| 1009 this._searchableView.updateCurrentMatchIndex(index); | 1007 this._searchableView.updateCurrentMatchIndex(index); |
| 1010 matchRange = this._regexMatchRanges[index]; | 1008 matchRange = this._regexMatchRanges[index]; |
| 1011 var message = this._visibleViewMessages[matchRange.messageIndex]; | 1009 var message = this._visibleViewMessages[matchRange.messageIndex]; |
| 1012 var highlightNode = message.searchHighlightNode(matchRange.matchIndex); | 1010 var highlightNode = message.searchHighlightNode(matchRange.matchIndex); |
| 1013 highlightNode.classList.add(currentSearchResultClassName); | 1011 highlightNode.classList.add(WebInspector.highlightedCurrentSearchResultC
lassName); |
| 1014 this._viewport.scrollItemIntoView(matchRange.messageIndex); | 1012 this._viewport.scrollItemIntoView(matchRange.messageIndex); |
| 1015 highlightNode.scrollIntoViewIfNeeded(); | 1013 highlightNode.scrollIntoViewIfNeeded(); |
| 1016 }, | 1014 }, |
| 1017 | 1015 |
| 1018 __proto__: WebInspector.VBox.prototype | 1016 __proto__: WebInspector.VBox.prototype |
| 1019 } | 1017 } |
| 1020 | 1018 |
| 1021 /** | 1019 /** |
| 1022 * @constructor | 1020 * @constructor |
| 1023 * @extends {WebInspector.Object} | 1021 * @extends {WebInspector.Object} |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1331 return true; | 1329 return true; |
| 1332 } | 1330 } |
| 1333 return false; | 1331 return false; |
| 1334 } | 1332 } |
| 1335 } | 1333 } |
| 1336 | 1334 |
| 1337 /** | 1335 /** |
| 1338 * @typedef {{messageIndex: number, matchIndex: number}} | 1336 * @typedef {{messageIndex: number, matchIndex: number}} |
| 1339 */ | 1337 */ |
| 1340 WebInspector.ConsoleView.RegexMatchRange; | 1338 WebInspector.ConsoleView.RegexMatchRange; |
| OLD | NEW |