1app.controller('searchCtrl', ['$scope', '$http', '$location', function ($scope, $http, $location) { 2 $scope.main = { 3 query: $location.search().s, 4 currentPage: 0, 5 offset: 0, 6 count: 6 7 }; 8 9 $scope.loadPage = function () { 10 $http.get('/Search/GetBingSearch', { params: { query: $scope.main.query, offset: $scope.main.offset, count: $scope.main.count } }).then(function (response) { 11 $scope.main.records = response.data.Items; 12 $scope.main.total = response.data.totalEstimatedMatches; 13 if (response.data.total == 0) { $('#tabNotices').hide(); } 14 if ($scope.department != "") { $('#tabNotices').hide(); } 15 }); 16 }; 17 18 $scope.loadMore = function () { 19 $scope.main.currentPage++; 20 $scope.main.offset = $scope.main.currentPage * $scope.main.count; 21 22 $http.get('/Search/GetBingSearch', { params: { query: $scope.main.query, offset: $scope.main.offset, count: $scope.main.count } }).then(function (response) { 23 // $scope.main.records = $scope.main.records.concat(data.Items); 24 angular.extend($scope.main.records, response.data.Items); 25 }); 26 }; 27 28 $scope.showButtonLoadMore = function () { 29 var currentPage = $scope.main.currentPage; 30 var pageCount = $scope.pageCount() - 1; 31 if (pageCount == -1) { pageCount = 0; } 32 return currentPage === pageCount; 33 }; 34 35 $scope.nextPageDisabledClass = function () { 36 return $scope.main.currentPage === $scope.pageCount() - 1 ? 'disabled' : ''; 37 }; 38 39 $scope.pageCount = function () { 40 return Math.ceil($scope.main.total / $scope.main.count); 41 }; 42}]);
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.