Commit 437a508a authored by Jake Mylet's avatar Jake Mylet

Updated javascript files to remove the inline comments, all documentation and...

Updated javascript files to remove the inline comments, all documentation and explanation is present in the markdown files of the docs folder. Also removed unnecessary code that is no longer needed for function and also formatted files.
parent c88b3a67
(function() {
(function () {
var el = document.getElementById("CollectionList1");
var btn = document.getElementById("singleRight");
el.selctedIndex = selectedAdd; // Selected add is the index of selected collection
el.selctedIndex = selectedAdd;
el.value = el.options[selectedAdd].value;
doTransfer1();
})();
\ No newline at end of file
(function() {
(function () {
var el = document.getElementById("CollectionList1");
var opts = el.options;
var str = '{ "options" : [';
for (var i = 0; i < opts.length; i++) {
str += '{"value":"' + opts[i].value + '", '
+ '"text":"' + opts[i].innerHTML.trim() + '"}'
str += '{"value":"' + opts[i].value + '", ' + '"text":"' + opts[i].innerHTML.trim() + '"}';
if (i + 1 != opts.length)
str += ",";
......
(function() {
var scannedDiv = document.getElementById("ScannedListDiv");
var scannedTB = scannedDiv.children[0].children[0];
var allRows = scannedTB.children;
var scannedRows = []; // Array of tr elements
var scannedBooks = '{ "books" : [';
// Go through all rows, except header, to get all scanned rows
for (var i = 1; i < allRows.length; i++) {
if (allRows[i].childElementCount !== 0) { // Ignore empty spacing rows
scannedRows[scannedRows.length] = allRows[i];
}
}
// Go through scanned rows
for (var j = 0; j < scannedRows.length; j++) {
if (scannedRows[j].children.length !== 0) {
// Scanned rows is a tr element with td children
var rowChildren = scannedRows[j].children; // Array of tds
// Go through each td element in a row
for (var k = 0; k < rowChildren.length; k++) { // k is col num
if (rowChildren[k].childElementCount !== 0) { // If the td has children (font)
var bookProp = rowChildren[k].children[0]; // font element
// If the col isn't empty
var a = bookProp.innerHTML;
if (bookProp.innerHTML != "&nbsp;" && bookProp.innerHTML !== "") {
switch(k) {
case 1: // ID Prop
scannedBooks += '{"id":"' + bookProp.innerHTML.trim() + '", ';
break;
case 2: // Call Num
scannedBooks += '"callnum":"' + bookProp.innerHTML.trim() + '", ';
break;
case 3: // Title
scannedBooks += '"title":"' + bookProp.innerHTML.trim() + '"},';
break;
}
}
}
}
}
}
scannedBooks = scannedBooks.substring(0, scannedBooks.length-1);
return scannedBooks + ']}';
})();
\ No newline at end of file
(function () {
var scannedDiv = document.getElementById("ScannedListDiv");
var scannedTB = scannedDiv.children[0].children[0];
var allRows = scannedTB.children;
var scannedRows = []; // Array of tr elements
var scannedBooks = '{ "books" : [';
// Go through all rows, except header, to get all scanned rows
for (var i = 1; i < allRows.length; i++) {
if (allRows[i].childElementCount !== 0) { // Ignore empty spacing rows
scannedRows[scannedRows.length] = allRows[i];
}
}
// Go through scanned rows
for (var j = 0; j < scannedRows.length; j++) {
if (scannedRows[j].children.length !== 0) {
// Scanned rows is a tr element with td children
var rowChildren = scannedRows[j].children; // Array of tds
// Go through each td element in a row
for (var k = 0; k < rowChildren.length; k++) { // k is col num
if (rowChildren[k].childElementCount !== 0) { // If the td has children (font)
var bookProp = rowChildren[k].children[0]; // font element
// If the col isn't empty
var a = bookProp.innerHTML;
if (bookProp.innerHTML != "&nbsp;" && bookProp.innerHTML !== "") {
switch (k) {
case 1: // ID Prop
scannedBooks += '{"id":"' + bookProp.innerHTML.trim() + '", ';
break;
case 2: // Call Num
scannedBooks += '"callnum":"' + bookProp.innerHTML.trim() + '", ';
break;
case 3: // Title
scannedBooks += '"title":"' + bookProp.innerHTML.trim() + '"},';
break;
}
}
}
}
}
}
scannedBooks = scannedBooks.substring(0, scannedBooks.length - 1);
return scannedBooks + ']}';
})();
\ No newline at end of file
(function() {
(function () {
var el = document.getElementById("CollectionList2");
var opts = el.options;
var str = '{ "options" : [';
for (var i = 0; i < opts.length; i++) {
str += '{"value":"' + opts[i].value + '", '
+ '"text":"' + opts[i].innerHTML.trim() + '"}'
str += '{"value":"' + opts[i].value + '", ' + '"text":"' + opts[i].innerHTML.trim() + '"}'
if (i + 1 != opts.length)
str += ",";
......
(function() {
var user = document.getElementById("UserID"); // User ID input
var pword = document.getElementById("Password"); // Password input
var inventory = document.getElementById("InventoryRadioBtn"); // Perform an inventory scann
(function () {
var user = document.getElementById("UserID");
var pword = document.getElementById("Password");
var inventory = document.getElementById("InventoryRadioBtn");
// Set user id and password equal to the respective variable declared prior to function call
user.value = userID;
pword.value = userPassword;
GetLocation(); // With the user and password, the page can retrieve possible library locations
var loc = document.getElementById("LocationSelCtl"); // Get location select and valid values
// Make sure this is the Lewisburg branch
GetLocation();
var loc = document.getElementById("LocationSelCtl");
loc.selectedIndex = 2;
loc.value = loc.options[2].value;
inventory.checked = true; // Perform an inventory
doLogin(); // Login to RTI system
inventory.checked = true;
doLogin();
})();
\ No newline at end of file
(function() {
(function () {
var el = document.getElementById("CollectionList2");
var btn = document.getElementById("singleLeft");
el.selctedIndex = selectedRemove;
el.value = el.options[selectedRemove].value;
doTransfer2();
doTransfer2();
})();
\ No newline at end of file
(function() {
(function () {
var overdue = document.getElementById("IgnoreOverdueFines");
overdue.checked = true;
......
(function() {
(function () {
var url = document.URL;
if (url.search("Login") != -1)
......
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