From: Dobrica Pavlinusic Date: Fri, 29 Aug 2014 12:41:01 +0000 (+0200) Subject: color book items according to circulation stataus X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=df7f188b073ae8e6cef33b7cd2bdf5693e24fdef;p=Biblio-RFID.git color book items according to circulation stataus --- diff --git a/examples/selfcheck.js b/examples/selfcheck.js index dba40a6..189bfa5 100644 --- a/examples/selfcheck.js +++ b/examples/selfcheck.js @@ -194,7 +194,11 @@ function circulation( barcode, sid ) { pending_jsonp++; $.getJSON('/sip2/'+circulation_type+'/'+borrower_cardnumber+'/'+barcode+'/'+sid , function( data ) { console.info( circulation_type, data ); - $('ul#books').append('
  • ' + ( data['AJ'] || barcode ) + ( data['AF'] ? ' ' + data['AF'] + '' : '' ) + '
  • '); + + var color = 'red'; + if ( data['fixed'].substr(2,1) == 1 ) color='green'; + + $('ul#books').append('
  • ' + ( data['AJ'] || barcode ) + ( data['AF'] ? ' ' + data['AF'] + '' : '' ) + '
  • '); $('#books_count').html( $('ul#books > li').length ); console.debug( book_barcodes ); pending_jsonp--;