PageSourceSearch

https://www.v3r.net/wp-content/themes/v3r/Scripts/Controllers/AccueilController.js

js v3r.net collected 2026-10-02 10:05:35 UTC 6,637 bytes, 152 lines download raw bytes

1var HomeActualiteTypes;
2(function (HomeActualiteTypes) {
3    HomeActualiteTypes["d524fff3-7dd1-48d8-9856-05dc532238e1"] = "Actualit\u00E9";
4    HomeActualiteTypes["51d4a17f-a762-4ef2-8074-e7e07adce3fb"] = "Article";
5    HomeActualiteTypes["20824aac-e9b0-45fe-813c-22bafd5b16bc"] = "Avis";
6    HomeActualiteTypes["f835de65-b635-4708-bfe3-42ac87eee757"] = "Important";
7})(HomeActualiteTypes || (HomeActualiteTypes = {}));
8app.controller("AccueilController", ["$scope", "$http", function ($scope, $http) {
9        $scope.imageUrl = "";
10        $scope.activites = [];
11        $scope.isSearchingActivities = false;
12        $scope.activitesQuery = {};
13        $scope.activitesQuery.postType = "activites";
14        $scope.activitesQuery.orderBy = "meta_value date";
15        $scope.activitesQuery.order = "DESC";
16        $scope.activitesQuery.take = 4;
17        $scope.actualites = [];
18        $scope.isSearchingActualites = false;
19        $scope.actualitesQuery = {};
20        $scope.actualitesQuery.postType = "actualites";
21        $scope.actualitesQuery.orderBy = "meta_value date";
22        $scope.actualitesQuery.order = "DESC";
23        $scope.actualitesQuery.take = 7;
24        $scope.actualitesQuery.filters = {};
25        $scope.actualitesQuery.filters.types = ["20824aac-e9b0-45fe-813c-22bafd5b16bc", "d524fff3-7dd1-48d8-9856-05dc532238e1", "f835de65-b635-4708-bfe3-42ac87eee757"];
26        $scope.articles = [];
27        $scope.isSearchingArticles = false;
28        $scope.articlesQuery = {};
29        $scope.articlesQuery.postType = "actualites";
30        $scope.articlesQuery.orderBy = "meta_value date";
31        $scope.articlesQuery.order = "DESC";
32        $scope.articlesQuery.take = 4;
33        $scope.articlesQuery.filters = {};
34        $scope.articlesQuery.filters.types = ["51d4a17f-a762-4ef2-8074-e7e07adce3fb"];
35        $scope.actualiteTypes = HomeActualiteTypes;
36        $scope.init = function () {
37            if (window.ImageUrls) {
38                var random = Math.floor(Math.random() * window.ImageUrls.length);
39                $scope.imageUrl = window.ImageUrls[random];
40            }
41            $scope.getActualites();
42            $scope.getArticles();
43            $scope.getActivites();
44        };
45        $scope.getActivites = function () {
46            $scope.isSearchingActivities = true;
47            $scope.activites = [];
48            $http({
49                url: "/ajax/wp-queries/archive-activites.php",
50                method: "POST",
51                responseType: "json",
52                data: { query: $scope.activitesQuery }
53            }).then(function successCallback(response) {
54                if (response.data) {
55                    if (response.data.success == true) {
56                        $scope.activites = response.data.data;
57                    }
58                }
59                $scope.isSearchingActivities = false;
60            }, function errorCallback(response) {
61                $scope.isSearchingActivities = false;
62            });
63        };
64        $scope.getActualites = function () {
65            $scope.isSearchingActualites = true;
66            $scope.actualites = [];
67            $http({
68                url: "/ajax/wp-queries/archive-actualites.php",
69                method: "POST",
70                responseType: "json",
71                data: { query: $scope.actualitesQuery }
72            }).then(function successCallback(response) {
73                if (response.data) {
74                    if (response.data.success == true) {
75                        $scope.actualites = response.data.data;
76                    }
77                }
78                $scope.isSearchingActualites = false;
79            }, function errorCallback(response) {
80                $scope.isSearchingActualites = false;
81            });
82        };
83        $scope.getArticles = function () {
84            $scope.isSearchingArticles = true;
85            $scope.articles = [];
86            $http({
87                url: "/ajax/wp-queries/archive-actualites.php",
88                method: "POST",
89                responseType: "json",
90                data: { query: $scope.articlesQuery }
91            }).then(function successCallback(response) {
92                if (response.data) {
93                    if (response.data.success == true) {
94                        $scope.articles = response.data.data;
95                    }
96                }
97                $scope.isSearchingArticles = false;
98            }, function errorCallback(response) {
99                $scope.isSearchingArticles = false;
100            });
101        };
102        $scope.getTypeSlug = function (type) {
103            var slug = $scope.actualiteTypes[type];
104            if (slug)
105                return slug.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
106            return "";
107        };
108        $scope.getDate = function (startDate, endDate) {
109            if (startDate == null || startDate == "")
110                return;
111            var result = "";
112            var startDateSplitted = startDate.split("/");
113            if (startDateSplitted.length == 3) {
114                result = (startDateSplitted[0].substring(0, 1) == "0" ? startDateSplitted[0].substring(1, 2) : startDateSplitted[0]) + " " + $scope.getMonth(Number(startDateSplitted[1]) - 1);
115                if (endDate != null && endDate != "") {
116                    var endDateSplitted = endDate.split("/");
117                    if (endDateSplitted.length == 3) {
118                        if (startDateSplitted[2] != endDateSplitted[2])
119                            result += " " + startDateSplitted[2];
120                        result += " au " + (endDateSplitted[0].substring(0, 1) == "0" ? endDateSplitted[0].substring(1, 2) : endDateSplitted[0]) + " " + $scope.getMonth(Number(endDateSplitted[1]) - 1) + " " + endDateSplitted[2];
121                    }
122                    else {
123                        result += " " + startDateSplitted[2];
124                    }
125                }
126                else {
127                    result += " " + startDateSplitted[2];
128                }
129            }
130            return result;
131        };
132        $scope.getMonth = function (value) {
133            var i = Number(value);
134            var months = [
135                "janvier",
136                "février",
137                "mars",
138                "avril",
139                "mai",
140                "juin",
141                "juillet",
142                "août",
143                "septembre",
144                "octobre",
145                "novembre",
146                "décembre"
147            ];
148            return months[i];
149        };
150        $scope.init();
151    }]);
152//# sourceMappingURL=AccueilController.js.map

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.