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

Side by Side Diff: Source/devtools/front_end/elements/ElementsPanel.js

Issue 658403002: DevTools: Support regex search and case sensitive search in sources panel (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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) 2008 Matt Lilek <webkit@mattlilek.com> 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 388
389 delete this._currentSearchResultIndex; 389 delete this._currentSearchResultIndex;
390 delete this._searchResults; 390 delete this._searchResults;
391 391
392 var targets = WebInspector.targetManager.targets(); 392 var targets = WebInspector.targetManager.targets();
393 for (var i = 0; i < targets.length; ++i) 393 for (var i = 0; i < targets.length; ++i)
394 targets[i].domModel.cancelSearch(); 394 targets[i].domModel.cancelSearch();
395 }, 395 },
396 396
397 /** 397 /**
398 * @param {string} query 398 * @param {!WebInspector.SearchableView.SearchConfig} searchConfig
399 * @param {boolean} shouldJump 399 * @param {boolean} shouldJump
400 * @param {boolean=} jumpBackwards 400 * @param {boolean=} jumpBackwards
401 */ 401 */
402 performSearch: function(query, shouldJump, jumpBackwards) 402 performSearch: function(searchConfig, shouldJump, jumpBackwards)
403 { 403 {
404 var query = searchConfig.query;
404 // Call searchCanceled since it will reset everything we need before doi ng a new search. 405 // Call searchCanceled since it will reset everything we need before doi ng a new search.
405 this.searchCanceled(); 406 this.searchCanceled();
406 407
407 const whitespaceTrimmedQuery = query.trim(); 408 const whitespaceTrimmedQuery = query.trim();
408 if (!whitespaceTrimmedQuery.length) 409 if (!whitespaceTrimmedQuery.length)
409 return; 410 return;
410 411
411 this._searchQuery = query; 412 this._searchQuery = query;
412 413
413 var targets = WebInspector.targetManager.targets(); 414 var targets = WebInspector.targetManager.targets();
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 this._jumpToSearchResult(this._currentSearchResultIndex + 1); 571 this._jumpToSearchResult(this._currentSearchResultIndex + 1);
571 }, 572 },
572 573
573 jumpToPreviousSearchResult: function() 574 jumpToPreviousSearchResult: function()
574 { 575 {
575 if (!this._searchResults) 576 if (!this._searchResults)
576 return; 577 return;
577 this._jumpToSearchResult(this._currentSearchResultIndex - 1); 578 this._jumpToSearchResult(this._currentSearchResultIndex - 1);
578 }, 579 },
579 580
581 /**
582 * @return {boolean}
583 */
584 supportsCaseSensitiveSearch: function()
585 {
586 return false;
587 },
588
589 /**
590 * @return {boolean}
591 */
592 supportsRegexSearch: function()
593 {
594 return false;
595 },
596
580 _highlightCurrentSearchResult: function() 597 _highlightCurrentSearchResult: function()
581 { 598 {
582 var index = this._currentSearchResultIndex; 599 var index = this._currentSearchResultIndex;
583 var searchResults = this._searchResults; 600 var searchResults = this._searchResults;
584 var searchResult = searchResults[index]; 601 var searchResult = searchResults[index];
585 602
586 if (searchResult.node === null) { 603 if (searchResult.node === null) {
587 this._searchableView.updateCurrentMatchIndex(index); 604 this._searchableView.updateCurrentMatchIndex(index);
588 return; 605 return;
589 } 606 }
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
1545 1562
1546 WebInspector.ElementsPanelFactory.prototype = { 1563 WebInspector.ElementsPanelFactory.prototype = {
1547 /** 1564 /**
1548 * @return {!WebInspector.Panel} 1565 * @return {!WebInspector.Panel}
1549 */ 1566 */
1550 createPanel: function() 1567 createPanel: function()
1551 { 1568 {
1552 return WebInspector.ElementsPanel.instance(); 1569 return WebInspector.ElementsPanel.instance();
1553 } 1570 }
1554 } 1571 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698