frontend: use a common JS file to contain common features between challenger and public interface
This commit is contained in:
parent
8bef64ad6b
commit
76effdd1fd
5 changed files with 74 additions and 75 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Reference in a new issue