function got_visible_tags(data,textStatus) {
var html = 'No tags in range';
if ( data.tags ) {
- scan_tags_active = false;
html = '<ul class="tags">';
$.each(data.tags, function(i,tag) {
console.debug( i, tag );
html += '<li><tt class="' + tag.security + '">' + tag.sid;
- var content = tag.content
- if (typeof content === undefined && typeof tag.borrower !== undefined)
- content = tag.borrower.cardnumber;
-
- var is_book = false;
- var is_borrower = false;
+ var content = tag.content || tag.borrower.cardnumber;
if ( content ) {
var link;
if ( content.length = 10 && content.substr(0,3) == 130 ) { // book
- is_book = true;
link = 'catalogue/search.pl?q=';
} else if ( content.length == 12 && content.substr(0,2) == 20 ) {
- is_borrower = true;
link = 'members/member.pl?member=';
} else {
html += '<b>UNKNOWN TAG</b> '+content;
});
html += '</ul>';
- scan_tags_active = true;
}
var arrows = Array( 8592, 8598, 8593, 8599, 8594, 8600, 8595, 8601 );
+ '</div>'
+ html
;
- $('#tags').html( html );
+ $('#tags').html( html ); // FIXME leaks memory?
pending_jsonp--;
};