<commit_before>/* Directives */
angular.module('myApp.directives')
        .directive('ngVisible', function() {
            return function(scope, elem, attr) {
                scope.$watch(attr.ngVisible, function(value) {
                    elem.css('visibility', value ? 'visible' : 'hidden');
                });
            };
        })
        .directive('ngKeyup', function() {
            return function(scope, elem, attrs) {
                elem.bind('keyup', function() {
                    scope.$apply(attrs.ngKeyup);
                });
            };
        })
        .directive('gimsLinkNew', function($routeParams) {
            return {
                restrict: "E",
                replace: true,
                scope: {
                    content: '='
                },
                link: function(scope, element, attrs) {

                    var returnUrl = '';
                    if (attrs.origin) {
                        returnUrl = sprintf('?returnUrl=/admin/%s/edit/%s&%s=%s',
                                attrs.origin,
                                $routeParams.id,
                                attrs.origin,
                                $routeParams.id
                                );
                    }

                    var html = sprintf('<a class="link-new list-inline btn btn-default" href="/admin/%s/new%s"><i class="fa fa-plus-circle"></i> new %s</a>',
                            attrs.target,
                            returnUrl,
                            attrs.target
                            );

                    element.html(html).show();
                }
            };
        })
        .directive('gimsFocus', function($timeout) {
            return {
                link: function(element) {
                    $timeout(function() {
                        element.focus();
                    });
                }
            };
        });<commit_msg>Fix autofocus in user login dialog<commit_after>/* Directives */
angular.module('myApp.directives')
        .directive('ngVisible', function() {
            return function(scope, elem, attr) {
                scope.$watch(attr.ngVisible, function(value) {
                    elem.css('visibility', value ? 'visible' : 'hidden');
                });
            };
        })
        .directive('ngKeyup', function() {
            return function(scope, elem, attrs) {
                elem.bind('keyup', function() {
                    scope.$apply(attrs.ngKeyup);
                });
            };
        })
        .directive('gimsLinkNew', function($routeParams) {
            return {
                restrict: "E",
                replace: true,
                scope: {
                    content: '='
                },
                link: function(scope, element, attrs) {

                    var returnUrl = '';
                    if (attrs.origin) {
                        returnUrl = sprintf('?returnUrl=/admin/%s/edit/%s&%s=%s',
                                attrs.origin,
                                $routeParams.id,
                                attrs.origin,
                                $routeParams.id
                                );
                    }

                    var html = sprintf('<a class="link-new list-inline btn btn-default" href="/admin/%s/new%s"><i class="fa fa-plus-circle"></i> new %s</a>',
                            attrs.target,
                            returnUrl,
                            attrs.target
                            );

                    element.html(html).show();
                }
            };
        })
        .directive('gimsFocus', function($timeout) {
            return {
                link: function(scope, element) {
                    $timeout(function() {
                        element.focus();
                    }, 100);
                }
            };
        });
{'fraction_non_alphanumeric': 0.12274000509294627, 'fraction_numerical': 0.0007639419404125286, 'mean_word_length': 0.9142300194931774, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '501867', 'n_tokens_mistral': 945, 'n_tokens_neox': 885, 'n_words': 147}