Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(998)

Unified Diff: Source/devtools/front_end/console/ConsoleViewMessage.js

Issue 676193002: Navigate between individual search matches in DevTools console (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Consolidate test suites Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/console/ConsoleViewMessage.js
diff --git a/Source/devtools/front_end/console/ConsoleViewMessage.js b/Source/devtools/front_end/console/ConsoleViewMessage.js
index 4060a6161a6fd665005da0c50bb1c19a4773ff2e..ae47da5346be3542bc349179ca7ad53cae301481 100644
--- a/Source/devtools/front_end/console/ConsoleViewMessage.js
+++ b/Source/devtools/front_end/console/ConsoleViewMessage.js
@@ -951,22 +951,12 @@ WebInspector.ConsoleViewMessage.prototype = {
return String.format(format, parameters, formatters, formattedResult, append);
},
- clearHighlight: function()
+ clearHighlights: function()
{
if (!this._formattedMessage)
return;
- WebInspector.removeSearchResultsHighlight(this._formattedMessage);
- },
-
- highlightSearchResults: function(regexObject)
- {
- if (!this._formattedMessage)
- return;
-
- this._highlightSearchResultsInElement(regexObject, this._messageElement);
- if (this._anchorElement)
- this._highlightSearchResultsInElement(regexObject, this._anchorElement);
+ WebInspector.removeSearchResultsHighlight(this._formattedMessage, WebInspector.highlightedSearchResultClassName);
},
_highlightSearchResultsInElement: function(regexObject, element)
@@ -1283,6 +1273,28 @@ WebInspector.ConsoleViewMessage.prototype = {
},
/**
+ * @return {string}
+ */
+ getText: function ()
lushnikov 2014/12/04 16:07:34 We have getter text() and method getText, which is
aknudsen 2014/12/05 22:30:02 Done.
+ {
+ if (!this._messageElement)
+ return "";
+ return this._messageElement.textContent;
+ },
+
+ /**
+ * @param {!Array.<!Object>} ranges
+ * @return {!Array.<!Element>}
+ */
+ highlightMatches: function(ranges)
+ {
+ var highlightNodes = [];
+ if (this._formattedMessage)
+ highlightNodes = WebInspector.highlightSearchResults(this._messageElement, ranges);
+ return highlightNodes;
+ },
+
+ /**
* @param {string} string
* @return {?Element}
*/

Powered by Google App Engine
This is Rietveld 408576698