script type text javascript window addEvent domready function input na

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<script type='text/javascript'>
window.addEvent('domready', function() {
$$("input[name=filter]").addEvent('keyup', function(event) {
var value = this.get("value");
var jsonRequest = new Request.JSON({
url: "/filter_users/",
method: 'get',
data: {q: value},
onComplete: function(json){
$('users_block_wrapper').empty();
json.users.each(function(item){
$("users_block_wrapper").set("html", "
<div class='users_block'>
<div class='user_block_top_wrapper'>
<div class='left avatar'>
<img src='/static/theme/img/small_noavatar.png' alt='image' style='border: 5px solid #ebebe3;' />
</div>
<div class='left info'>
<p><a class='bold' href=''>Test</a></p>
<p class='tip f70'>Last visit: today</p>
</div>
</div>
<div class='user_block_middle_wrapper'>
<div class='left rating'>
<span class='bold'>15</span>
</div>
<div class='left number'>
<p class='f90'>number of codes: <span class='bold'>15</span></p>
</div>
</div>
<p class='latest_title' class='bold f90'>Latest Dump: </p>
<p class='latest'>
<a href='#'>User have no dumps yet</a>
</p>
</div>
" );
});
}
}).send();
});
})