<commit_before>// ==========================================================================
// Project:   The-M-Project - Mobile HTML5 Application Framework
// Copyright: 2010 M-Way Solutions GmbH. All rights reserved.
// Creator:   Dominik
// Date:      26.10.2010
// License:   ...
// ==========================================================================

Demo.LoginController = M.Controller.extend({

    doClick: function() {
        M.Logger.log('doClick in Demo.LoginController');
        /* MISSING: the query is ignored so far */
        var result = Demo.UserModel.find("(userName = 'u1' AND password = '<PASSWORD>')");
        if(result && result.length > 0) {
            M.Logger.log('Login was successfull');
            this.switchToView('Demo.LoggedInView');
        }
        //location.href = location.href.substr(0, location.href.lastIndexOf('#')) + '#page2';
    }

});<commit_msg>loginController updated to do a sample ajax-request<commit_after>// ==========================================================================
// Project:   The-M-Project - Mobile HTML5 Application Framework
// Copyright: 2010 M-Way Solutions GmbH. All rights reserved.
// Creator:   Dominik
// Date:      26.10.2010
// License:   ...
// ==========================================================================

Demo.LoginController = M.Controller.extend({

    doClick: function() {
        M.Logger.log('doClick in Demo.LoginController');
        /* MISSING: the query is ignored so far */
        var result = Demo.UserModel.find("(userName = 'u1' AND password = '<PASSWORD>')");
        if(result && result.length > 0) {
            M.Logger.log('Login was successfull');
            this.switchToView('Demo.LoggedInView');
        }

        M.Request.init({
            url: 'index.html',
            type: 'GET',
            onSuccess: this.dataIsHere
        }).send();
    },

    dataIsHere: function(data, msg, request) {
        M.Logger.log('######################');
        M.Logger.log(data);
        M.Logger.log(msg);
        M.Logger.log(request);
        M.Logger.log('######################');
    }

});
{'fraction_non_alphanumeric': 0.2906704172526957, 'fraction_numerical': 0.015002344116268168, 'mean_word_length': 2.8312387791741473, 'pattern_counts': {'":': 0, '<': 5, '<?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': '920165', 'n_tokens_mistral': 611, 'n_tokens_neox': 551, 'n_words': 123}