Directions: Paste barcodes (one barcode per line) into the input box below,
and press the button, “Process barcodes” to get the item record
numbers, and the bib record numbers for use in Create Lists.
Sample barcode list here
See Sierra documentation here:
http://techdocs.iii.com/sierrahelp/Default.htm#sgil/sgil_lists_new_review_file.html#import
//this is used for debugging var json_return_data;
function getInputData() {
//hide the process_button, and show the spinner document.getElementsByClassName('process_button')[0].style.visibility = 'hidden'; document.getElementsByClassName('spinner')[0].style.visibility = 'visible';
//get the data from our textarea input and split it on new lines var input = document.getElementById('input').value.split(/\n/);
var request = new XMLHttpRequest();
request.open("POST", "http://library2.udayton.edu/api/barcode/translate_barcodes.php", true); request.setRequestHeader("Content-type", "application/json") request.send( JSON.stringify(input) );
//set up the function to fill our output when we get a response back request.onreadystatechange = function() { if (request.readyState == 4 && request.status == 200) { var json_string_output = request.responseText;
// create our json data variable with our output json_data = JSON.parse(json_string_output);
//call the function to fill the outputs fill_outputs(json_string_output);
//show the process_button, and hide the spinner document.getElementsByClassName('process_button')[0].style.visibility = 'visible'; document.getElementsByClassName('spinner')[0].style.visibility = 'hidden'; } }; //end onreadystatechange }; //end function
function fill_outputs(json_string) { //create our json data variable var json_return_data = JSON.parse(json_string);
var item_rec_num_output = document.getElementById('item_rec_num_output'); var bib_rec_num_output = document.getElementById('bib_rec_num_output'); var bad_barcodes_output = document.getElementById('bad_barcodes_output');
//clear the output areas just in case we're running this twice item_rec_num_output.value = ''; bib_rec_num_output.value = ''; bad_barcodes_output.value = '';
for(var i=0; i