PageSourceSearch

https://social.brussels/app/common/myselection/myselection.service.js

js social.brussels collected 2026-10-02 15:39:48 UTC 2,182 bytes, 54 lines download raw bytes

1'use strict';
2
3(function(angular) {
4    angular.module('BruSo.common').factory('MySelection', [ '$http', '$resource', function($http, $resource) {
5        var apiPath = 'rest/myselection';
6
7        var resources = $resource(apiPath, {}, {
8        	getMySelection: {
9                method: 'GET',
10                url: apiPath + '/getMySelection',
11                cache: false,
12                isObject: true,
13            }
14        });
15
16        return {
17            createQuerySelection : createQuerySelection,
18            deleteSelection : deleteSelection,
19            updateSelection : updateSelection,
20            getMySelection : function(filters) {
21                return resources.getMySelection().$promise;
22            },
23        };
24
25        function createQuerySelection(title, description, filters){
26        	 var urlEncodedContent = 'title=' + encodeURIComponent(title) + '&description=' + encodeURIComponent(description) + '&filters=' + encodeURIComponent(angular.toJson(filters, false));
27             return $http.post(apiPath + "/createQuerySelection", urlEncodedContent, {
28                 headers : {
29                     'Content-Type' : 'application/x-www-form-urlencoded; charset=utf-8',
30                     'Accept' : 'application/json'
31                 }
32             });
33        }
34
35        function deleteSelection(selectionId){
36        	var urlEncodedContent = 'selectionId=' + selectionId;
37            return $http.post(apiPath + "/deleteSelection", urlEncodedContent, {
38                headers : {
39                    'Content-Type' : 'application/x-www-form-urlencoded',
40                }
41            });
42        }
43
44        function updateSelection(selectionId, title, description){
45        	var urlEncodedContent = 'title=' + encodeURIComponent(title) + '&description=' + encodeURIComponent(description) + '&selectionId=' + selectionId;
46            return $http.post(apiPath + "/updateSelection", urlEncodedContent, {
47                headers : {
48                    'Content-Type' : 'application/x-www-form-urlencoded; charset=utf-8',
49                }
50            });
51        }
52
53    } ])
54})(angular);

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.