mirror of
https://github.com/lxsang/antos-frontend.git
synced 2024-11-14 00:38:22 +01:00
42 lines
1014 B
CoffeeScript
42 lines
1014 B
CoffeeScript
MAIL = this.OS.courrier
|
|
_API = this.OS.API
|
|
class BaseService extends this.OS.GUI.BaseModel
|
|
constructor: (name) ->
|
|
super name
|
|
@icon = undefined
|
|
@iconclass = "fa-paper-plane-o"
|
|
@text = ""
|
|
@timer = undefined
|
|
@holder = undefined
|
|
|
|
init: ()->
|
|
#implement by user
|
|
# event registe, etc
|
|
# scheme loader
|
|
|
|
attach: (h) ->
|
|
@holder = h
|
|
|
|
update: () -> @holder.update() if @holder
|
|
|
|
watch: ( t, f) ->
|
|
me = @
|
|
func = () ->
|
|
f()
|
|
me.timer = setTimeout (() -> func()), t
|
|
func()
|
|
onexit: (evt) ->
|
|
console.log "clean timer" if @timer
|
|
clearTimeout @timer if @timer
|
|
@cleanup(evt)
|
|
($ @scheme).remove() if @scheme
|
|
|
|
main: () ->
|
|
show: () ->
|
|
awake: (e) ->
|
|
#implement by user to tart the service
|
|
cleanup: (evt) ->
|
|
#implemeted by user
|
|
BaseService.type = 2
|
|
BaseService.singleton = true
|
|
this.OS.GUI.BaseService = BaseService |