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

Side by Side Diff: chrome/common/extensions/docs/server2/static/js/sample_search.js

Issue 10809062: Extensions Docs Server: Samples search and icons (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. Use of this
cduvall 2012/07/23 23:01:22 I just rewrote this file because the old one seeme
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';
18 }
19 }
20
21 function setFilter(text) {
22 search_box.value = text;
23 filterSamples();
24 }
25
26 window.filterSamples = filterSamples;
27 window.setFilter = setFilter;
28 })()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698