<commit_before>// Define libraries
require.config({
    baseUrl: 'resources/js/',
    waitSeconds: 200,
    paths: {
        mocha: 'lib/mocha-1.4.2',
        chai: 'lib/chai-1.2.0',
        jquery: 'lib/jquery-1.10.2',
        text: 'lib/require/text',
        mobile: 'lib/jquery.mobile-1.4.0-rc.1',
        ember: 'lib/ember-1.1.2',
        handlebars: 'lib/handlebars-1.0.0',
        d3: 'lib/d3-2.10.1',
        md5: 'lib/md5',
        sha256: 'lib/sha256',
    },
    shim: {
        'ember': {
            deps: ['handlebars', 'text', 'jquery', 'md5', 'sha256']
        },
        'd3': {
            deps: ['jquery']
        }
    }
});

// Load our app
define( 'app', [
    'jquery',
    'd3',
    'app/controllers/login',
    'app/controllers/backends',
    'app/controllers/confirmation',
    'app/controllers/notification',
    'app/controllers/backend_add',
    'app/controllers/backend_edit',
    'app/controllers/machine_add',
    'app/controllers/machine_keys',
    'app/controllers/machine_power',
    'app/controllers/monitoring',
    'app/controllers/key_add',
    'app/controllers/key_edit',
    'app/controllers/keys',
    'app/controllers/machine_tags',
    'app/controllers/rules',
    'app/views/home',
    'app/views/login',
    'app/views/backend_button',
    'app/views/backend_add',
    'app/views/backend_edit',
    'app/views/monitoring',
    'app/views/machine_list_item',
    'app/views/image_list_item',
    'app/views/machine_add_dialog',
    'app/views/machine',
    'app/views/machine_list',
    'app/views/confirmation_dialog',
    'app/views/shell',
    'app/views/image_list',
    'app/views/machine_power',
    'app/views/machine_tags',
    'app/views/machine_keys',
    'app/views/machine_keys_list_item',
    'app/views/machine_tags_list_item',
    'app/views/key_list_item',
    'app/views/key_list',
    'app/views/key',
    'app/views/key_add_dialog',
    'app/views/key_edit_dialog',
    'app/views/rule',
    'app/views/user_menu',
    'app/views/list_item',
    'ember'
    ], function($,
                d3,
                LoginController,
                BackendsController,
                ConfirmationController,
                NotificationController,
                BackendAddController,
                BackendEditController,
                MachineAddController,
                MachineKeysController,
                MachinePowerController,
                MonitoringController,
                KeyAddController,
                KeyEditController,
                KeysController,
                MachineTagsController,
                RulesController,
                Home,
                LoginView,
                BackendButton,
                BackendAdd,
                EditBackend,
                MonitoringView,
                MachineListItem,
                ImageListItem,
                MachineAddDialog,
                SingleMachineView,
                MachineListView,
                ConfirmationDialog,
                ShellView,
                ImageListView,
                MachinePowerView,
                MachineTagsView,
                MachineKeysView,
                MachineKeysListItemView,
                MachineTagsListItemView,
                KeyListItemView,
                KeyListView,
                SingleKeyView,
                KeyAddDialog,
                KeyEditDialog,
                RuleView,
                UserMenuView,
                ListItemView
                ) {

    function initialize() {

        // JQM init event

        $(document).bind('mobileinit', function() {
            $('#splash').fadeOut(650);
            $.mobile.ajaxEnabled = false;
            $.mobile.pushStateEnabled = false;
            $.mobile.linkBindingEnabled = false;
            $.mobile.hashListeningEnabled = false;
            $.mobile.panel.prototype._bindUpdateLayout = function(){};
            $('body').css('overflow','auto');
        });

        // Ember Application

        App = Ember.Application.create({
            ready: function() {
                require(['mobile']);
            }
        });

        // Globals

        App.set('isCore', IS_CORE);
        App.set('authenticated', AUTH || IS_CORE);
        App.set('ajax', new AJAX('')); // TODO: Get CSRF_TOKEN from server
        App.set('email', EMAIL);
        App.set('password', '');
        window.Mist = App;<commit_msg>dont show error messages when reloading or leaving page<commit_after>// Define libraries
require.config({
    baseUrl: 'resources/js/',
    waitSeconds: 200,
    paths: {
        mocha: 'lib/mocha-1.4.2',
        chai: 'lib/chai-1.2.0',
        jquery: 'lib/jquery-1.10.2',
        text: 'lib/require/text',
        mobile: 'lib/jquery.mobile-1.4.0-rc.1',
        ember: 'lib/ember-1.1.2',
        handlebars: 'lib/handlebars-1.0.0',
        d3: 'lib/d3-2.10.1',
        md5: 'lib/md5',
        sha256: 'lib/sha256',
    },
    shim: {
        'ember': {
            deps: ['handlebars', 'text', 'jquery', 'md5', 'sha256']
        },
        'd3': {
            deps: ['jquery']
        }
    }
});

// Load our app
define( 'app', [
    'jquery',
    'd3',
    'app/controllers/login',
    'app/controllers/backends',
    'app/controllers/confirmation',
    'app/controllers/notification',
    'app/controllers/backend_add',
    'app/controllers/backend_edit',
    'app/controllers/machine_add',
    'app/controllers/machine_keys',
    'app/controllers/machine_power',
    'app/controllers/monitoring',
    'app/controllers/key_add',
    'app/controllers/key_edit',
    'app/controllers/keys',
    'app/controllers/machine_tags',
    'app/controllers/rules',
    'app/views/home',
    'app/views/login',
    'app/views/backend_button',
    'app/views/backend_add',
    'app/views/backend_edit',
    'app/views/monitoring',
    'app/views/machine_list_item',
    'app/views/image_list_item',
    'app/views/machine_add_dialog',
    'app/views/machine',
    'app/views/machine_list',
    'app/views/confirmation_dialog',
    'app/views/shell',
    'app/views/image_list',
    'app/views/machine_power',
    'app/views/machine_tags',
    'app/views/machine_keys',
    'app/views/machine_keys_list_item',
    'app/views/machine_tags_list_item',
    'app/views/key_list_item',
    'app/views/key_list',
    'app/views/key',
    'app/views/key_add_dialog',
    'app/views/key_edit_dialog',
    'app/views/rule',
    'app/views/user_menu',
    'app/views/list_item',
    'ember'
    ], function($,
                d3,
                LoginController,
                BackendsController,
                ConfirmationController,
                NotificationController,
                BackendAddController,
                BackendEditController,
                MachineAddController,
                MachineKeysController,
                MachinePowerController,
                MonitoringController,
                KeyAddController,
                KeyEditController,
                KeysController,
                MachineTagsController,
                RulesController,
                Home,
                LoginView,
                BackendButton,
                BackendAdd,
                EditBackend,
                MonitoringView,
                MachineListItem,
                ImageListItem,
                MachineAddDialog,
                SingleMachineView,
                MachineListView,
                ConfirmationDialog,
                ShellView,
                ImageListView,
                MachinePowerView,
                MachineTagsView,
                MachineKeysView,
                MachineKeysListItemView,
                MachineTagsListItemView,
                KeyListItemView,
                KeyListView,
                SingleKeyView,
                KeyAddDialog,
                KeyEditDialog,
                RuleView,
                UserMenuView,
                ListItemView
                ) {

    function initialize() {

        // JQM init event

        $(document).bind('mobileinit', function() {
            $('#splash').fadeOut(650);
            $.mobile.ajaxEnabled = false;
            $.mobile.pushStateEnabled = false;
            $.mobile.linkBindingEnabled = false;
            $.mobile.hashListeningEnabled = false;
            $.mobile.panel.prototype._bindUpdateLayout = function(){};
            $('body').css('overflow','auto');
        });
        
        // Hide error boxes on page unload
        window.onbeforeunload = function() {
            $('.ui-loader').hide();
        };
        

        // Ember Application

        App = Ember.Application.create({
            ready: function() {
                require(['mobile']);
            }
        });

        // Globals

        App.set('isCore', IS_CORE);
        App.set('authenticated', AUTH || IS_CORE);
        App.set('ajax', new AJAX('')); // TODO: Get CSRF_TOKEN from server
        App.set('email', EMAIL);
        App.set('password', '');
        window.Mist = App;
{'fraction_non_alphanumeric': 0.12559742136267646, 'fraction_numerical': 0.010447927086806714, 'mean_word_length': 1.651149086623453, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4865308', 'n_tokens_mistral': 2717, 'n_tokens_neox': 2562, 'n_words': 374}