diff options
| -rw-r--r-- | webclient/basic.html | 3 | ||||
| -rw-r--r-- | webclient/lib/basic.js | 10 | ||||
| -rw-r--r-- | webclient/style.css | 40 |
3 files changed, 37 insertions, 16 deletions
diff --git a/webclient/basic.html b/webclient/basic.html index 02990fb..587e5b7 100644 --- a/webclient/basic.html +++ b/webclient/basic.html @@ -2,7 +2,7 @@ <html> <head> <title>Alias</title> - <script src='lib/jquery-1.4.4.min.js'></script> + <script src='lib/jquery-1.4.4.js'></script> <script src='lib/strophe.min.js'></script> <script src='lib/basic.js'></script> <link rel="stylesheet" type="text/css" href="style.css" /> @@ -20,6 +20,7 @@ <hr/> <div id='roster'> <h2>Contacts</h2> + <input type="text" id="rosterfilter" name="test"/> <ul> </ul> </div> diff --git a/webclient/lib/basic.js b/webclient/lib/basic.js index 84e6ff4..f8b24e7 100644 --- a/webclient/lib/basic.js +++ b/webclient/lib/basic.js @@ -1,6 +1,10 @@ var BOSH_SERVICE = 'http://alias.fr.nf/http-bind'; var connection = null; +jQuery.expr[':'].Contains = function(a,i,m){ + return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0; +}; + function log(msg, color) { $('#log').append($('<div></div>').css('background-color', color).text(msg)); @@ -169,4 +173,10 @@ $(document).ready(function(){ $('#bottomup').click(function(){ $(this).next().slideToggle(); }); + + $('#rosterfilter').keyup(function() { + var filter = $(this).val(); + $('#roster ul li div.roster-name:not(:Contains("' + filter + '"))').parent().hide(); + $('#roster ul li div.roster-name:Contains("' + filter + '")').parent().show(); + }); });
\ No newline at end of file diff --git a/webclient/style.css b/webclient/style.css index e568584..d152af7 100644 --- a/webclient/style.css +++ b/webclient/style.css @@ -11,14 +11,6 @@ div padding:0px; } -#roster -{ - float:left; - width:250px; - height:100%; - font-size:0.8em; -} - #bottom { position:fixed; @@ -51,6 +43,31 @@ div border-top:1px solid black; } +#roster +{ + float:left; + width:250px; + height:100%; + font-size:0.8em; + padding:5px; +} + +#rosterfilter +{ + border: 1px solid black; +} + +#rosterfilter:before +{ + content:'x'; +} + +#roster > ul +{ + list-style-type: none; + padding: 0px; +} + .roster-contact { border-bottom : 1px dotted black; @@ -62,18 +79,11 @@ div background-color: #E5E9EE; } - .roster-name { font-weight:bold; } -#roster > ul -{ - list-style-type: none; - padding: 0px; -} - .online { background-color: #DBFFDC; |
