<commit_before>// Typing controller for TypeItQuick app.
angular.module('TypeItQuick').
    controller('TypeCtrl', ['$scope', '$http', '$location', '$window', 'contestService', '$routeParams', 'ioService',
        function($scope, $http, $location, $window, contestService, $routeParams, ioService) {
            // Init word.
            $scope.word = '';

            // Done.
            $scope.winner = '';

            // Init contest data.
            function initData(result) {
                // Fetch index.
                $scope.userId = result.user;

                // Fetch user.
                $scope.user = result.users[result.user];

                // Set users.
                $scope.users = result.users;

                // Set winner.
                $scope.winner = result.winner;

                // Extract words.
                $scope.words = contestService.words(result.words);

                // Setup socket.
                ioService.setup();

                // Disable copy paste.
                $('#the-input').bind("cut copy paste",function(e) {
                    e.preventDefault();
                    this.focus();
                });

                // Setup progress handlers.
                ioService.on('word', function(data) {
                    $scope.$apply(function () {
                        // User progress.
                        $scope.users[data.user].progress = data.progress;
                    });
                });

                // Setup done handler.
                ioService.on('done', function(data) {<commit_msg>Focus fixed.<commit_after>// Typing controller for TypeItQuick app.
angular.module('TypeItQuick').
    controller('TypeCtrl', ['$scope', '$http', '$location', '$window', 'contestService', '$routeParams', 'ioService',
        function($scope, $http, $location, $window, contestService, $routeParams, ioService) {
            // Init word.
            $scope.word = '';

            // Done.
            $scope.winner = '';

            // Init contest data.
            function initData(result) {
                // Fetch index.
                $scope.userId = result.user;

                // Fetch user.
                $scope.user = result.users[result.user];

                // Set users.
                $scope.users = result.users;

                // Set winner.
                $scope.winner = result.winner;

                // Extract words.
                $scope.words = contestService.words(result.words);

                // Setup socket.
                ioService.setup();

                // Disable copy paste.
                $('#the-input').bind("cut copy paste",function(e) {
                    e.preventDefault();
                });

                // Focus.
                $('#the-input').focus();

                // Setup progress handlers.
                ioService.on('word', function(data) {
                    $scope.$apply(function () {
                        // User progress.
                        $scope.users[data.user].progress = data.progress;
                    });
                });

                // Setup done handler.
                ioService.on('done', function(data) {
{'fraction_non_alphanumeric': 0.13397575380789556, 'fraction_numerical': 0.0, 'mean_word_length': 1.195088676671214, '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': '1539421', 'n_tokens_mistral': 816, 'n_tokens_neox': 742, 'n_words': 158}