added objectid timestamp to the user interface

the logic is done on the client.
This commit is contained in:
didier amyot committed 2015-04-10 08:16:46 -07:00
1 parent 100b7e1839
commit 41552040cc
4 files changed
+47 -13

No files matched your search

+11 -3
View File
@@ -1,14 +1,22 @@
root = this
root.services.factory('util', ['$http', '$rootScope', ($http, $rootScope)->
service =
service =
get: (params...) ->
$rootScope.$broadcast("loading")
return $http.get(params...).
finally( () ->
$rootScope.$broadcast("loadingFinished")
)
parseObjectId: (objectIdAsString) ->
if objectIdAsString.length != 24
throw new Error("object id string must be of length 24")
ret =
date: new Date(parseInt(objectIdAsString.substr(0, 8), 16) * 1000)
machine: parseInt(objectIdAsString.substr(8, 14), 16)
process: parseInt(objectIdAsString.substr(14, 18), 16)
counter: parseInt(objectIdAsString.substr(18, 24), 16)
return service
]);
]);