Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Andrew D'Abbraccio
PLUC Inventory - Senior Design
Commits
7ff641ee
Commit
7ff641ee
authored
Mar 04, 2015
by
Alex Moore
Browse files
Commit before library test
parent
15bd8d58
Changes
3
Hide whitespace changes
Inline
Side-by-side
headlessbrower_test1/.DS_Store
View file @
7ff641ee
No preview for this file type
headlessbrower_test1/headlessbrower_test1/Base.lproj/Main.storyboard
View file @
7ff641ee
...
...
@@ -74,7 +74,7 @@
<constraint
firstAttribute=
"height"
constant=
"30"
id=
"7sn-wt-pgi"
/>
</constraints>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"14"
/>
<textInputTraits
key=
"textInputTraits"
/>
<textInputTraits
key=
"textInputTraits"
keyboardType=
"numberPad"
/>
</textField>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"book log"
lineBreakMode=
"tailTruncation"
numberOfLines=
"30"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"kwP-90-kst"
>
<rect
key=
"frame"
x=
"342"
y=
"232"
width=
"242"
height=
"348"
/>
...
...
headlessbrower_test1/headlessbrower_test1/GetScanned.js
View file @
7ff641ee
(
function
()
{
// TODO: Possibly extra to get and be able to display previous 5 scans
// TODO: these previous five are in table
})();
\ 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
!=
"
"
&&
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment