<commit_before>/**
 * Created by ksinger on 01.09.2017.
 */
;
import angular from 'angular';
import {
    attach,
    delay,
    dispatchEvent,
} from '../utils.js';
import { actionCreators }  from '../actions/actions.js';
import {
    connect2Redux,
} from '../won-utils.js';

import * as srefUtils from '../sref-utils.js';

function genLoginConf() {
    let template = `
        <form ng-submit="::self.login({email: self.email, password: <PASSWORD>, rememberMe: self.rememberMe}, {redirectToFeed: false})"
            id="loginForm"
            class="loginForm"
        >
            <input
                id="loginEmail"
                placeholder="Email address"
                ng-model="self.email"
                type="email"
                required
                autofocus
                ng-keyup="self.formKeyUp($event)"/>
            <span class="wl__errormsg">
                {{self.loginError}}
            </span>
            <input
                id="loginPassword"
                placeholder="Password"
                ng-model="self.password"
                type="password"
                required
                ng-keyup="self.formKeyUp($event)"/>

            <!-- <input type="submit" value="LOGIN"/>-->
            <button
                class="won-button--filled lighterblue"
                ng-disabled="loginForm.$invalid">
                <!--ng-click="::self.login(self.email, self.password)">-->
                    Sign In
            </button>
            <input
                id="remember-me"
                ng-model="self.rememberMe"
                type="checkbox"/> Remember me
        </form>
        <div class="wl__register">
            No account yet?
            <a href="{{ self.absHRef(self.$state, 'signup') }}">
                Sign up
            </a>
        </div>`;

    const serviceDependencies = ['$ngRedux', '$scope', '$element', '$state' /*'$routeParams' /*injections as strings here*/];

    class Controller {
        constructor(/* arguments <- serviceDependencies */){
            attach(this, serviceDependencies, arguments);
            Object.assign(this, srefUtils); // bind srefUtils to scope

            window.lic4dbg = this;

            this.email = "";
            this.password = "";
            this.rememberMe = false;

            const login = (state) => ({
                loginVisible: state.get('loginVisible'),
                loggedIn: state.getIn(['user','loggedIn']),
                loginError: state.getIn(['user','loginError'])
            });

            connect2Redux(login, actionCreators, [], this);
        }

        formKeyUp(event) {
            this.typedAtLoginCredentials();
            if(event.keyCode == 13) {
                this.login({
                    email: this.email,
                    password: <PASSWORD>,
                    rememberMe: this.rememberMe,
                }, {
                    redirectToFeed: false
                });
            }
        }
    }<commit_msg>remove unused state var loginVisible from stateselection added hideMainMenuDisplay on about click<commit_after>/**
 * Created by ksinger on 01.09.2017.
 */
;
import angular from 'angular';
import {
    attach,
    delay,
    dispatchEvent,
} from '../utils.js';
import { actionCreators }  from '../actions/actions.js';
import {
    connect2Redux,
} from '../won-utils.js';

import * as srefUtils from '../sref-utils.js';

function genLoginConf() {
    let template = `
        <form ng-submit="::self.login({email: self.email, password: <PASSWORD>, rememberMe: self.rememberMe}, {redirectToFeed: false})"
            id="loginForm"
            class="loginForm"
        >
            <input
                id="loginEmail"
                placeholder="Email address"
                ng-model="self.email"
                type="email"
                required
                autofocus
                ng-keyup="self.formKeyUp($event)"/>
            <span class="wl__errormsg">
                {{self.loginError}}
            </span>
            <input
                id="loginPassword"
                placeholder="Password"
                ng-model="self.password"
                type="password"
                required
                ng-keyup="self.formKeyUp($event)"/>

            <!-- <input type="submit" value="LOGIN"/>-->
            <button
                class="won-button--filled lighterblue"
                ng-disabled="loginForm.$invalid">
                    Sign In
            </button>
            <input
                id="remember-me"
                ng-model="self.rememberMe"
                type="checkbox"/> Remember me
        </form>
        <div class="wl__register">
            No account yet?
            <a href="{{ self.absHRef(self.$state, 'signup') }}" ng-click="self.hideMainMenuDisplay()">
                Sign up
            </a>
        </div>`;

    const serviceDependencies = ['$ngRedux', '$scope', '$element', '$state' /*'$routeParams' /*injections as strings here*/];

    class Controller {
        constructor(/* arguments <- serviceDependencies */){
            attach(this, serviceDependencies, arguments);
            Object.assign(this, srefUtils); // bind srefUtils to scope

            window.lic4dbg = this;

            this.email = "";
            this.password = "";
            this.rememberMe = false;

            const login = (state) => ({
                loggedIn: state.getIn(['user','loggedIn']),
                loginError: state.getIn(['user','loginError'])
            });

            connect2Redux(login, actionCreators, [], this);
        }

        formKeyUp(event) {
            this.typedAtLoginCredentials();
            if(event.keyCode == 13) {
                this.login({
                    email: this.email,
                    password: <PASSWORD>,
                    rememberMe: this.rememberMe,
                }, {
                    redirectToFeed: false
                });
            }
        }
    }
{'fraction_non_alphanumeric': 0.13353313353313354, 'fraction_numerical': 0.004329004329004329, 'mean_word_length': 1.469983552631579, 'pattern_counts': {'":': 3, '<': 40, '<?xml version=': 0, '>': 41, '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': '5013982', 'n_tokens_mistral': 1619, 'n_tokens_neox': 1505, 'n_words': 312}