<commit_before>﻿(function () {
    'use strict';

    var projectsSearchPageController = function projectsSearchPageController($scope, $routeParams, $location, $window, searchPageData, projectsSearchService, identity) {
        var vm = this,
            oDataQuery,
            canGetNext = true,
            CONSTS = {
                DESC: 'desc'
            };

        vm.projects = [];
        vm.isLastPage = false;
        vm.loading = false;
        vm.initialProjectsLoaded = false;

        vm.filterOptions = projectsSearchService.getFilterOptions();
        vm.filterOptions.desc = $routeParams.desc === undefined ? true : $routeParams.desc;
        vm.searchParams = projectsSearchService.getSearchParams();

        $scope.currentPage = 1;

        identity.getUser()
            .then(function (user) {
                vm.isAdmin = user.isAdmin;

                if (vm.isAdmin) {
                    vm.filterOptions.orderOptions.push({
                        value: 'flags',
                        name: 'Flags'
                    });
                }
            });

        vm.search = function (query) {
            $routeParams = {
                $orderby: vm.filterOptions.orderOption.value + (vm.filterOptions.desc ? ' ' + CONSTS.DESC : ''),
                $top: vm.filterOptions.pageSize,
                $skip: 0,
                $count: 'true',
                $filter: "createdOn ge " + projectsSearchService.getODataUTCDateFilter(vm.searchParams.fromDate) +
                    " and createdOn le " + projectsSearchService.getODataUTCDateFilter(vm.searchParams.toDate)
            };

            if (vm.searchParams.title || vm.searchParams.tags || vm.searchParams.collaborators || vm.searchParams.period) {
                $routeParams.$filter = (function getSeachParams() {
                    var args = [], index = 0;
                    if (vm.searchParams.title) {
                        args[index] = vm.searchParams.title<commit_msg>Infinite scroll is now checked by default. Closes #149<commit_after>﻿(function () {
    'use strict';

    var projectsSearchPageController = function projectsSearchPageController($scope, $routeParams, $location, $window, searchPageData, projectsSearchService, identity) {
        var vm = this,
            oDataQuery,
            canGetNext = true,
            CONSTS = {
                DESC: 'desc'
            };

        vm.projects = [];
        vm.isLastPage = false;
        vm.loading = false;
        vm.initialProjectsLoaded = false;

        vm.filterOptions = projectsSearchService.getFilterOptions();
        vm.filterOptions.desc = $routeParams.desc === undefined ? true : $routeParams.desc;
        vm.searchParams = projectsSearchService.getSearchParams();

        $scope.currentPage = 1;

        if ($window.localStorage.scrolling == undefined) {
            $window.localStorage.scrolling = 'true';
            vm.filterOptions.scrolling = true;
        }

        identity.getUser()
            .then(function (user) {
                vm.isAdmin = user.isAdmin;

                if (vm.isAdmin) {
                    vm.filterOptions.orderOptions.push({
                        value: 'flags',
                        name: 'Flags'
                    });
                }
            });

        vm.search = function (query) {
            $routeParams = {
                $orderby: vm.filterOptions.orderOption.value + (vm.filterOptions.desc ? ' ' + CONSTS.DESC : ''),
                $top: vm.filterOptions.pageSize,
                $skip: 0,
                $count: 'true',
                $filter: "createdOn ge " + projectsSearchService.getODataUTCDateFilter(vm.searchParams.fromDate) +
                    " and createdOn le " + projectsSearchService.getODataUTCDateFilter(vm.searchParams.toDate)
            };

            if (vm.searchParams.title || vm.searchParams.tags || vm.searchParams.collaborators || vm.searchParams.period) {
                $routeParams.$filter = (function getSeachParams() {
                    var args = [], index = 0;
                    if (vm.searchParams.title) {
                        args[index] = vm.searchParams.title
{'fraction_non_alphanumeric': 0.10937874790117534, 'fraction_numerical': 0.0021587910769968817, 'mean_word_length': 1.6990291262135921, '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': '1469148', 'n_tokens_mistral': 1116, 'n_tokens_neox': 1052, 'n_words': 194}