/[meteor]/trunk/public_html/koha.js
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 /trunk/public_html/koha.js

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

revision 75 by dpavlin, Sat Mar 28 15:49:36 2009 UTC revision 76 by dpavlin, Sat Mar 28 17:53:26 2009 UTC
# Line 6  function process(data) { Line 6  function process(data) {
6          var a = data.split('|');          var a = data.split('|');
7          console.info('process', a);          console.info('process', a);
8          $('#test').html( a[1] );          $('#test').html( a[1] );
         if ( a[0] > 0 && ! rfid_selected[ a[0] ] ) {  
                 $('#koha').append( '<div class="item" id="' + a[0] + '">Loading item '+a[0]+' from Koha</div>' )  
                 $.get( '/koha/' + a[0], function(data) {  
                         $('#'+a[0]).html( data );  
9    
10                          rfid_selected[ a[0] ]++;          var id = a[0];
11                          var e = $('#clear_selection');  
12                          e.attr( 'value', parseInt( e.attr('value') ) + 1 );          console.debug( id, rfid_selected[id] === undefined );
13                          console.info('loaded item', a[0], data, 'selected', e.attr('value'));  
14            if ( id > 0 && rfid_selected[ id ] === undefined ) {
15                    if ( $('#'+id).length > 0 ) {
16                            console.error('element', id, 'allready exists');
17                    } else {
18                            $('#koha').append( '<div class="item" id="'+id+'">Loading item '+id+' from Koha</div>' )
19                            console.debug('created element', id);
20                    }
21                    $.get( '/koha/' + id, function(data) {
22                            $('#'+id).html( data );
23    
24                            if ( rfid_selected[id] === undefined ) {
25                                    var e = $('#clear_selection');
26                                    e.attr( 'value', parseInt( e.attr('value') ) + 1 );
27                                    console.info('loaded item:', id, ' times:', rfid_selected[ id ], 'total selected:', e.attr('value'));
28                            }
29    
30                            rfid_selected[ id ] = data;
31                  });                  });
32          } else if ( a[0] < 0 ) {          } else if ( id < 0 ) {
33                  console.info("No RFID chips in range");                  console.info("No RFID chips in range");
34          }          }
35  };  };

Legend:
Removed from v.75  
changed lines
  Added in v.76

  ViewVC Help
Powered by ViewVC 1.1.26