<commit_before>'use strict';

/* Directives */

var app = angular.module('myApp.directives', []);


app.directive('appVersion', ['version', function(version) {
        return function(scope, elm, attrs) {
            elm.text(version);
        };
    }]);

app.directive('editor', function($timeout) {
    var editorWindow = angular.element('<pre id="editor-{{$index}}">{{file.content}}</pre>');
    return {
        restrict: 'E',
        compile: function(elem) {
            elem.append(editorWindow);

            return function(scope, element, attrs) {

                $timeout(function() {

                    var lang = attrs.language,
                            editor = ace.edit('editor-' + attrs.index);

                    console.log({language: lang});

                    editor.setTheme("ace/theme/tomorrow");
                    editor.getSession().setMode("ace/mode/" + lang);

                    editor.on('change', function(data) {
                        scope.file.content = editor.getValue();
                    });

                }, 0);
            }
        }

    };
});

module.directive('unfocus', function() {
    return {
        restrict: 'A',
        link: function(scope, element, attribs) {

            element[0].focus();

            element.bind("blur", function() {
                scope.$apply(attribs["unfocus"]);
                console.log("??");
            });

        }

    }
});

//
//
//    return function(scope, element, attrs) {
//        $timeout(function() {
//            var lang = attrs.editor;
//            var editor = ace.edit(element[0]);
//            editor.setTheme("ace/theme/tomorrow");
//            editor.getSession().setMode("ace/mode/" + lang);
//
//            editor.on('change', function(data) {
//               console.log(editor.getValue());
//
//            });
//
//        }, 0);
//    };
//});<commit_msg>Fix the error in console() - Maayan is unhappy.<commit_after>'use strict';

/* Directives */

var app = angular.module('myApp.directives', []);


app.directive('appVersion', ['version', function(version) {
        return function(scope, elm, attrs) {
            elm.text(version);
        };
    }]);

app.directive('editor', function($timeout) {
    var editorWindow = angular.element('<pre id="editor-{{$index}}">{{file.content}}</pre>');
    return {
        restrict: 'E',
        compile: function(elem) {
            elem.append(editorWindow);

            return function(scope, element, attrs) {

                $timeout(function() {

                    var lang = attrs.language,
                            editor = ace.edit('editor-' + attrs.index);

                    console.log({language: lang});

                    editor.setTheme("ace/theme/tomorrow");
                    editor.getSession().setMode("ace/mode/" + lang);

                    editor.on('change', function(data) {
                        scope.file.content = editor.getValue();
                    });

                }, 0);
            }
        }

    };
});

app.directive('unfocus', function() {
    return {
        restrict: 'A',
        link: function(scope, element, attribs) {

            element[0].focus();

            element.bind("blur", function() {
                scope.$apply(attribs["unfocus"]);
                console.log("??");
            });

        }

    };
});

//
//
//    return function(scope, element, attrs) {
//        $timeout(function() {
//            var lang = attrs.editor;
//            var editor = ace.edit(element[0]);
//            editor.setTheme("ace/theme/tomorrow");
//            editor.getSession().setMode("ace/mode/" + lang);
//
//            editor.on('change', function(data) {
//               console.log(editor.getValue());
//
//            });
//
//        }, 0);
//    };
//});
{'fraction_non_alphanumeric': 0.1759937238493724, 'fraction_numerical': 0.0020920502092050207, 'mean_word_length': 1.551701134089393, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5407135', 'n_tokens_mistral': 1080, 'n_tokens_neox': 1036, 'n_words': 165}