PageSourceSearch

https://kit.ac.in/web-assets/angular/angularjs/controllers/dept-faculty.js?version=1782474997

js kit.ac.in collected 2026-09-30 10:02:14 UTC 3,532 bytes, 90 lines download raw bytes

1app.controller('DeptFacultyServicesCtrl', function ($scope, $http, toastr, $location) {
2
3    $scope.DeptFacultyListInit = function () {
4        $scope.base_url = base_url;
5        $scope.facultyListArray = [];
6        $scope.nonTeachingFacultyListArray = [];
7        $scope.getAllnewsCategory();
8        $scope.getCategory = [];
9        $scope.TeachingFacultyListArray = [];
10        $scope.dataArray = [];
11        $scope.facultyDeptListArray = [];
12
13        // Extract department ID from URL if available
14        const urlParams = new URLSearchParams($location.absUrl().split('?')[1]);
15        $scope.category = urlParams.get('deptId'); // Store the department ID in $scope.category if present
16
17        $scope.getFaculty();
18    }
19
20    // Get all Departments List Service
21    $scope.getFaculty = function () {
22        var transform = function (data) {
23            return $.param(data);
24        }
25
26        $http.post(window.site_url + 'FrontEndAPI/getFacultyDepartmentWise', {
27            inputSearchValue: $scope.inputSearchValue,
28            selectedDepartment: $scope.category // Use the selected department (tu_dsl_id) here
29        }, {
30            headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' },
31            transformRequest: transform
32        }).then(function (response) {
33            if (response.data.status.status == "200") {
34                $scope.facultyListArray = response.data.data;
35                console.log('$scope.facultyListArray', $scope.facultyListArray);
36
37                // Initialize displayedGallery with the filtered data
38                $scope.displayedGallery = $scope.facultyListArray;
39                if ($scope.category) {
40                    $scope.changeHomeNewCategory();
41                }
42            } else {
43                toastr.error(response.data.status.message);
44            }
45        });
46    }
47
48    $scope.changeHomeNewCategory = function () {
49        if (!$scope.category) {
50            // If no department is selected, show the entire facultyListArray
51            $scope.displayedGallery = $scope.facultyListArray;
52        } else {
53            // Filter the gallery based on the selected department ID
54            $scope.filteredGallery = $scope.facultyListArray.filter(function (gallery) {
55                return gallery.tu_dsl_id == $scope.category;
56            });
57
58            console.log('Selected Category ID:', $scope.category);
59            console.log('Filtered Gallery:', $scope.filteredGallery);
60
61            // Update the displayed gallery with the filtered data
62            $scope.displayedGallery = $scope.filteredGallery;
63        }
64    };
65
66    $scope.getSectionsWithContent = (faculty) => {
67        localStorage.setItem("facultyDetails", JSON.stringify(faculty));
68        window.location.href = window.site_url + `faculty-details`;
69    }
70
71    $scope.getAllnewsCategory = function () {
72        var transform = function (data) {
73            return $.param(data);
74        };
75        $http.post(window.site_url + "FrontEndAPI/deptGalleryName", {
76            inputSearchValue: $scope.inputSearchValue,
77        }, {
78            headers: {
79                "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
80            },
81            transformRequest: transform,
82        }).then(function (response) {
83            if (response.data.status.status == "201") {
84                $scope.getCategory = response.data.data;
85            } else {
86                toastr.error(response.data.status.message);
87            }
88        });
89    };
90});

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.