PageSourceSearch

https://b2b.sodanca.com/js/SoDanca/Controllers/mediaControllers.js

js sodanca.com collected 2026-09-24 11:09:10 UTC 5,339 bytes, 139 lines download raw bytes

1
2// Media Controllers ========================================================================================
3
4// Variables -----------------------------------------------------
5// ---------------------------------------------------------------
6
7// Functions -----------------------------------------------------
8// ---------------------------------------------------------------
9
10// Ready ---------------------------------------------------------
11// ---------------------------------------------------------------
12
13angular.module('webSoDanca').controller('mediaController', ['$scope', 'util', function ($scope, util) {
14
15    // Variables -----------------------------------------------------
16
17    // ---------------------------------------------------------------
18
19    // Functions -----------------------------------------------------
20    util.goToPage('mediaImages');
21    // ---------------------------------------------------------------
22
23}]);
24
25angular.module('webSoDanca').controller('mediaImagesController', ['$scope', 'util', 'mediaService', function ($scope, util, mediaService) {
26
27    // Variables -----------------------------------------------------
28    $scope.url              = util.getUrlDefault() + "/media/MediaPage/Photos";
29    $scope.classicItems     = [];
30    $scope.fashionItems     = [];
31    $scope.saraItems        = [];
32    $scope.socialItems      = [];
33    // ---------------------------------------------------------------
34
35    // Functions -----------------------------------------------------
36    $scope.goToVideos       = function () {
37        util.goToPage("mediaVideos");
38    };
39    $scope.goToCatalogs     = function () {
40        util.goToPage("mediaCatalogs");
41    };
42    $scope.goToProducts     = function () {
43        util.goToPage("mediaProducts");
44    };
45    // ---------------------------------------------------------------
46
47    // On Ready ------------------------------------------------------
48    var items = mediaService.getItems("images");
49    for (it = 0; it < items.length; it++) {
50        if (items[it].type === 'classic') {
51            $scope.classicItems.push(items[it]);
52        } else if (items[it].type === 'fashion') {
53            $scope.fashionItems.push(items[it]);
54        } else if (items[it].type === 'sara_mearns') {
55            $scope.saraItems.push(items[it]);
56        } else if (items[it].type === 'social') {
57            $scope.socialItems.push(items[it]);
58        }
59    }
60    // ---------------------------------------------------------------
61
62}]);
63
64angular.module('webSoDanca').controller('mediaVideosController', ['$scope', 'util', 'mediaService', '$sce', function ($scope, util, mediaService, $sce) {
65
66    // Variables -----------------------------------------------------
67    $scope.url = util.getUrlDefault() + "/media/MediaPage/Videos";
68    // ---------------------------------------------------------------
69
70    // Functions -----------------------------------------------------
71    $scope.goToImages = function () {
72        util.goToPage("mediaImages");
73    };
74    $scope.goToCatalogs = function () {
75        util.goToPage("mediaCatalogs");
76    };
77    $scope.goToProducts = function () {
78        util.goToPage("mediaProducts");
79    };
80    $scope.trustSrc = function (src) {
81        return $sce.trustAsResourceUrl(src);
82    }
83    // ---------------------------------------------------------------
84
85    // On Ready ------------------------------------------------------
86    $scope.items = mediaService.getItems("videos");
87    // ---------------------------------------------------------------
88
89}]);
90
91angular.module('webSoDanca').controller('mediaCatalogsController', ['$scope', 'util', 'mediaService', 'dataService', function ($scope, util, mediaService, dataService) {
92
93    // Variables -----------------------------------------------------
94    $scope.url = util.getUrlDefault() + "/media/MediaPage/Catalogs";
95    // ---------------------------------------------------------------
96
97    // Functions -----------------------------------------------------
98    $scope.goToVideos = function () {
99        util.goToPage("mediaVideos");
100    };
101    $scope.goToImages = function () {
102        util.goToPage("mediaImages");
103    };
104    $scope.goToProducts = function () {
105        util.goToPage("mediaProducts");
106    };
107
108    $scope.catalogs = function () {
109        util.loading(true);
110        dataService.get("catalogs", { "B2B_active": true }).then(function (results) {
111
112            $scope.items = [];
113
114            var items = [];
115
116            for (i = 0; i < results.length; i++) {
117                if (results[i] && results[i]["B2B_active"] && results[i]["thumbnail"] && results[i]["pdf_file"]) items.push(results[i]);
118            }
119
120            $scope.items = items;
121
122            util.loading(false);
123
124        }).catch(function (err) {
125            util.loading(false);
126            util.throwError("204", true, false);
127            util.goBackPage();
128        });
129    };
130    // ---------------------------------------------------------------
131
132    // On Ready ------------------------------------------------------
133    //$scope.items = mediaService.getItems("catalogs");
134
135    $scope.catalogs();
136    // ---------------------------------------------------------------
137
138}]);
139//===========================================================================================================

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.