Lines 1-33
Link Here
|
1 |
$(document).ready(function() { |
1 |
$(document).ready(function() { |
2 |
|
2 |
|
3 |
function resetResults(){ |
3 |
function resetResults() { |
4 |
$('#checkoutResults').replaceWith('<div id="checkoutResults"></div>'); |
4 |
$('#checkoutResults').replaceWith('<div id="checkoutResults"></div>'); |
5 |
$('#availabilityResult').replaceWith('<div id="availabilityResult"></div>'); |
5 |
$('#availabilityResult').replaceWith('<div id="availabilityResult"></div>'); |
6 |
}; |
6 |
}; |
7 |
|
7 |
|
8 |
function addResult(type, code, data){ |
8 |
function addResult(type, code, data) { |
9 |
let result = ''; |
9 |
let result = ''; |
10 |
if ( type == 'danger' ) { |
10 |
if (type == 'danger') { |
11 |
result += '<div class="alert alert-danger">'; |
11 |
result += '<div class="alert alert-danger">'; |
12 |
} else if ( type == 'warning' ) { |
12 |
} else if (type == 'warning') { |
13 |
result += '<div class="alert alert-warning">'; |
13 |
result += '<div class="alert alert-warning">'; |
14 |
} else if ( type == 'info' ) { |
14 |
} else if (type == 'info') { |
15 |
result += '<div class="alert alert-info">'; |
15 |
result += '<div class="alert alert-info">'; |
16 |
} else { |
16 |
} else { |
17 |
result += '<div class="alert alert-success">'; |
17 |
result += '<div class="alert alert-success">'; |
18 |
} |
18 |
} |
19 |
|
19 |
|
20 |
if ( code == 'NOT_FOUND' ) { |
20 |
if (code == 'NOT_FOUND') { |
21 |
result += _("Item '%s' not found").format(data); |
21 |
result += _("Item '%s' not found").format(data); |
22 |
} |
22 |
} else if (code == 'RENEW_ISSUE') { |
23 |
else if ( code == 'RENEW_ISSUE' ) { |
|
|
24 |
result += _("Item will be renewed").format(data); |
23 |
result += _("Item will be renewed").format(data); |
25 |
} |
24 |
} else if (code == 'OTHER_CHARGES') { |
26 |
else if ( code == 'OTHER_CHARGES' ) { |
25 |
result += _("Your account currently has outstanding charges of '%s'").format(data); |
27 |
result += _("Your account current has outstanding charges of '%s'").format(data); |
26 |
} else if (code == 'ISSUED_TO_ANOTHER') { |
28 |
} |
27 |
result += _("This item appears to be checked out to another patron, please return it to the desk"); |
29 |
else { |
28 |
} else if (code == 'RESERVED') { |
30 |
result += _("Message code '%s' with data '%s'").format(code,data); |
29 |
result += _("This item appears to be reserved for another patron, please return it to the desk"); |
|
|
30 |
} else if (code == 'NOT_FOR_LOAN') { |
31 |
result += _("This item is not normally for loan, please select another or ask at the desk"); |
32 |
} else if (code == 'WTHDRAWN') { |
33 |
result += _("This item is marked withdrawn, please select another or ask at the desk"); |
34 |
} else { |
35 |
result += _("Message code '%s' with data '%s'").format(code, data); |
31 |
} |
36 |
} |
32 |
|
37 |
|
33 |
result += '</div>'; |
38 |
result += '</div>'; |
34 |
- |
|
|