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

Unified Diff: Source/devtools/front_end/components/SearchableView.js

Issue 632573002: Adding regex support to search bar in dev tools console (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 6 years, 2 months 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/components/SearchableView.js
diff --git a/Source/devtools/front_end/components/SearchableView.js b/Source/devtools/front_end/components/SearchableView.js
index dd4021a9d8d9b32fd6410a1ff5d68b2fe85cb7b0..ba11a5dc51ae609052a8bec996e5315a4faf8870 100644
--- a/Source/devtools/front_end/components/SearchableView.js
+++ b/Source/devtools/front_end/components/SearchableView.js
@@ -33,9 +33,11 @@
* @constructor
* @extends {WebInspector.VBox}
* @param {!WebInspector.Searchable} searchable
+ * @param {!boolean} supportRegex
eustas 2014/10/06 08:16:07 If you make this parameter optional, then you can
robwu 2014/10/06 08:30:21 After looking over the rest, I'm not sure if this
aknudsen 2014/10/07 19:39:56 Done.
*/
-WebInspector.SearchableView = function(searchable)
+WebInspector.SearchableView = function(searchable, supportRegex)
{
+ var self = this;
eustas 2014/10/06 08:16:07 We usually don't do that way.
robwu 2014/10/06 08:30:21 Remove this and use "this" instead of "self".
aknudsen 2014/10/07 19:39:56 Done.
aknudsen 2014/10/07 19:39:57 Done.
WebInspector.VBox.call(this);
this._searchProvider = searchable;
@@ -114,6 +116,24 @@ WebInspector.SearchableView = function(searchable)
this._replaceLabelElement.textContent = WebInspector.UIString("Replace");
this._replaceLabelElement.setAttribute("for", replaceCheckboxId);
+ if (supportRegex) {
+ self._regexElement = self._firstRowElement.createChild("td").createChild("span");
+
+ self._regexCheckboxElement = self._regexElement.createChild("input");
+ self._regexCheckboxElement.type = "checkbox";
+ var regexCheckboxId = "search-regex-trigger" + self._uniqueId;
+ self._regexCheckboxElement.id = regexCheckboxId;
+ self.enableRegex = false;
+ self._regexCheckboxElement.addEventListener("change", function (event) {
eustas 2014/10/06 08:16:07 Don't inline function and bind it to this.
aknudsen 2014/10/07 19:39:56 Done.
+ self.enableRegex = event.target.checked;
+ self._performSearch(true, true, true);
+ }, false);
robwu 2014/10/06 08:30:21 Move the contents of this function to a separate m
aknudsen 2014/10/07 19:39:56 Done.
+
+ self._regexLabelElement = self._regexElement.createChild("label");
+ self._regexLabelElement.textContent = WebInspector.UIString("Regex");
+ self._regexElement.setAttribute("for", regexCheckboxId);
robwu 2014/10/06 08:30:21 Change to this._regexLabelElement.setAttribute("f
aknudsen 2014/10/07 19:39:56 Done.
+ }
+
// Column 5
var cancelButtonElement = this._firstRowElement.createChild("td").createChild("button");
cancelButtonElement.textContent = WebInspector.UIString("Cancel");
« no previous file with comments | « no previous file | Source/devtools/front_end/console/ConsoleView.js » ('j') | Source/devtools/front_end/console/ConsoleView.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698