Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. Use of this | |
| 2 // source code is governed by a BSD-style license that can be found in the | |
| 3 // LICENSE file. | |
| 4 | |
| 5 (function() { | |
| 6 var search_box = document.getElementById('search_input'); | |
| 7 var apis = document.getElementsByClassName('sample'); | |
| 8 for (var i = 0; i < apis.length; ++i) | |
| 9 apis[i].tags = apis[i].getAttribute('tags').toUpperCase(); | |
| 10 | |
| 11 function filterSamples() { | |
| 12 var search_text = search_box.value.toUpperCase(); | |
| 13 for (var i = 0; i < apis.length; ++i) { | |
| 14 if (apis[i].tags.indexOf(search_text) < 0) | |
| 15 apis[i].style.display = 'none'; | |
| 16 else | |
| 17 apis[i].style.display = 'block'; | |
|
not at google - send to devlin
2012/07/24 01:09:55
This assumes that it was block. It might not be? S
cduvall
2012/07/24 20:14:47
Done.
| |
| 18 } | |
| 19 } | |
| 20 | |
| 21 function setFilter(text) { | |
| 22 search_box.value = text; | |
| 23 filterSamples(); | |
| 24 } | |
| 25 | |
| 26 window.filterSamples = filterSamples; | |
| 27 window.setFilter = setFilter; | |
|
not at google - send to devlin
2012/07/24 01:09:55
see comment in the template. Use search_box.addEve
cduvall
2012/07/24 20:14:47
Done.
| |
| 28 })() | |
| OLD | NEW |