diff --git a/vipra-ui/app/index.html b/vipra-ui/app/index.html index a9aa98dfc149016475c2610748884a05ac9f2d71..ccdc2a362191c54096fbbe81b566f6e277b9bad7 100644 --- a/vipra-ui/app/index.html +++ b/vipra-ui/app/index.html @@ -31,6 +31,10 @@ <script src="js/vendor.js"></script> <script src="js/app.js"></script> <script src="js/templates.js"></script> + <script> + 'use strict'; + window.Vipra.config.restUrl = '//' + location.hostname + ':8000/vipra/rest'; + </script> </head> <body> @@ -46,10 +50,10 @@ </button> <a ui-sref="index" class="navbar-brand"> <svg class="logo hover" viewBox="0 0 200 120" ng-class="{animate:loading.any}"> - <polyline style="animation-delay:0s" class="logo-shape" points="0,0 100,45 100,75 0,0" fill="#006591"/> - <polyline style="animation-delay:.5s" class="logo-shape" points="100,45 200,0 100,75 100,45" fill="#0079a2"/> - <polyline style="animation-delay:1s" class="logo-shape" points="100,75 200,0 100,120 100,75" fill="#006591"/> - <polyline style="animation-delay:1.5s" class="logo-shape" points="0,0 100,75 100,120 0,0" fill="#0079a2"/> + <polyline style="animation-delay:0s" class="logo-shape" points="0,0 100,45 100,75 0,0" fill="#006591" /> + <polyline style="animation-delay:.5s" class="logo-shape" points="100,45 200,0 100,75 100,45" fill="#0079a2" /> + <polyline style="animation-delay:1s" class="logo-shape" points="100,75 200,0 100,120 100,75" fill="#006591" /> + <polyline style="animation-delay:1.5s" class="logo-shape" points="0,0 100,75 100,120 0,0" fill="#0079a2" /> </svg> </a> </div> diff --git a/vipra-ui/app/js/app.js b/vipra-ui/app/js/app.js index 6eb5c2612d75fbd184bb0e37642277f0d4e993ef..35b6b0e1b9428b47315a3fc535caaf5cf3871108 100644 --- a/vipra-ui/app/js/app.js +++ b/vipra-ui/app/js/app.js @@ -3,7 +3,7 @@ * Main application file ******************************************************************************/ /* globals angular */ -(function () { +(function() { "use strict"; @@ -19,7 +19,7 @@ 'vipra.templates' ]); - app.config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) { + app.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise('/'); @@ -85,38 +85,38 @@ }]); - app.config(['$httpProvider', function ($httpProvider) { + app.config(['$httpProvider', function($httpProvider) { - $httpProvider.interceptors.push(function ($q, $injector, $rootScope) { - var requestIncrement = function (config) { + $httpProvider.interceptors.push(function($q, $injector, $rootScope) { + var requestIncrement = function(config) { $rootScope.loading.requests = ++$rootScope.loading.requests || 1; $rootScope.loading[config.method] = ++$rootScope.loading[config.method] || 1; $rootScope.loading.any = true; }; - var requestDecrement = function (config) { + var requestDecrement = function(config) { $rootScope.loading.requests = Math.max(--$rootScope.loading.requests, 0); $rootScope.loading[config.method] = Math.max(--$rootScope.loading[config.method], 0); $rootScope.loading.any = $rootScope.loading.requests > 0; }; return { - request: function (config) { + request: function(config) { requestIncrement(config); return config; }, - requestError: function (rejection) { + requestError: function(rejection) { requestDecrement(rejection.config); return $q.reject(rejection); }, - response: function (response) { + response: function(response) { requestDecrement(response.config); return response; }, - responseError: function (rejection) { + responseError: function(rejection) { requestDecrement(rejection.config); return $q.reject(rejection); } @@ -125,7 +125,7 @@ }]); - app.run(['$rootScope', function ($rootScope) { + app.run(['$rootScope', function($rootScope) { $rootScope.loading = {}; diff --git a/vipra-ui/app/js/config.js b/vipra-ui/app/js/config.js index 92cbc66abd00f4f4e449251ed23d2645b53cf6da..8ca1c7df078487fb0ba4e8580502e7eb0ad38e59 100644 --- a/vipra-ui/app/js/config.js +++ b/vipra-ui/app/js/config.js @@ -10,11 +10,7 @@ window.Vipra = window.Vipra || {}; Vipra.config = { - restUrl: '//' + location.hostname + ':8000/vipra/rest', - websocketUrl: 'ws://' + location.hostname + ':8000/vipra/ws', - latestItems: 3, - searchResults: 10, - pageSize: 100 + restUrl: '/vipra/rest' }; })(); diff --git a/vipra-ui/app/js/controllers.js b/vipra-ui/app/js/controllers.js index c434d3622062edae6eaaa934209f1aa009f76860..2ec72ad8c847726e64f67744911a02c0cc746662 100644 --- a/vipra-ui/app/js/controllers.js +++ b/vipra-ui/app/js/controllers.js @@ -25,7 +25,7 @@ $scope.search = $location.search().query; ArticleFactory.query({ - limit: Vipra.config.latestItems, + limit: 3, sort: '-created' }, function(data) { $scope.latestArticles = data; @@ -34,7 +34,7 @@ }); TopicFactory.query({ - limit: Vipra.config.latestItems, + limit: 3, sort: '-created' }, function(data) { $scope.latestTopics = data; @@ -47,7 +47,7 @@ $location.search('query', $scope.search); $scope.searching = true; SearchFactory.query({ - limit: Vipra.config.searchResults, + limit: 10, query: $scope.search }, function(data) { $scope.searching = false; @@ -431,7 +431,7 @@ }; $scope.page = Math.max($location.search().page || 1, 1); - $scope.limit = Vipra.config.pageSize; + $scope.limit = 100; $scope.$watchGroup(['page', 'opts.sort', 'opts.order'], function() { ArticleFactory.query({ @@ -530,7 +530,7 @@ }; $scope.page = Math.max($location.search().page || 1, 1); - $scope.limit = Vipra.config.pageSize; + $scope.limit = 100; $scope.$watchGroup(['page', 'opts.sort', 'opts.order'], function() { TopicFactory.query({ @@ -629,7 +629,7 @@ }; $scope.page = Math.max($location.search().page || 1, 1); - $scope.limit = Vipra.config.pageSize; + $scope.limit = 100; $scope.$watchGroup(['page', 'opts.sort', 'opts.order'], function() { TopicFactory.articles({ diff --git a/vipra-ui/app/js/helpers.js b/vipra-ui/app/js/helpers.js index b78028fc74a550dea22afc38a8b6f552fa2488f3..7be66f275add61a4d6d5f4eb1ea955f6cfd3cef9 100644 --- a/vipra-ui/app/js/helpers.js +++ b/vipra-ui/app/js/helpers.js @@ -2,15 +2,13 @@ * Vipra Application * Helpers & Polyfills ******************************************************************************/ -/* globals Vipra, $ */ +/* globals Vipra */ (function() { "use strict"; window.Vipra = window.Vipra || {}; - Vipra.momo = 'hi'; - /** * Helpers */