<commit_before>/*jslint browser: true*/
/*globals $, jQuery, angular, TypiCMS, alertify, top, window, console*/

(function (angular) {

    'use strict';

    angular.module('typicms').controller('ListController', ['$http', '$scope', '$location', '$api', '$cookies', function ($http, $scope, $location, $api, $cookies) {

        $scope.itemsByPage = 100;
        $scope.allChecked = false;
        $scope.deleteLimit = 1000;
        var url = $location.absUrl().split('?')[0],
            modulePath = url.split('/')[4],
            $params = {};

        $scope.TypiCMS = TypiCMS;

        if (TypiCMS.content_locale == null) {
            TypiCMS.content_locale = TypiCMS.locale;
        }

        // if we query menulinks menu_id value :
        if (modulePath === 'menus' && url.split('/')[5]) {
            $params.menu_id = url.split('/')[5];
            modulePath = 'menulinks';
        }

        if (modulePath === 'projects' && url.split('/')[5]) {
            modulePath = 'projects/categories';
        }

        if (TypiCMS.models) {
            $scope.models = TypiCMS.models;
            $scope.displayedModels = [].concat($scope.models);
        } else {
            $api.query($params).$promise.then(function (all) {
                $scope.models = all;
                // Copy the references (you could clone ie angular.copy but then have to go through a dirty checking for the matches)
                $scope.displayedModels = [].concat($scope.models);
            });
        }

        $scope.$on('filesAdded', function (event, models) {
            $scope.models = models;
        });

        $scope.sortableOptions = {
            animation: 50,
            onSort: function (evt){
                $http({
                    method: 'POST',
                    url: '/admin/galleries/sort-files',
                    data: evt.models
                }).then(function successCallback(response) {
                }, function errorCallback(response) {
                    alertify.error('Error ' + response.status + ' ' + response.statusText);
                });
            }
        };

        /**
         * Empty object that will contain checked items
         */
        $scope.checked = {
            models: []
        };

        /**<commit_msg>sortable animation = 100<commit_after>/*jslint browser: true*/
/*globals $, jQuery, angular, TypiCMS, alertify, top, window, console*/

(function (angular) {

    'use strict';

    angular.module('typicms').controller('ListController', ['$http', '$scope', '$location', '$api', '$cookies', function ($http, $scope, $location, $api, $cookies) {

        $scope.itemsByPage = 100;
        $scope.allChecked = false;
        $scope.deleteLimit = 1000;
        var url = $location.absUrl().split('?')[0],
            modulePath = url.split('/')[4],
            $params = {};

        $scope.TypiCMS = TypiCMS;

        if (TypiCMS.content_locale == null) {
            TypiCMS.content_locale = TypiCMS.locale;
        }

        // if we query menulinks menu_id value :
        if (modulePath === 'menus' && url.split('/')[5]) {
            $params.menu_id = url.split('/')[5];
            modulePath = 'menulinks';
        }

        if (modulePath === 'projects' && url.split('/')[5]) {
            modulePath = 'projects/categories';
        }

        if (TypiCMS.models) {
            $scope.models = TypiCMS.models;
            $scope.displayedModels = [].concat($scope.models);
        } else {
            $api.query($params).$promise.then(function (all) {
                $scope.models = all;
                // Copy the references (you could clone ie angular.copy but then have to go through a dirty checking for the matches)
                $scope.displayedModels = [].concat($scope.models);
            });
        }

        $scope.$on('filesAdded', function (event, models) {
            $scope.models = models;
        });

        $scope.sortableOptions = {
            animation: 100,
            onSort: function (evt){
                $http({
                    method: 'POST',
                    url: '/admin/galleries/sort-files',
                    data: evt.models
                }).then(function successCallback(response) {
                }, function errorCallback(response) {
                    alertify.error('Error ' + response.status + ' ' + response.statusText);
                });
            }
        };

        /**
         * Empty object that will contain checked items
         */
        $scope.checked = {
            models: []
        };

        /**
{'fraction_non_alphanumeric': 0.1488850021862702, 'fraction_numerical': 0.006996064713598601, 'mean_word_length': 1.6817116060961312, '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': '3138909', 'n_tokens_mistral': 1323, 'n_tokens_neox': 1236, 'n_words': 270}