| OLD | NEW |
| 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 /////////////////////////////////////////////////////////////////////////////// | 5 /////////////////////////////////////////////////////////////////////////////// |
| 6 // Helper functions | 6 // Helper functions |
| 7 function $(o) {return document.getElementById(o);} | 7 function $(o) {return document.getElementById(o);} |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Sets the display style of a node. | 10 * Sets the display style of a node. |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 } | 529 } |
| 530 | 530 |
| 531 /////////////////////////////////////////////////////////////////////////////// | 531 /////////////////////////////////////////////////////////////////////////////// |
| 532 // Page: | 532 // Page: |
| 533 var downloads, localStrings, resultsTimeout; | 533 var downloads, localStrings, resultsTimeout; |
| 534 | 534 |
| 535 function load() { | 535 function load() { |
| 536 localStrings = new LocalStrings(); | 536 localStrings = new LocalStrings(); |
| 537 downloads = new Downloads(); | 537 downloads = new Downloads(); |
| 538 $('term').focus(); | 538 $('term').focus(); |
| 539 $('term').setAttribute('aria-labelledby', 'search-submit'); |
| 539 setSearch(''); | 540 setSearch(''); |
| 540 } | 541 } |
| 541 | 542 |
| 542 function setSearch(searchText) { | 543 function setSearch(searchText) { |
| 543 downloads.clear(); | 544 downloads.clear(); |
| 544 downloads.setSearchText(searchText); | 545 downloads.setSearchText(searchText); |
| 545 chrome.send('getDownloads', [searchText.toString()]); | 546 chrome.send('getDownloads', [searchText.toString()]); |
| 546 } | 547 } |
| 547 | 548 |
| 548 function clearAll() { | 549 function clearAll() { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 $('clear-all').onclick = function () { clearAll(''); }; | 593 $('clear-all').onclick = function () { clearAll(''); }; |
| 593 $('search-link').onclick = function () { | 594 $('search-link').onclick = function () { |
| 594 setSearch(''); | 595 setSearch(''); |
| 595 return false; | 596 return false; |
| 596 }; | 597 }; |
| 597 $('search-form').onsubmit = function () { | 598 $('search-form').onsubmit = function () { |
| 598 setSearch(this.term.value); | 599 setSearch(this.term.value); |
| 599 return false; | 600 return false; |
| 600 }; | 601 }; |
| 601 | 602 |
| OLD | NEW |