<commit_before>/// <reference path="../../../../argos-sdk/libraries/ext/ext-core-debug.js"/>
/// <reference path="../../../../argos-sdk/libraries/sdata/sdata-client-debug"/>
/// <reference path="../../../../argos-sdk/libraries/Simplate.js"/>
/// <reference path="../../../../argos-sdk/src/View.js"/>
/// <reference path="../../../../argos-sdk/src/Edit.js"/>

Ext.namespace("Mobile.SalesLogix.Login");

Mobile.SalesLogix.Login = Ext.extend(Sage.Platform.Mobile.Edit, {
    //Templates
    viewTemplate: new Simplate([
        '<div id="{%= $.id %}" title="{%: $.titleText %}" class="panel {%= $.cls %}" hideBackButton="true">',        
        '<div class="panel-content"></div>',
        '<button class="button actionButton" data-action="authenticate"><span>{%: $.logOnText %}</span></button>',
        '<span class="copyright">{%= $.copyrightText %}</span>',
        '</div>'
    ]),

    //Localization
    id: 'login',
    busy: false,
    copyrightText: '&copy; 2011 Sage Software, Inc. All rights reserved.',
    logOnText: 'Log On',
    passText: 'password',
    rememberText: 'remember',
    titleText: 'Sage SalesLogix',
    userText: 'user name',
    invalidUserText: 'The user name or password is invalid.',
    missingUserText: 'The user record was not found.',
    serverProblemText: 'A problem occured on the server.',
    requestAbortedText: 'The request was aborted.',

    init: function() {
        Mobile.SalesLogix.Login.superclass.init.apply(this, arguments);

        this.tools = {
            bbar: false,
            tbar: false
        };
    },
    getContext: function() {
        return {id: this.id};
    },
    createLayout: function() {
        return this.layout || (this.layout = [
            {
                name: 'username',
                label: this.userText,
                type: 'text'
            },
            {
                name: 'password',
                label: this.passText,
                type: 'mask'
            },
            {
                name: 'remember',
                label: this.rememberText,
                type: 'boolean'
            }
        ]);
    },
    authenticate: function () {        
        if (this.busy) return;

        var credentials = this.getValues(),
            username = credentials && credentials.username;

        if (username && /\w+/.test(username))
            this.validateCredentials(credentials);<commit_msg>minor fix to use new password control<commit_after>/// <reference path="../../../../argos-sdk/libraries/ext/ext-core-debug.js"/>
/// <reference path="../../../../argos-sdk/libraries/sdata/sdata-client-debug"/>
/// <reference path="../../../../argos-sdk/libraries/Simplate.js"/>
/// <reference path="../../../../argos-sdk/src/View.js"/>
/// <reference path="../../../../argos-sdk/src/Edit.js"/>

Ext.namespace("Mobile.SalesLogix.Login");

Mobile.SalesLogix.Login = Ext.extend(Sage.Platform.Mobile.Edit, {
    //Templates
    viewTemplate: new Simplate([
        '<div id="{%= $.id %}" title="{%: $.titleText %}" class="panel {%= $.cls %}" hideBackButton="true">',        
        '<div class="panel-content"></div>',
        '<button class="button actionButton" data-action="authenticate"><span>{%: $.logOnText %}</span></button>',
        '<span class="copyright">{%= $.copyrightText %}</span>',
        '</div>'
    ]),

    //Localization
    id: 'login',
    busy: false,
    copyrightText: '&copy; 2011 Sage Software, Inc. All rights reserved.',
    logOnText: 'Log On',
    passText: 'password',
    rememberText: 'remember',
    titleText: 'Sage SalesLogix',
    userText: 'user name',
    invalidUserText: 'The user name or password is invalid.',
    missingUserText: 'The user record was not found.',
    serverProblemText: 'A problem occured on the server.',
    requestAbortedText: 'The request was aborted.',

    init: function() {
        Mobile.SalesLogix.Login.superclass.init.apply(this, arguments);

        this.tools = {
            bbar: false,
            tbar: false
        };
    },
    getContext: function() {
        return {id: this.id};
    },
    createLayout: function() {
        return this.layout || (this.layout = [
            {
                name: 'username',
                label: this.userText,
                type: 'text'
            },
            {
                name: 'password',
                label: this.passText,
                type: 'password'
            },
            {
                name: 'remember',
                label: this.rememberText,
                type: 'boolean'
            }
        ]);
    },
    authenticate: function () {        
        if (this.busy) return;

        var credentials = this.getValues(),
            username = credentials && credentials.username;

        if (username && /\w+/.test(username))
            this.validateCredentials(credentials);
{'fraction_non_alphanumeric': 0.17990942774804447, 'fraction_numerical': 0.0016467682173734047, 'mean_word_length': 1.925346177001806, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '1503683', 'n_tokens_mistral': 1412, 'n_tokens_neox': 1348, 'n_words': 295}