PageSourceSearch

https://usssa.com/js/controllers/mostRecentCtrl.js

js usssa.com collected 2026-10-01 11:44:47 UTC 2,382 bytes, 73 lines download raw bytes

1var controller = usssa.controller('mostRecentCtrl', ['$scope', '$rootScope', '$filter', '$http', 'API', '$location', 'jsLib','$sce', 'storage', function ($scope, $rootScope, $filter, $http, API, $location, jsLib,$sce, storage) {
2
3    function init(){
4        //$scope.currentTab = 'team';
5        getList();
6    }
7
8    function getList(){
9        $scope.showAll = false;
10        var arr = storage.getRecent($scope.currentTab);
11        $scope.teams = [];
12        $scope.events = [];
13        $scope.players = [];
14
15        if (arr.length > 0){
16            $scope.loading = true;
17            API.post({ action: 'getRecentList', array: encodeURIComponent(angular.toJson(arr)), type: $scope.currentTab})
18                .then(function(data) {
19                    if ($scope.currentTab == 'team'){
20                        $scope.teams = data;
21                    }else if ($scope.currentTab == 'event'){
22                        $scope.events = data;
23                    }else if ($scope.currentTab == 'player'){
24                        $scope.players = data;
25                    }
26                    $scope.loading = false;
27                },
28                function(error) {
29                    $scope.loading = false;
30                    $scope.error = false;
31            });
32        }
33    }
34
35    $scope.setTab = function(tab){
36        $scope.currentTab = tab;
37        getList();
38    }
39
40    $scope.showAllItems = function(){
41        $scope.showAll = true;
42    }
43
44    $scope.clearList = function(){
45        if (confirm('Are you sure?')){
46            if ($scope.currentTab == 'team')
47                $scope.teams = [];
48            else if ($scope.currentTab == 'event')
49                $scope.events = [];
50            else if ($scope.currentTab == 'player')
51                $scope.players = [];
52            storage.remove('recent-'+$scope.currentTab);
53        }
54    }
55
56    $scope.deleteItem = function(id, type){
57        $scope.loading = true;
58        var arr = storage.getRecent($scope.currentTab);
59        var i = arr.indexOf(''+id+'');
60        if (i > -1){
61            arr.splice(i, 1);
62            storage.save('recent-' + $scope.currentTab, arr);
63            getList();
64        }
65        $scope.loading = false;
66    }
67
68    $scope.closeTab = function(){
69        $scope.currentTab = null;
70    }
71
72    init();
73}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.