Starting to add Timeline notifications.

This commit is contained in:
Gunther Brunner
2014-05-12 17:47:19 +09:00
parent 7f94b0beef
commit e4e5109533
14 changed files with 253 additions and 37 deletions

View File

@@ -0,0 +1,41 @@
module.exports = function TimelineServiceFactory() {
var TimelineService = {}
TimelineService.lines = []
function addLine(line, type) {
TimelineService.lines.push({
type: type,
title: line.title,
message: line.message,
serial: angular.copy(line.serial),
time: Date.now()
})
}
TimelineService.info = function (line) {
addLine(line, 'info')
}
TimelineService.warn = function (line) {
addLine(line, 'warn')
}
TimelineService.success = function (line) {
addLine(line, 'success')
}
TimelineService.error = function (line) {
addLine(line, 'error')
}
TimelineService.fatal = function (line) {
addLine(line, 'fatal')
}
TimelineService.clear = function () {
TimelineService.lines = []
}
return TimelineService
}