Commit 10ce7b38 authored by Drewdabb's avatar Drewdabb
Browse files

saturdaylibrary testing m9

parent b1b13488
No preview for this file type
...@@ -217,6 +217,7 @@ ...@@ -217,6 +217,7 @@
<textInputTraits key="textInputTraits"/> <textInputTraits key="textInputTraits"/>
<connections> <connections>
<action selector="txtChange:" destination="chc-VY-Gqa" eventType="editingChanged" id="8Fd-OM-q60"/> <action selector="txtChange:" destination="chc-VY-Gqa" eventType="editingChanged" id="8Fd-OM-q60"/>
<action selector="txtChange:" destination="chc-VY-Gqa" eventType="valueChanged" id="rNI-lq-ipd"/>
</connections> </connections>
</textField> </textField>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" allowsSelectionDuringEditing="YES" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="HXe-Ct-PRX"> <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" allowsSelectionDuringEditing="YES" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="HXe-Ct-PRX">
......
...@@ -228,8 +228,8 @@ static int BOOK_ID_LENGTH = 14; ...@@ -228,8 +228,8 @@ static int BOOK_ID_LENGTH = 14;
}); });
}); });
} }
//31172001492867
- (IBAction)txtChange:(id)sender { - (void) barcodeTextChanged {
NSCharacterSet* notDigits = [[NSCharacterSet decimalDigitCharacterSet] invertedSet]; NSCharacterSet* notDigits = [[NSCharacterSet decimalDigitCharacterSet] invertedSet];
if(self.txtBookID.text.length == BOOK_ID_LENGTH) { //string is proper length if(self.txtBookID.text.length == BOOK_ID_LENGTH) { //string is proper length
if([self.txtBookID.text rangeOfCharacterFromSet:notDigits].location == NSNotFound) { //string is numeric if([self.txtBookID.text rangeOfCharacterFromSet:notDigits].location == NSNotFound) { //string is numeric
...@@ -249,16 +249,16 @@ static int BOOK_ID_LENGTH = 14; ...@@ -249,16 +249,16 @@ static int BOOK_ID_LENGTH = 14;
[self.webview stringByEvaluatingJavaScriptFromString:inputCode]; [self.webview stringByEvaluatingJavaScriptFromString:inputCode];
[self.webview stringByEvaluatingJavaScriptFromString:scan]; [self.webview stringByEvaluatingJavaScriptFromString:scan];
// //randomly generate errors // //randomly generate errors
// int random = arc4random() % 10; // int random = arc4random() % 10;
// if(random < 5) { // if(random < 5) {
// //green check // //green check
// [self changeCheckImage]; // [self changeCheckImage];
// //
// } else { // } else {
// //red x // //red x
// [self changeXImage]; // [self changeXImage];
// } // }
NSLog(@"ID accepted"); NSLog(@"ID accepted");
self.view.backgroundColor = [UIColor greenColor]; self.view.backgroundColor = [UIColor greenColor];
[UIView animateWithDuration:1.0 animations:^{ [UIView animateWithDuration:1.0 animations:^{
...@@ -282,7 +282,7 @@ static int BOOK_ID_LENGTH = 14; ...@@ -282,7 +282,7 @@ static int BOOK_ID_LENGTH = 14;
// delegate:self // delegate:self
// cancelButtonTitle:@"OK" // cancelButtonTitle:@"OK"
// otherButtonTitles:nil]; // otherButtonTitles:nil];
// //
// [previousScan show]; // [previousScan show];
[self extractInformation:scanned]; [self extractInformation:scanned];
} else { } else {
...@@ -296,6 +296,16 @@ static int BOOK_ID_LENGTH = 14; ...@@ -296,6 +296,16 @@ static int BOOK_ID_LENGTH = 14;
} }
} }
//31172001492867
- (IBAction)txtChange:(id)sender {
[self barcodeTextChanged];
}
- (void)decoderDataReceived:(NSString *)data {
[super decoderDataReceived:data];
[self barcodeTextChanged];
}
- (IBAction)clickedFinish:(id)sender { - (IBAction)clickedFinish:(id)sender {
NSString *path = NSString *path =
[[NSBundle mainBundle] pathForResource:@"WhatPage" ofType:@"js"]; [[NSBundle mainBundle] pathForResource:@"WhatPage" ofType:@"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