Cleans the javascript

This commit is contained in:
2016-02-24 12:28:24 +01:00
parent e6e1f6d6b3
commit 17c2f18193
9 changed files with 34 additions and 30 deletions

View File

@@ -1,9 +1,10 @@
'use strict';
angular.module('satbd.satellite.bar.views.authors',[
'ngRoute'
]).config(function($routeProvider) {
'use strict';
$routeProvider.when('/authors', {
templateUrl: 'js/views/authors/authors.html',
});
})
});

View File

@@ -1,15 +1,17 @@
'use strict';
angular.module('satbd.satellite.bar.views.recents',[
'ngRoute',
'satbd.satellite.bar.components.album',
'angular-inview'
]).config(function($routeProvider) {
'use strict';
$routeProvider.when('/recents', {
templateUrl: 'js/views/recents/recents.html',
controller: 'RecentsCtrl'
});
}).controller('RecentsCtrl', function( $scope, $http, $log) {
'use strict';
$scope.albumIDs = [];
$scope.allAlbums = [];
$scope.scrollMore = false;
@@ -29,13 +31,12 @@ angular.module('satbd.satellite.bar.views.recents',[
$log.info('Loading more components');
if (!$scope.scrollMore || $scope.albumIDs.length >= $scope.allAlbums.length) {
$scope.scrollMore = false;
$log.info('reached the end of albums')
$log.info('reached the end of albums');
return;
}
var newSize = Math.min($scope.albumIDs.length + batchSize, $scope.allAlbums.length);
for( var i = $scope.albumIDs.length; i < newSize; i++) {
$scope.albumIDs.push($scope.allAlbums[i]);
}
}
};
});

View File

@@ -1,5 +1,3 @@
'use strict';
angular.module('satbd.satellite.bar.views.search',[
'ngRoute',
'ngSanitize',
@@ -7,11 +5,15 @@ angular.module('satbd.satellite.bar.views.search',[
'satbd.satellite.bar.components.album',
'angular-inview'
]).config(function($routeProvider) {
'use strict';
$routeProvider.when('/search', {
templateUrl: 'js/views/search/search.html',
controller: 'SearchCtrl'
});
}).controller('SearchCtrl', function($scope,$routeParams,$log,$sce,albumService) {
'use strict';
$scope.terms=$routeParams.q;
$scope.scrollMore = false;
$scope.allHits = [];
@@ -43,14 +45,14 @@ angular.module('satbd.satellite.bar.views.search',[
};
$scope.inSecond= function(bleveValue) {
return bleveValue / 1e9;
}
return bleveValue / 1e6;
};
$scope.trustedFragment = function(f) {
return $sce.trustAsHtml(f);
}
};
$scope.round4Dec = function(value) {
return Math.round(value * 10000) / 10000;
}
};
});

View File

@@ -1,9 +1,9 @@
'use strict';
angular.module('satbd.satellite.bar.views.series',[
'ngRoute',
'satbd.satellite.bar.directives.responsive-ratio'
]).config(function($routeProvider) {
'use strict';
$routeProvider.when('/series', {
templateUrl: 'js/views/series/series.html'
});