frontend: use a common JS file to contain common features between challenger and public interface

This commit is contained in:
nemunaire 2017-01-14 14:57:39 +01:00 committed by nemunaire
commit 76effdd1fd
5 changed files with 74 additions and 75 deletions

View file

@ -10,31 +10,6 @@ String.prototype.capitalize = function() {
}
angular.module("FICApp")
.filter("capitalize", function() {
return function(input) {
return input.capitalize();
}
})
.filter("since", function() {
return function(passed) {
if (passed < 120000) {
return "Il y a " + Math.floor(passed/1000) + " secondes";
} else {
return "Il y a " + Math.floor(passed/60000) + " minutes";
}
}
})
.filter("time", function() {
return function(input) {
if (input == undefined) {
return "--";
} else if (input >= 10) {
return input;
} else {
return "0" + input;
}
}
})
.controller("TimeController", function($scope, $rootScope, $http, $timeout) {
$scope.time = {};
var initTime = function() {