<commit_before>//
//  LoginBoxTableViewController.swift
//  argent-ios
//
//  Created by <NAME> on 3/21/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import Foundation
import Alamofire
import SwiftyJSON
import WatchConnectivity
import OnePasswordExtension
import Crashlytics

class LoginBoxTableViewController: UITableViewController, UITextFieldDelegate, WCSessionDelegate {

    var window:UIWindow = UIWindow()
    
    @IBOutlet weak var usernameTextField: UITextField!
    
    @IBOutlet weak var passwordTextField: UITextField!

    @IBOutlet weak var onePasswordButton: UITableViewCell!
    
    @IBOutlet var loginTableView: UITableView!
    
    @IBOutlet weak var usernameCell: UITableViewCell!
    
    @IBOutlet weak var passwordCell: UITableViewCell!
    
    private let activityIndicator:UIActivityIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.White)

    override func viewDidLoad() {
        super.viewDidLoad()
        
        configure()
    }
    
    func configure() {
        let screen = UIScreen.mainScreen().bounds
        let _ = screen.size.width
        
        //onePasswordButton
        onePasswordButton.textLabel?.textColor = UIColor.whiteColor()
        onePasswordButton.textLabel?.textAlignment = .Center
        onePasswordButton.textLabel?.font = UIFont.systemFontOfSize(11)
        onePasswordButton.backgroundColor = UIColor.blackColor().colorWithAlphaComponent(0.3)
        // Set up OnePassword
        if OnePasswordExtension.sharedExtension().isAppExtensionAvailable() {
            self.onePasswordButton.textLabel?.text = "Use 1Password"
            let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(self.useOnePassword(_:)))
            self.onePasswordButton.addGestureRecognizer(tap)
        } else {
            self.onePasswordButton.textLabel?.text = "1Password Login"
            let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(self.checkOnePasswordExists(_:)))
            self.onePasswordButton.addGestureRecognizer(tap)
        }
        
        self.usernameTextField.delegate = self
        self.passwordTextField.delegate = self
        
        // usernameTextField.becomeFirstResponder()
        
        usernameTextField.tag = 63631
        let str = NSAttributedString(string: "username or email", attributes: [NSForegroundColorAttributeName:UIColor(rgba: "#fff")])
        usernameTextField.attributedPlaceholder = str
        usernameTextField.textRectForBounds(CGRectMake(0, 0, 0, 0))
        usernameTextField.tintColor = UIColor.whiteColor()
        
        passwordTextField.tag = 63632
        let str2 = NSAttributedString(string: "password", attributes: [NSForegroundColorAttributeName:UIColor(rgba: "#fff")])
        passwordTextField.attributedPlaceholder = str2
        passwordTextField.textRectForBounds(CGRectMake(0, 0, 0, 0))
        passwordTextField.clearsOnBeginEditing = false
        passwordTextField.tintColor = UIColor.whiteColor()
        
        loginTableView.separatorColor = UIColor(rgba: "#ccc3")
        loginTableView.backgroundColor = UIColor(rgba: "#2221")
        
        usernameCell.backgroundColor = UIColor.clearColor()
        usernameCell.textLabel?.textColor = UIColor.whiteColor()
        
        passwordCell.backgroundColor = UIColor.clearColor()
        passwordCell.textLabel?.textColor = UIColor.whiteColor()
        
        // Blurview
        let visualEffectView = UIVisualEffectView(effect: UIBlurEffect(style: .Light))
        visualEffectView.frame = CGRectMake(0, 0, 600, 500)
        self.view.addSubview(visualEffectView)
        self.view.sendSubviewToBack(visualEffectView)
    }
    <commit_msg>fix login ui bug ipad<commit_after>//
//  LoginBoxTableViewController.swift
//  argent-ios
//
//  Created by <NAME> on 3/21/16.
//  Copyright © 2016 <NAME>. All rights reserved.
//

import Foundation
import Alamofire
import SwiftyJSON
import WatchConnectivity
import OnePasswordExtension
import Crashlytics

class LoginBoxTableViewController: UITableViewController, UITextFieldDelegate, WCSessionDelegate {

    var window:UIWindow = UIWindow()
    
    @IBOutlet weak var usernameTextField: UITextField!
    
    @IBOutlet weak var passwordTextField: UITextField!

    @IBOutlet weak var onePasswordButton: UITableViewCell!
    
    @IBOutlet var loginTableView: UITableView!
    
    @IBOutlet weak var usernameCell: UITableViewCell!
    
    @IBOutlet weak var passwordCell: UITableViewCell!
    
    private let activityIndicator:UIActivityIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.White)

    override func viewDidLoad() {
        super.viewDidLoad()
        
        configure()
    }
    
    func configure() {
        let screen = UIScreen.mainScreen().bounds
        let _ = screen.size.width
        
        //onePasswordButton
        onePasswordButton.textLabel?.textColor = UIColor.whiteColor()
        onePasswordButton.textLabel?.textAlignment = .Center
        onePasswordButton.textLabel?.font = UIFont.systemFontOfSize(11)
        onePasswordButton.backgroundColor = UIColor.blackColor().colorWithAlphaComponent(0.3)
        // Set up OnePassword
        if OnePasswordExtension.sharedExtension().isAppExtensionAvailable() {
            self.onePasswordButton.textLabel?.text = "Use 1Password"
            let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(self.useOnePassword(_:)))
            self.onePasswordButton.addGestureRecognizer(tap)
        } else {
            self.onePasswordButton.textLabel?.text = "1Password Login"
            let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(self.checkOnePasswordExists(_:)))
            self.onePasswordButton.addGestureRecognizer(tap)
        }
        
        self.usernameTextField.delegate = self
        self.passwordTextField.delegate = self
        
        // usernameTextField.becomeFirstResponder()
        
        usernameTextField.tag = 63631
        let str = NSAttributedString(string: "username or email", attributes: [NSForegroundColorAttributeName:UIColor(rgba: "#fff")])
        usernameTextField.attributedPlaceholder = str
        usernameTextField.textRectForBounds(CGRectMake(0, 0, 0, 0))
        usernameTextField.tintColor = UIColor.whiteColor()
        
        passwordTextField.tag = 63632
        let str2 = NSAttributedString(string: "password", attributes: [NSForegroundColorAttributeName:UIColor(rgba: "#fff")])
        passwordTextField.attributedPlaceholder = str2
        passwordTextField.textRectForBounds(CGRectMake(0, 0, 0, 0))
        passwordTextField.clearsOnBeginEditing = false
        passwordTextField.tintColor = UIColor.whiteColor()
        
        loginTableView.separatorColor = UIColor(rgba: "#ccc3")
        loginTableView.backgroundColor = UIColor(rgba: "#2221")
        
        usernameCell.backgroundColor = UIColor.clearColor()
        usernameCell.textLabel?.textColor = UIColor.whiteColor()
        
        passwordCell.backgroundColor = UIColor.clearColor()
        passwordCell.textLabel?.textColor = UIColor.whiteColor()
        
        // Blurview
        let visualEffectView = UIVisualEffectView(effect: UIBlurEffect(style: .Light))
        visualEffectView.frame = CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height)
        self.view.addSubview(visualEffectView)
        self.view.sendSubviewToBack(visualEffectView)
    }
    
{'fraction_non_alphanumeric': 0.08549256872287254, 'fraction_numerical': 0.011837432592397737, 'mean_word_length': 3.2174154187465334, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4811172', 'n_tokens_mistral': 2182, 'n_tokens_neox': 2075, 'n_words': 380}