/[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

Diff of /www/rfid.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 52 by dpavlin, Wed Jun 24 10:20:20 2009 UTC revision 66 by dpavlin, Thu Feb 11 14:14:21 2010 UTC
# Line 6  Line 6 
6  .status {  .status {
7          background: #ff8;          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>  </style>
26  <script type="text/javascript">  <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><tt class=' + tag.security + '>' + tag.sid;
35                            if ( tag.content ) {
36                                    html += ' <a href="https://koha-dev.rot13.org:8443/cgi-bin/koha/members/member.pl?member=' + tag.content + '" title="lookup in Koha" target="koha-lookup">' + tag.content + '</a>';
37                                    html += '</tt>';
38                                    html += '<form method=get action=program style="display:inline">'
39                                            + '<input type=hidden name='+tag.sid+' value="blank">'
40                                            + '<input type=submit value="Blank" onclick="return confirm(\'Blank tag '+tag.sid+'\')">'
41                                            + '</form>'
42                                    ;
43                            } else {
44                                    html += '</tt>';
45                                    html += ' <form method=get action=program style="display:inline">'
46                                            + '<!-- <input type=checkbox name=secure value='+tag.sid+' title="secure tag"> -->'
47                                            + '<input type=text name='+tag.sid+' size=12>'
48                                            + '<input type=submit value="Program">'
49                                            + '</form>'
50                                    ;
51                            }
52                    });
53                    html += '</ul>';
54            }
55            html = '<div class=status>'
56                    + textStatus
57                    + '##########'.substr(0,data.time % 10)
58                    + '</div>'
59                    + html
60                    ;
61            $('#tags').html( html );
62            window.setTimeout(function(){
63                    scan_tags();
64            },200); // re-scan every 200ms
65    };
66    
67  function scan_tags() {  function scan_tags() {
68          console.info('scan_tags');          console.info('scan_tags');
69          $.getJSON("http://localhost:9000/scan?callback=?",          if ( $('input#pull-reader').attr('checked') )
70          function(data,textStatus) {                  $.getJSON("http://localhost:9000/scan?callback=?", got_visible_tags);
                 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>' + tag.sid + ' <tt>' + 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  
         });  
71  }  }
72    
73  $(document).ready(function() {  $(document).ready(function() {
74                    $('input#pull-reader').click( function() {
75                            scan_tags();
76                    });
77                    $('input#pull-reader').attr('checked', true); // force check on load
78    
79                    $('div#tags').click( function() {
80                            $('input#pull-reader').attr('checked', false);
81                    } );
82    
83                  scan_tags();                  scan_tags();
84  });  });
85  </script>  </script>
# Line 44  $(document).ready(function() { Line 88  $(document).ready(function() {
88    
89  <h1>RFID tags in range</h1>  <h1>RFID tags in range</h1>
90    
91    <label for=pull-reader>
92    <input id=pull-reader type=checkbox checked=1>
93    active
94    </label>
95    
96  <div id="tags">  <div id="tags">
97  RFID reader not found or driver program not started.  RFID reader not found or driver program not started.
98  </div>  </div>

Legend:
Removed from v.52  
changed lines
  Added in v.66

  ViewVC Help
Powered by ViewVC 1.1.26