PageSourceSearch

https://www.kla.tv/js/app/services/api.js?v=2026092401

js kla.tv collected 2026-09-24 08:59:45 UTC 2,886 bytes, 112 lines download raw bytes

1
2ktvApp.filter('encodeURIComponent', function() {
3    return window.encodeURIComponent;
4});
5
6ktvApp.filter('rawurlencode', function() {
7    return function(link){
8        // If some strange undefined is as input given
9        link = (link + '')
10        return window.encodeURIComponent(link)
11        .replace(/!/g, '%21')
12        .replace(/'/g, '%27')
13        .replace(/\(/g, '%28')
14        .replace(/\)/g, '%29')
15        .replace(/\*/g, '%2A');
16    }
17});
18
19/*
20 * Service for call PHP Repository-Functions
21 */
22ktvApp.factory('api', function ($resource, $location) {
23
24//    var $api = $resource($location.absUrl());
25    var post_link = $location.absUrl();
26    var splitedLink = post_link.split('/'); var lastLinkElement = splitedLink[splitedLink.length-1]
27    if(lastLinkElement=='')
28    {
29        //When you ar on the page http://kla.tv/ ADD index.php (in other angular makes a strange request to the server that generate a header 301)
30        post_link+="index.php"
31    }
32    var $api = $resource(post_link);
33    
34    /**
35     * API Prototype
36     * @param {String} mode
37     */
38    var api = function(mode){
39        this.mode = mode;
40    };
41    
42    api.prototype = {
43        /**
44         * Controller compatiple Ajax-Requests
45         * @param {Object} data
46         * @returns {Object} promise
47         */        
48        request: function(data){
49           return $api.save({
50               mode: this.mode,
51               data: data
52           }).$promise;
53       }
54    };
55    
56    return {
57        getInstance: function(mode){
58            return new api(mode);
59        } 
60    };
61});
62
63ktvApp.factory('apiKlaTV', function ($resource) {
64
65    /**
66     * API Prototype
67     * @param {String} mode
68     */
69    var api = function(mode){
70        this.mode = mode;
71    };
72
73    api.prototype = {
74        /**
75         * Controller compatiple Ajax-Requests
76         * @returns {Object} promise
77         * @param url
78         * @param expectArray
79         */
80        request: function(url,expectArray){
81            
82            var $api = $resource(window.kla_tv_env.apiBaseUrl+url, {}, {
83                query: {
84                    method: 'GET',
85                    isArray: true,
86                    headers: {
87                        'Authorization': 'Bearer bc9TT4ssXbiLAR5N9tEDaNl91psHFZ7NbUC7P6E+1TQ=]'
88                    }
89                },
90                get: {
91                    method: 'GET',
92                    headers: {
93                        'Authorization': 'Bearer bc9TT4ssXbiLAR5N9tEDaNl91psHFZ7NbUC7P6E+1TQ=]'
94                    }
95                }
96            });
97
98            if(expectArray) {
99                return $api.query({},{}).$promise;
100            }
101            else {
102                return $api.get({},{}).$promise;
103            }
104        }
105    };
106
107    return {
108        getInstance: function(mode){
109            return new api(mode);
110        }
111    };
112});

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.