/[RFID]/www/rfid.html
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /www/rfid.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 57 - (show annotations)
Fri Jun 26 11:47:01 2009 UTC (14 years, 10 months ago) by dpavlin
File MIME type: text/html
File size: 1478 byte(s)
added checkbox to turn reader pull on/off

1 <html>
2 <head>
3 <title>3M RFID</title>
4 <script type="text/javascript" src="jquery-1.3.2.min.js"></script>
5 <style type="text/css">
6 .status {
7 background: #ff8;
8 }
9
10 .da {
11 background: #fcc;
12 }
13
14 .d7 {
15 background: #cfc;
16 }
17
18 label[for=pull-reader] {
19 position: absolute;
20 top: 1em;
21 right: 1em;
22 background: #eee;
23 }
24
25 </style>
26 <script type="text/javascript">
27
28 function got_visible_tags(data,textStatus) {
29 var html = 'No tags in range';
30 if ( data.tags ) {
31 html = '<ul class="tags">';
32 $.each(data.tags, function(i,tag) {
33 console.debug( i, tag );
34 html += '<li class=' + tag.security + '><tt>' + tag.sid + ' ' + tag.content + '</tt>';
35 });
36 html += '</ul>';
37 }
38 html = '<div class=status>'
39 + textStatus
40 + '##########'.substr(0,data.time % 10)
41 + '</div>'
42 + html
43 ;
44 $('#tags').html( html );
45 window.setTimeout(function(){
46 scan_tags();
47 },200); // re-scan every 200ms
48 };
49
50 function scan_tags() {
51 console.info('scan_tags');
52 if ( $('input#pull-reader').attr('checked') )
53 $.getJSON("http://localhost:9000/scan?callback=?", got_visible_tags);
54 }
55
56 $(document).ready(function() {
57 $('input#pull-reader').click( function() {
58 scan_tags();
59 });
60 $('input#pull-reader').attr('checked', true); // force check on load
61 scan_tags();
62 });
63 </script>
64 </head>
65 <body>
66
67 <h1>RFID tags in range</h1>
68
69 <label for=pull-reader>
70 <input id=pull-reader type=checkbox checked=1>
71 active
72 </label>
73
74 <div id="tags">
75 RFID reader not found or driver program not started.
76 </div>
77
78 </body>
79 </html>

  ViewVC Help
Powered by ViewVC 1.1.26