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

Side by Side Diff: chrome/browser/resources/options/search_page.js

Issue 7616004: Enable the help page and the keyboard overlay to be shown with shortcut key on settings tab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 cr.define('options', function() { 5 cr.define('options', function() {
6 const OptionsPage = options.OptionsPage; 6 const OptionsPage = options.OptionsPage;
7 7
8 /** 8 /**
9 * Encapsulated handling of a search bubble. 9 * Encapsulated handling of a search bubble.
10 * @constructor 10 * @constructor
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 switch(event.keyCode) { 538 switch(event.keyCode) {
539 case ESCAPE_KEY_CODE: 539 case ESCAPE_KEY_CODE:
540 if (event.target == this.searchField) { 540 if (event.target == this.searchField) {
541 this.setSearchText_(''); 541 this.setSearchText_('');
542 this.searchField.blur(); 542 this.searchField.blur();
543 event.stopPropagation(); 543 event.stopPropagation();
544 event.preventDefault(); 544 event.preventDefault();
545 } 545 }
546 break; 546 break;
547 case FORWARD_SLASH_KEY_CODE: 547 case FORWARD_SLASH_KEY_CODE:
548 if (!/INPUT|SELECT|BUTTON|TEXTAREA/.test(event.target.tagName)) { 548 if (!/INPUT|SELECT|BUTTON|TEXTAREA/.test(event.target.tagName) &&
549 !event.ctrlKey && !event.altKey) {
549 this.searchField.focus(); 550 this.searchField.focus();
550 event.stopPropagation(); 551 event.stopPropagation();
551 event.preventDefault(); 552 event.preventDefault();
552 } 553 }
553 break; 554 break;
554 } 555 }
555 }, 556 },
556 }; 557 };
557 558
558 /** 559 /**
559 * Standardizes a user-entered text query by removing extra whitespace. 560 * Standardizes a user-entered text query by removing extra whitespace.
560 * @param {string} The user-entered text. 561 * @param {string} The user-entered text.
561 * @return {string} The trimmed query. 562 * @return {string} The trimmed query.
562 */ 563 */
563 SearchPage.canonicalizeQuery = function(text) { 564 SearchPage.canonicalizeQuery = function(text) {
564 // Trim beginning and ending whitespace. 565 // Trim beginning and ending whitespace.
565 return text.replace(/^\s+|\s+$/g, ''); 566 return text.replace(/^\s+|\s+$/g, '');
566 }; 567 };
567 568
568 // Export 569 // Export
569 return { 570 return {
570 SearchPage: SearchPage 571 SearchPage: SearchPage
571 }; 572 };
572 573
573 }); 574 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698