From 17c2f1819317e19ea0f18fa1c3e4252d2967ea48 Mon Sep 17 00:00:00 2001 From: Alexandre Tuleu Date: Wed, 24 Feb 2016 12:28:24 +0100 Subject: [PATCH] Cleans the javascript --- .jshintrc | 2 +- webapp/js/components/album/album.js | 4 ++-- webapp/js/controllers.js | 6 +++--- webapp/js/satbd.satellite.bar.js | 4 ++-- webapp/js/services.js | 12 ++++++------ webapp/js/views/authors/authors.js | 7 ++++--- webapp/js/views/recents/recents.js | 11 ++++++----- webapp/js/views/search/search.js | 14 ++++++++------ webapp/js/views/series/series.js | 4 ++-- 9 files changed, 34 insertions(+), 30 deletions(-) diff --git a/.jshintrc b/.jshintrc index 10a002b..9ecb16a 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,3 +1,3 @@ { - "varstmt" : true + "varstmt" : false } \ No newline at end of file diff --git a/webapp/js/components/album/album.js b/webapp/js/components/album/album.js index 036c682..f680634 100644 --- a/webapp/js/components/album/album.js +++ b/webapp/js/components/album/album.js @@ -38,7 +38,7 @@ album.component('album', { id: '= $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]); } - } - + }; }); diff --git a/webapp/js/views/search/search.js b/webapp/js/views/search/search.js index 91eda58..59c40c9 100644 --- a/webapp/js/views/search/search.js +++ b/webapp/js/views/search/search.js @@ -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; - } + }; }); diff --git a/webapp/js/views/series/series.js b/webapp/js/views/series/series.js index 6682a77..b911e2c 100644 --- a/webapp/js/views/series/series.js +++ b/webapp/js/views/series/series.js @@ -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' });