app launcher

This commit is contained in:
Xuan Sang LE
2018-01-26 18:57:28 +01:00
parent ec09e07eb7
commit 91a0d0a6b6
17 changed files with 416 additions and 49 deletions

View File

@ -27,11 +27,12 @@ class PushNotification extends this.OS.GUI.BaseService
@nzone = @find "notifyzone"
@fzone = @find "feedzone"
(@find "btclear").set "onbtclick", (e) -> me.mlist.set "items", []
#mlist.set "onlistselect", (e) -> console.log e
@subscribe "fail", (e) -> console.log e
@subscribe "notification", (o) -> me.pushout 'INFO', o
@subscribe "fail", (o) -> me.pushout 'FAIL', o
@subscribe "error", (o) -> me.pushout 'ERROR', o
@subscribe "info", (o) -> me.pushout 'INFO', o
@subscribe "loading", (o) ->
me.pending.push o.id
me.spin true
@ -59,6 +60,8 @@ class PushNotification extends this.OS.GUI.BaseService
icon: o.data.icon,
iconclass: o.data.iconclass,
closable: true }
console.log o.data.s
console.log o.data.e
@mlist.unshift d, true
@notifeed d

View File

@ -8,7 +8,7 @@ class Files extends this.OS.GUI.BaseApplication
@view = @find "fileview"
@navinput = @find "navinput"
@navbar = @find "nav-bar"
@currdir = undefined
@currdir = if @args and @args.length > 0 then @args[0].asFileHandler() else "home:///".asFileHandler()
@favo = @find "favouri"
@clipboard = undefined
@ -17,7 +17,9 @@ class Files extends this.OS.GUI.BaseApplication
m.show(e)
#@on "fileselect", (d) -> console.log d
@on "filedbclick", (e) ->
#if e.data.type is 'dir' then me.chdir e.data.path, true
return unless e.data
return if e.data.type is "dir"
me._gui.openWith e.data
@favo.set "onlistselect", (e) -> me.chdir e.data.path
($ @find "btback").click () ->
@ -38,15 +40,17 @@ class Files extends this.OS.GUI.BaseApplication
@setting.favorite = [
{ text: "Applications", path: 'app:///', iconclass: "fa fa-adn" },
{ text: "Home", path: 'home:///', iconclass: "fa fa-home", selected: true },
{ text: "Home", path: 'home:///', iconclass: "fa fa-home" },
{ text: "OS", path: 'os:///', iconclass: "fa fa-inbox" },
{ text: "Desktop", path: 'home:///.desktop', iconclass: "fa fa-desktop" },
] if not @setting.favorite
@setting.sidebar = true if @setting.sidebar is undefined
@setting.nav = true if @setting.nav is undefined
@setting.showhidden = false if @setting.showhidden is undefined
@favo.set "items", @setting.favorite
@favo.set "items", $.extend true, {}, @setting.favorite
@applySetting()
@chdir null
applySetting: (k) ->
# view setting

View File

@ -9,5 +9,5 @@
"version":"0.1a",
"category":"System",
"iconclass":"fa fa-hdd-o",
"mimes":["*"]
"mimes":["dir"]
}

View File

@ -1,5 +1,5 @@
class NotePad extends this.OS.GUI.BaseApplication
constructor: (args) ->
constructor: ( args ) ->
super "NotePad", args
main: () ->
me = @
@ -9,6 +9,7 @@ class NotePad extends this.OS.GUI.BaseApplication
@fileview = @find "fileview"
div = @find "datarea"
ace.require "ace/ext/language_tools"
@currfile = if @args and @args.length > 0 then @args[0].asFileHandler() else undefined
@.editor = ace.edit div
@.editor.setOptions {
enableBasicAutocompletion: true,
@ -16,7 +17,7 @@ class NotePad extends this.OS.GUI.BaseApplication
enableLiveAutocompletion: true,
fontSize: "9pt"
}
@.editor.completers.push {getCompletions:(editor, session, pos, prefix, callback)->}
@.editor.completers.push { getCompletions: ( editor, session, pos, prefix, callback ) -> }
@.editor.getSession().setUseWrapMode true
list = @find "modelist"
@ -64,11 +65,20 @@ class NotePad extends this.OS.GUI.BaseApplication
@location.set "onlistselect", (e) -> me.chdir e.data.path
@location.set "items", [
{ text: "Home", path: 'home:///', iconclass:"fa fa-home", selected:true},
{ text: "OS", path: 'os:///', iconclass:"fa fa-inbox" },
{ text: "Home", path: 'home:///', iconclass: "fa fa-home", selected: true },
{ text: "OS", path: 'os:///', iconclass: "fa fa-inbox" },
{ text: "Desktop", path: 'home:///.desktop', iconclass: "fa fa-desktop" },
]
@open @currfile if @currfile
open: (file) ->
me = @
file.read (d) ->
return unless d
me.scheme.set "apptitle", file.basename
me.editor.setValue d, -1
chdir: (p) ->
me = @
me._api.handler.scandir p,
@ -82,10 +92,10 @@ class NotePad extends this.OS.GUI.BaseApplication
menu: ()->
menu = [{
text:"File",
child:[
{text:"Open", dataid:"#{@name}-Open"},
{text:"Close", dataid:"#{@name}-Close"}
text: "File",
child: [
{ text: "Open", dataid: "#{@name}-Open" },
{ text: "Close", dataid: "#{@name}-Close" }
]
}]
menu

View File

@ -9,5 +9,5 @@
"version":"0.1a",
"category":"System",
"iconclass":"fa fa-pencil-square-o",
"mimes":["*"]
"mimes":[".*"]
}

View File

@ -64,6 +64,7 @@ class wTerm extends this.OS.GUI.BaseApplication
@socket.onmessage = (e) -> me.term.write e.data if me.term and e.data
@socket.onclose = () ->
me.socket = null
me.quit()
console.log "socket closed"
#el.style.display = "block"
cleanup: (e)->