2.0_beta sync to rsa
[framework/web/web-ui-fw.git] / tests / unit-tests / searchbar / index.html
1 <!DOCTYPE html>
2 <html>
3         <head>
4                 <script src="../../../build/tizen-web-ui-fw/latest/js/jquery.js"></script>
5                 <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
6                 <script src="../../../build/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.js"
7                         data-framework-theme="tizen-white"
8                         data-framework-viewport-scale=false>
9                 </script>
10                 <link rel="stylesheet" href="../../../libs/js/jquery-mobile-1.1.0/external/qunit.css" />
11                 <script src="../../../libs/js/jquery-mobile-1.1.0/external/qunit.js"></script>
12                 <script src="searchbar-tests.js"></script>
13                 <title>Searchbar</title>
14         </head>
15
16         <body>
17                 <h1 id="qunit-header">Searchbar</h1>
18                 <h2 id="qunit-banner"></h2>
19                 <div id="qunit-testrunner-toolbar"></div>
20                 <h2 id="qunit-userAgent"></h2>
21                 <ol id="qunit-tests"></ol>
22
23                 <div id="qunit-fixture">
24                         <div data-role="page" id="dummy-page">
25                                 <div data-role="header" data-position="fixed">
26                                         <h1>Dummy</h1>
27                                 </div>
28                                 <div data-role="contents">
29                                 </div>
30                         </div>
31                         <div data-role="page" id="searchbar-unit-test" data-add-back-btn="true">
32                                 <div data-role="header" data-position="fixed">
33                                         <h1>Searchbar</h1>
34                                         <input type="search" name="search" id="searchInput" value=""/>
35                                 </div>
36                                 <div data-role="content" id="searchbar-content">
37                                         <p>Hairston</p>
38                                         <p>Hansbrough</p>
39                                         <p>Allred</p>
40                                         <p>Hanrahan</p>
41                                         <p>Egan</p>
42                                         <p>Dare</p>
43                                         <p>Edmonson</p>
44                                         <p>Calip</p>
45                                         <p>Baker</p>
46                                         <p>Fazekas</p>
47                                         <p>Garrity</p>
48                                         <p>Hansen</p>
49                                         <p>Feigenbaum</p>
50                                         <p>Fillmore</p>
51                                         <p>Darden</p>
52                                         <p>Davis</p>
53                                         <p>Fitzgerald</p>
54                                         <p>Carr</p>
55                                         <p>Danilovic</p>
56                                         <p>Dark</p>
57                                         <p>Alexander</p>
58                                         <p>Allen</p>
59                                         <p>Edwards</p>
60                                         <p>Garrett</p>
61                                         <p>Gardner</p>
62                                         <p>Carroll</p>
63                                         <p>Garner</p>
64                                         <p>Finn</p>
65                                         <p>Edelin</p>
66                                         <p>Gay</p>
67                                 </div>
68                         </div>
69                 </div>
70                 <script>
71                         $( "#searchInput" ).live( "input change", function(){
72                                 var regEx = "";
73
74                                 regEx = ".*" + $( "#searchInput" ).val();
75
76                                 $( "#searchbar-content p" ).each( function(){
77                                         if ( $( this ).text().search( new RegExp( regEx ) ) != -1) {
78                                                 $( this ).show();
79                                         }
80                                         else {
81                                                 $( this ).hide();
82                                         }
83                                 });
84                         } );
85                 </script>
86         </body>
87 </html>