Commit 48044e9d authored by Jake Mylet's avatar Jake Mylet

Update ScanJS to move from Desktop to Laptop

parent 71c754e2
......@@ -2,7 +2,10 @@
The JS functions specified below are run only on the Scan Page.
### [GetScanned.js](/WAMI/WAMI/GetScanned.js)
Used to retrieve all information of past scans on the scan page. This will only return scanned items contained in the table on the page, as it will ignore empty rows. It does this by iterate through all rows in scan table, ignoring the first header rows and empty spacing rows, to save all others in an array.
Scanned book information is stored in a table on the scan page. Each row of the table corresponds to a single scan record. In each row the information desired (in the order of ID number, call number, and title) is stored in column elements. This file is used to retrieve the information mentioned by crawling through the table and inspecting each element encountered.
GetSanned.js will only return scanned items contained in the table on the page, as it will ignore empty rows and columns. It does this by iterate through all rows in scan table, ignoring the first header rows and empty spacing rows, saving only the rows containing scan records.
```javascript
for (var i = 1; i < allRows.length; i++) {
if (allRows[i].childElementCount !== 0) {
......@@ -10,9 +13,13 @@ for (var i = 1; i < allRows.length; i++) {
}
}
```
Header rows are ignored by starting at the 2nd row, index 1, rather than the first, index 0. Empy rows are ignored by checking if the row has any child elements.
After retrieving all scan rows, iterate through each of these rows and each column in the row
After retrieving all scan rows, the script will iterate through each of these rows and then go through each column in a row looking for the information desired.
```javascript
```
### [ScanBarcode.js](/WAMI/WAMI/ScanBarcode.js)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment