PageSourceSearch

https://navsahyadri.edu.in/web-assets/angular/angularjs/controller…rting-docs-controller.js?version=1760363786

js navsahyadri.edu.in collected 2026-09-30 10:36:09 UTC 5,645 bytes, 135 lines download raw bytes

1var csrfloginHash = $('#csrfloginHash').val();
2
3
4app.controller('nirfSupportingDocsController', function ($scope, $http, toastr, $location) {
5    $scope.nirfSupportDocsInit = () => {
6        $scope.parameters = $location;
7        $scope.url = $scope.parameters.absUrl();
8        $scope.departmentDeptSectNameUrl = $scope.url.split("/");
9        $scope.supportingDocYear = $scope.departmentDeptSectNameUrl[$scope.departmentDeptSectNameUrl.length - 1];
10        console.log('$scope.supportingDocYear', $scope.supportingDocYear);
11
12        $scope.base_url = window.base_url;
13        $scope.aqarSupportingDocs = [];
14        $scope.selectedCriteria = 1;
15        $scope.getAllNaacArr();
16        $scope.allCriteriaAndKeyIndicator = [];
17        $scope.filteredPdfArray = [];
18        $scope.getAllSupportingDocsOfPerticularYear();
19    }
20    $scope.getAllNaacArr = () => {
21        $http
22            .get(window.site_url + "FrontEndAPI/GetArr", {
23                headers: {
24                    "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
25                },
26            })
27            .then(function (response) {
28                $scope.allCriteriaAndKeyIndicator = response.data.allNirfCriteria;
29                $scope.allMetricArray = response.data.metricCountByKeyNIRFIndicator;
30            });
31    }
32
33
34    $scope.getAllSupportingDocsOfPerticularYear = () => {
35        var transform = function (data) {
36            return $.param(data);
37        }
38
39        let aqar_year = localStorage.getItem("aqar_year")
40
41        $http.post(window.site_url + 'FrontEndAPI/getNIRFNaacSupportingDocument', {
42            supportingDocYear: $scope.supportingDocYear,
43            // supportingDocYear: aqar_year,
44        }, {
45            headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' },
46            transformRequest: transform
47        }).then((response) => {
48            if (response.data.status.status == 200) {
49                $scope.aqarSupportingDocs = response.data.data;
50                $scope.filterPdfsAccordingToKeyIndicators();
51            }
52        })
53    }
54
55    $scope.changeSelectedCriteria = (criteriaId) => {
56        $scope.selectedCriteria = criteriaId;
57        $scope.filterPdfsAccordingToKeyIndicators();
58    }
59    $scope.filterPdfsAccordingToKeyIndicators = () => {
60        let criteriaFilter = $scope.aqarSupportingDocs.filter(pdf => pdf.ndi_criteria == $scope.selectedCriteria);
61        $scope.filteredPdfArray = [];
62        for (let i = 0; i < $scope.allCriteriaAndKeyIndicator.find(criteria => criteria.criteriaId == $scope.selectedCriteria).keyIndicators.length; i++) {
63            let keyIndicatorFilter = criteriaFilter.filter(pdf => pdf.ndi_key_indicator == i + 1);
64            let metricWisePdf = []
65            for (let j = 0; j <= $scope.allMetricArray[$scope.selectedCriteria - 1][i].metricCount; j++) {
66                let metricFilter = keyIndicatorFilter.filter(pdf => pdf.ndi_metric == j);
67                metricWisePdf.push(metricFilter);
68            }
69            $scope.filteredPdfArray.push(metricWisePdf);
70        }
71    }
72
73    // $scope.filterPdfsAccordingToKeyIndicators = () => {
74    //     if (!$scope.aqarSupportingDocs || !$scope.allCriteriaAndKeyIndicator) return;
75
76    //     // Filter PDFs for the selected criteria
77    //     let criteriaFilter = $scope.aqarSupportingDocs.filter(
78    //         (pdf) => parseInt(pdf.ndi_criteria) === parseInt($scope.selectedCriteria)
79    //     );
80
81    //     $scope.filteredPdfArray = [];
82
83    //     let selectedCriteriaObj = $scope.allCriteriaAndKeyIndicator.find(
84    //         (criteria) => parseInt(criteria.criteriaId) === parseInt($scope.selectedCriteria)
85    //     );
86
87    //     if (!selectedCriteriaObj) return;
88
89    //     for (let i = 0; i < selectedCriteriaObj.keyIndicators.length; i++) {
90    //         let keyIndicatorId = selectedCriteriaObj.keyIndicators[i].keyIndicatorId;
91
92    //         // PDFs directly under Key Indicator (metric = 0)
93    //         let keyIndicatorDocs = criteriaFilter.filter(
94    //             (pdf) => parseInt(pdf.ndi_key_indicator) === parseInt(keyIndicatorId) && parseInt(pdf.ndi_metric) === 0
95    //         );
96
97    //         // PDFs grouped by metrics (> 0)
98    //         let metricDocs = {};
99    //         let metricsArrayForCriteria = ($scope.allMetricArray[selectedCriteriaObj.criteriaId - 1] || [])[i] || {};
100    //         let metrics = metricsArrayForCriteria.metricDescription || [];
101
102    //         metrics.forEach((metric, idx) => {
103    //             metricDocs[idx + 1] = criteriaFilter.filter(
104    //                 (pdf) => parseInt(pdf.ndi_key_indicator) === parseInt(keyIndicatorId) && parseInt(pdf.ndi_metric) === idx + 1
105    //             );
106    //         });
107
108    //         // Store in filteredPdfArray
109    //         $scope.filteredPdfArray[i] = [keyIndicatorDocs, metricDocs];
110    //     }
111
112    //     // Debug: see the filtered array
113    //     console.log('$scope.filteredPdfArray', $scope.filteredPdfArray);
114    // };
115
116
117    $scope.copyTextToClipboard = (text) => {
118        const textarea = document.createElement('textarea');
119        textarea.value = text;
120        document.body.appendChild(textarea);
121        textarea.select();
122        document.execCommand('copy');
123        document.body.removeChild(textarea);
124    };
125
126    $scope.copyLinkToClipboard = (link) => {
127        $scope.copyTextToClipboard(link);
128        $("#copyLinkToClipboard").attr("title", "Copied");
129        toastr.success("Weblink copied successfully");
130        setTimeout(function () {
131            $("#copyLinkToClipboard").attr("title", "Copy Weblink");
132        }, 2000);
133    };
134
135});

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.