| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @implements {WebInspector.ProjectSearchConfig} | 7 * @implements {WebInspector.ProjectSearchConfig} |
| 8 * @param {string} query | 8 * @param {string} query |
| 9 * @param {boolean} ignoreCase | 9 * @param {boolean} ignoreCase |
| 10 * @param {boolean} isRegex | 10 * @param {boolean} isRegex |
| 11 */ | 11 */ |
| 12 WebInspector.SearchConfig = function(query, ignoreCase, isRegex) | 12 WebInspector.SearchConfig = function(query, ignoreCase, isRegex) |
| 13 { | 13 { |
| 14 this._query = query; | 14 this._query = query; |
| 15 this._ignoreCase = ignoreCase; | 15 this._ignoreCase = ignoreCase; |
| 16 this._isRegex = isRegex; | 16 this._isRegex = isRegex; |
| 17 this._parse(); | 17 this._parse(); |
| 18 } | 18 }; |
| 19 | 19 |
| 20 /** @typedef {!{regex: !RegExp, isNegative: boolean}} */ | 20 /** @typedef {!{regex: !RegExp, isNegative: boolean}} */ |
| 21 WebInspector.SearchConfig.RegexQuery; | 21 WebInspector.SearchConfig.RegexQuery; |
| 22 | 22 |
| 23 /** | 23 /** |
| 24 * @param {{query: string, ignoreCase: boolean, isRegex: boolean}} object | 24 * @param {{query: string, ignoreCase: boolean, isRegex: boolean}} object |
| 25 * @return {!WebInspector.SearchConfig} | 25 * @return {!WebInspector.SearchConfig} |
| 26 */ | 26 */ |
| 27 WebInspector.SearchConfig.fromPlainObject = function(object) | 27 WebInspector.SearchConfig.fromPlainObject = function(object) |
| 28 { | 28 { |
| 29 return new WebInspector.SearchConfig(object.query, object.ignoreCase, object
.isRegex); | 29 return new WebInspector.SearchConfig(object.query, object.ignoreCase, object
.isRegex); |
| 30 } | 30 }; |
| 31 | 31 |
| 32 WebInspector.SearchConfig.prototype = { | 32 WebInspector.SearchConfig.prototype = { |
| 33 /** | 33 /** |
| 34 * @override | 34 * @override |
| 35 * @return {string} | 35 * @return {string} |
| 36 */ | 36 */ |
| 37 query: function() | 37 query: function() |
| 38 { | 38 { |
| 39 return this._query; | 39 return this._query; |
| 40 }, | 40 }, |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 if (nextChar === " ") | 171 if (nextChar === " ") |
| 172 result += " "; | 172 result += " "; |
| 173 } else { | 173 } else { |
| 174 if (String.regexSpecialCharacters().indexOf(query.charAt(i)) !==
-1) | 174 if (String.regexSpecialCharacters().indexOf(query.charAt(i)) !==
-1) |
| 175 result += "\\"; | 175 result += "\\"; |
| 176 result += query.charAt(i); | 176 result += query.charAt(i); |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 return new WebInspector.SearchConfig.QueryTerm(result, isNegative); | 179 return new WebInspector.SearchConfig.QueryTerm(result, isNegative); |
| 180 } | 180 } |
| 181 } | 181 }; |
| 182 | 182 |
| 183 /** | 183 /** |
| 184 * @constructor | 184 * @constructor |
| 185 * @param {string} text | 185 * @param {string} text |
| 186 * @param {boolean} isNegative | 186 * @param {boolean} isNegative |
| 187 */ | 187 */ |
| 188 WebInspector.SearchConfig.QueryTerm = function(text, isNegative) | 188 WebInspector.SearchConfig.QueryTerm = function(text, isNegative) |
| 189 { | 189 { |
| 190 this.text = text; | 190 this.text = text; |
| 191 this.isNegative = isNegative; | 191 this.isNegative = isNegative; |
| 192 } | 192 }; |
| OLD | NEW |