<commit_before>'use strict';

Z.app.controller('NavigationController', ['$scope', '$location', '$timeout', 'menu', function ($scope, $location, $timeout, menu) {
    var that = this;

    this.location = $location;
    this.menu = menu;
    this.activeView = this.activeContent = 1;
    this.viewHasTransitioned = true;

    $scope.$on('$routeChangeSuccess', function(event) {
        that.menu.setIsActive(false);
    });

    this.activateView = function(viewToActivate, isPush, template, data) {
        // Prevent double click or clicks during CSS transitions
        if (!this.viewHasTransitioned || this.activeView === viewToActivate) {
            return false;
        }

        // Prevent moving between views when menu is open
        if (this.menu.isActive()) {
            this.toggleMenu();
            this.viewHasTransitioned = false;
        } else {
            this.activeView = viewToActivate;
            this.viewHasTransitioned = false;

            // push needs data...
            if (isPush) {
                this.activeContent = viewToActivate;
                
                data._activeView = viewToActivate; // Attach it to use in the view
                $scope['view' + viewToActivate] = template;
                $scope.pushData = data;
            }
        }

        $timeout(function () {
            that.viewHasTransitioned = true;

            // ...and pop needs little hack for scrolling issue
            if (!isPush) {
                that.activeContent = viewToActivate;
            }
        }, 200);
    };

    this.popView = function() {
        this.activateView(this.activeView - 1, false);
    };

    this.pushView = function(template, data) {
        this.activateView(this.activeView + 1, true, template, data);
    };

    this.toggleMenu = function() {
        this.menu.toggleIsActive();
    };

    this.swipe = function(direction) {
        if (this.activeView === 1) {
            if (this.menu.isActive() && direction === 'left') {
                this.menu.setIsActive(false);
            } else if (!this.menu.isActive() && direction === 'right') {
                this.menu.setIsActive(true);
            }
        } else if (direction === 'right') {
            this.popView();<commit_msg>Bariableak zertxobait egokituta<commit_after>'use strict';

Z.app.controller('NavigationController', ['$scope', '$location', '$timeout', 'menu', function ($scope, $location, $timeout, menu) {
    this.location = $location;
    this.menu = menu;
    this.activeView = this.activeContent = 1;
    this.viewHasTransitioned = true;

    $scope.$on('$routeChangeSuccess', function(event) {
        menu.setIsActive(false);
    });

    this.activateView = function(viewToActivate, isPush, template, data) {
        var that = this,
            cssTransitionDuration = 200;

        // Prevent double click or clicks during CSS transitions
        if (!this.viewHasTransitioned || this.activeView === viewToActivate) {
            return false;
        }

        // Prevent moving between views when menu is open
        if (menu.isActive()) {
            this.toggleMenu();
            this.viewHasTransitioned = false;
        } else {
            this.activeView = viewToActivate;
            this.viewHasTransitioned = false;

            // push needs data...
            if (isPush) {
                this.activeContent = viewToActivate;
                
                data._activeView = viewToActivate; // Attach it to use in the view
                $scope['view' + viewToActivate] = template;
                $scope.pushData = data;
            }
        }

        $timeout(function () {
            that.viewHasTransitioned = true;

            // ...and pop needs little hack for scrolling issue
            if (!isPush) {
                that.activeContent = viewToActivate;
            }
        }, cssTransitionDuration);
    };

    this.popView = function() {
        this.activateView(this.activeView - 1, false);
    };

    this.pushView = function(template, data) {
        this.activateView(this.activeView + 1, true, template, data);
    };

    this.toggleMenu = function() {
        menu.toggleIsActive();
    };

    this.swipe = function(direction) {
        if (this.activeView === 1) {
            if (menu.isActive() && direction === 'left') {
                menu.setIsActive(false);
            } else if (!menu.isActive() && direction === 'right') {
                menu.setIsActive(true);
            }
        } else if (direction === 'right') {
            this.popView();
{'fraction_non_alphanumeric': 0.12423312883435583, 'fraction_numerical': 0.003067484662576687, 'mean_word_length': 1.8874130297280203, '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': '6421326', 'n_tokens_mistral': 1271, 'n_tokens_neox': 1211, 'n_words': 279}