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 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 downloads.updated(results[i]); | 580 downloads.updated(results[i]); |
581 // Do as much as we can in 50ms. | 581 // Do as much as we can in 50ms. |
582 if (Date.now() - start > 50) { | 582 if (Date.now() - start > 50) { |
583 clearTimeout(resultsTimeout); | 583 clearTimeout(resultsTimeout); |
584 resultsTimeout = setTimeout(downloadUpdated, 5, results.slice(i + 1)); | 584 resultsTimeout = setTimeout(downloadUpdated, 5, results.slice(i + 1)); |
585 break; | 585 break; |
586 } | 586 } |
587 } | 587 } |
588 } | 588 } |
589 | 589 |
| 590 // Add handlers to HTML elements. |
| 591 document.body.onload = load; |
| 592 $('clear-all').onclick = function () { clearAll(''); }; |
| 593 $('search-link').onclick = function () { |
| 594 setSearch(''); |
| 595 return false; |
| 596 }; |
| 597 $('search-form').onsubmit = function () { |
| 598 setSearch(this.term.value); |
| 599 return false; |
| 600 }; |
| 601 |
OLD | NEW |