frontend: new parameters to setup kind of notifications allowed

This commit is contained in:
nemunaire 2019-01-19 08:04:54 +01:00
commit ef35879dde
4 changed files with 141 additions and 15 deletions

View file

@ -40,7 +40,7 @@ angular.module("FICApp", ["ngSanitize", "ngAnimate"])
refreshEvents()
$interval(refreshEvents, 2100);
})
.controller("TimerController", function($scope, $rootScope, $interval) {
.controller("TimerController", function($scope, $rootScope, $interval, $timeout) {
$scope.duration = 0;
$scope.init = function(end) {
@ -53,9 +53,12 @@ angular.module("FICApp", ["ngSanitize", "ngAnimate"])
})
}
$scope.initT = function(end) {
var time = angular.fromJson(sessionStorage.userService);
var srv_cur = new Date(Date.now() + (time.cu - time.he));
$scope.duration = Math.floor((end - srv_cur)/1000);
var time = angular.fromJson(sessionStorage.time);
if (time) {
var srv_cur = new Date(Date.now() + (time.cu - time.he));
$scope.duration = Math.floor((end - srv_cur)/1000);
} else
$timeout(function() { $scope.initT(end); }, 1000);
}
var stop = $interval(function() {