17 |
</style> |
</style> |
18 |
<script type="text/javascript"> |
<script type="text/javascript"> |
19 |
|
|
20 |
|
function got_visible_tags(data,textStatus) { |
21 |
|
var html = 'No tags in range'; |
22 |
|
if ( data.tags ) { |
23 |
|
html = '<ul class="tags">'; |
24 |
|
$.each(data.tags, function(i,tag) { |
25 |
|
console.debug( i, tag ); |
26 |
|
html += '<li class=' + tag.security + '><tt>' + tag.sid + ' ' + tag.content + '</tt>'; |
27 |
|
}); |
28 |
|
html += '</ul>'; |
29 |
|
} |
30 |
|
html = '<div class=status>' |
31 |
|
+ textStatus |
32 |
|
+ '##########'.substr(0,data.time % 10) |
33 |
|
+ '</div>' |
34 |
|
+ html |
35 |
|
; |
36 |
|
$('#tags').html( html ); |
37 |
|
window.setTimeout(function(){ |
38 |
|
scan_tags(); |
39 |
|
},200); // re-scan every 200ms |
40 |
|
}; |
41 |
|
|
42 |
function scan_tags() { |
function scan_tags() { |
43 |
console.info('scan_tags'); |
console.info('scan_tags'); |
44 |
$.getJSON("http://localhost:9000/scan?callback=?", |
$.getJSON("http://localhost:9000/scan?callback=?", got_visible_tags); |
|
function(data,textStatus) { |
|
|
var html = 'No tags in range'; |
|
|
if ( data.tags ) { |
|
|
html = '<ul class="tags">'; |
|
|
$.each(data.tags, function(i,tag) { |
|
|
console.debug( i, tag ); |
|
|
html += '<li class=' + tag.security + '><tt>' + tag.sid + ' ' + tag.content + '</tt>'; |
|
|
}); |
|
|
html += '</ul>'; |
|
|
} |
|
|
html = '<div class=status>' |
|
|
+ textStatus |
|
|
+ '##########'.substr(0,data.time % 10) |
|
|
+ '</div>' |
|
|
+ html |
|
|
; |
|
|
$('#tags').html( html ); |
|
|
window.setTimeout(function(){ |
|
|
scan_tags(); |
|
|
},200); // re-scan every 200ms |
|
|
}); |
|
45 |
} |
} |
46 |
|
|
47 |
$(document).ready(function() { |
$(document).ready(function() { |