|
@@ -7,6 +7,8 @@ |
7 |
7 |
|
// |
8 |
8 |
|
|
9 |
9 |
|
#import "SignInVC.h" |
|
10 |
+ |
#import "StringHelper.h" |
|
11 |
+ |
#import "GenericWebViewVC.h" |
10 |
12 |
|
#import "UITextField+BSErrorMessageView.h" |
11 |
13 |
|
|
12 |
14 |
|
@interface SignInVC ()<UIGestureRecognizerDelegate,UITextFieldDelegate> { |
|
@@ -24,6 +26,7 @@ |
24 |
26 |
|
@property (nonatomic, weak) IBOutlet UITextField *nameField; |
25 |
27 |
|
@property (nonatomic, weak) IBOutlet UILabel *sexLabel; |
26 |
28 |
|
@property (nonatomic, weak) IBOutlet UILabel *termsLabel; |
|
29 |
+ |
@property (nonatomic, weak) IBOutlet UITextView *termsLabelText; |
27 |
30 |
|
@property (nonatomic, weak) IBOutlet UISegmentedControl *sexField; |
28 |
31 |
|
@property (nonatomic, weak) IBOutlet UIButton *termsBtn; |
29 |
32 |
|
@property (nonatomic, weak) IBOutlet UIButton *signInBtn; |
|
@@ -58,7 +61,10 @@ |
58 |
61 |
|
self.sexLabel.text = NSLocalizedString(@"Sex", nil); |
59 |
62 |
|
[self.sexField setTitle:NSLocalizedString(@"Male", nil) forSegmentAtIndex:0]; |
60 |
63 |
|
[self.sexField setTitle:NSLocalizedString(@"Female", nil) forSegmentAtIndex:1]; |
61 |
|
- |
self.termsLabel.text = NSLocalizedString(@"Terms", nil); |
|
64 |
+ |
// self.termsLabel.text = NSLocalizedString(@"Terms", nil); |
|
65 |
+ |
|
|
66 |
+ |
// self.termsLabelText.attributedText = [StringHelper getLinkInString:NSLocalizedString(@"Terms", nil) urlToUse:[@[@"http://dx.doi.org/10.1037/a0033697"]mutableCopy] toLink:[@[NSLocalizedString(@"Terms", nil)]mutableCopy]]; |
|
67 |
+ |
self.termsLabelText.attributedText = [StringHelper getBoldUnderlinedAttributedLongStringInString:NSLocalizedString(@"Terms", nil) toBold:[@[@""]mutableCopy] toUnderline:[@[NSLocalizedString(@"Terms", nil)]mutableCopy]]; |
62 |
68 |
|
|
63 |
69 |
|
[self.emailField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged]; |
64 |
70 |
|
[self.passwordField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged]; |
|
@@ -173,6 +179,11 @@ |
173 |
179 |
|
|
174 |
180 |
|
#pragma mark - UIAlert clickedButton |
175 |
181 |
|
|
|
182 |
+ |
- (void)customIOS7dialogButtonTouchUpInside: (CustomIOSAlertView *)alertView clickedButtonAtIndex: (NSInteger)buttonIndex { |
|
183 |
+ |
[alertView close]; |
|
184 |
+ |
} |
|
185 |
+ |
|
|
186 |
+ |
|
176 |
187 |
|
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { |
177 |
188 |
|
|
178 |
189 |
|
if(alertView.tag == 001) { |
|
@@ -212,6 +223,17 @@ |
212 |
223 |
|
[self buttonEnabler]; |
213 |
224 |
|
} |
214 |
225 |
|
|
|
226 |
+ |
- (IBAction) doOpenTerms { |
|
227 |
+ |
GenericWebViewVC *genericWebViewVC = [[GenericWebViewVC alloc] init]; |
|
228 |
+ |
genericWebViewVC.title = NSLocalizedString(@"Terms_title", nil); |
|
229 |
+ |
|
|
230 |
+ |
NSString *urlToCall = TERMS_SAFARI([DATAMANAGER defineLanguageWeb]); |
|
231 |
+ |
genericWebViewVC.urlToCall = urlToCall; |
|
232 |
+ |
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil]; |
|
233 |
+ |
[self.navigationController pushViewController:genericWebViewVC animated:YES]; |
|
234 |
+ |
|
|
235 |
+ |
} |
|
236 |
+ |
|
215 |
237 |
|
- (IBAction)doSignIn { |
216 |
238 |
|
|
217 |
239 |
|
[self.emailField bs_hideError]; |
|
@@ -293,6 +315,8 @@ |
293 |
315 |
|
} |
294 |
316 |
|
else { |
295 |
317 |
|
|
|
318 |
+ |
[DATAMANAGER showErrorAlert:self message:response[@"error_message"] tag:[response[@"error_code"] integerValue]]; |
|
319 |
+ |
|
296 |
320 |
|
} |
297 |
321 |
|
|
298 |
322 |
|
} failure:^(NSError *error) { |