antosdk-apps/About/coffees/main.coffee

22 lines
675 B
CoffeeScript
Raw Normal View History

2018-04-14 17:52:19 +02:00
class About extends this.OS.GUI.BaseApplication
constructor: ( args ) ->
super "About", args
main: () ->
me = @
@container = @find "container"
path = "os://README.md"
path.asFileHandle()
.read()
.then (txt) ->
converter = new showdown.Converter()
($ me.container).html converter.makeHtml txt
.catch () =>
@notify __("Unable to read: {0}", path)
@find("btnclose").set "onbtclick", () =>
@quit()
2018-04-14 17:52:19 +02:00
About.singleton = true
About.dependencies = [ "os://scripts/showdown.min.js" ]
2018-04-14 17:52:19 +02:00
this.OS.register "About", About