mirror of
https://github.com/lxsang/antos-frontend.git
synced 2025-07-27 03:09:45 +02:00
global settting
This commit is contained in:
@ -6,28 +6,6 @@ cssfiles = main.css
|
||||
|
||||
copyfiles = scheme.html package.json
|
||||
|
||||
PKG_NAME=ActivityMonitor
|
||||
|
||||
BLUE=\033[1;34m
|
||||
NC=\033[0m
|
||||
|
||||
main: title clean js css copy
|
||||
|
||||
title:
|
||||
@echo "$(BLUE)======= Package ActivityMonitor =======$(NC)"
|
||||
|
||||
coffee:
|
||||
- mkdir build
|
||||
for f in $(coffee_files); do (coffee -cs < $$f >build/"$$f.js");done
|
||||
for f in build/*.coffee.js; do (cat "$${f}"; echo) >> build/main.js; done
|
||||
- rm build/*.coffee.js
|
||||
|
||||
js: coffee
|
||||
for f in $(jsfiles); do (cat "$${f}"; echo) >> build/main.js; done
|
||||
|
||||
css:
|
||||
for f in $(cssfiles); do (cat "$${f}"; echo) >> build/main.css; done
|
||||
|
||||
copy:
|
||||
cp -rf $(copyfiles) build/
|
||||
clean:
|
||||
- rm -rf build/*
|
||||
include ../pkg.mk
|
23
src/packages/CoreServices/Calendar.coffee
Normal file
23
src/packages/CoreServices/Calendar.coffee
Normal file
@ -0,0 +1,23 @@
|
||||
class Calendar extends this.OS.GUI.BaseService
|
||||
constructor: (args) ->
|
||||
super "Calendar", args
|
||||
#@iconclass = "fa fa-commenting"
|
||||
@text = ""
|
||||
@iconclass = "fa fa-calendar"
|
||||
init: ->
|
||||
#update time each second
|
||||
me = @
|
||||
@watch 1000, () ->
|
||||
now = new Date
|
||||
me.text = "#{now.getDate()}/#{(now.getMonth()+1)}/#{now.getFullYear()} " +
|
||||
"#{now.getHours()}:#{now.getMinutes()}:#{now.getSeconds()}"
|
||||
me.update()
|
||||
|
||||
awake: (e) ->
|
||||
@.openDialog "CalendarDialog", (d) -> console.log d
|
||||
# do nothing
|
||||
cleanup: (evt) ->
|
||||
console.log "cleanup for quit"
|
||||
# do nothing
|
||||
|
||||
this.OS.register "Calendar",Calendar
|
11
src/packages/CoreServices/Makefile
Normal file
11
src/packages/CoreServices/Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
coffee_files = Calendar.coffee PushNotification.coffee Spotlight.coffee
|
||||
|
||||
jsfiles =
|
||||
|
||||
cssfiles =
|
||||
|
||||
copyfiles = package.json
|
||||
|
||||
|
||||
PKG_NAME=CoreServices
|
||||
include ../pkg.mk
|
93
src/packages/CoreServices/PushNotification.coffee
Normal file
93
src/packages/CoreServices/PushNotification.coffee
Normal file
@ -0,0 +1,93 @@
|
||||
class PushNotification extends this.OS.GUI.BaseService
|
||||
constructor: (args) ->
|
||||
super "PushNotification", args
|
||||
@iconclass = "fa fa-bars"
|
||||
@onmenuselect = (e) -> console.log e
|
||||
@cb = undefined
|
||||
@pending = []
|
||||
init: ->
|
||||
@view = false
|
||||
path = "resources/schemes/notifications.html"
|
||||
@render path
|
||||
|
||||
spin: (b) ->
|
||||
if b and @iconclass is "fa fa-bars"
|
||||
@iconclass = "fa fa-spinner fa-spin"
|
||||
@color = "#f90e00"
|
||||
@update()
|
||||
else if not b and @iconclass is "fa fa-spinner fa-spin"
|
||||
@iconclass = "fa fa-bars"
|
||||
@color = "#414339"
|
||||
@update()
|
||||
|
||||
main: ->
|
||||
me = @
|
||||
@mlist = @find "notifylist"
|
||||
@mfeed = @find "notifeed"
|
||||
@nzone = @find "notifyzone"
|
||||
@fzone = @find "feedzone"
|
||||
(@find "btclear").set "onbtclick", (e) -> me.mlist.set "items", []
|
||||
#mlist.set "onlistselect", (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 "loading", (o) ->
|
||||
me.pending.push o.id
|
||||
me.spin true
|
||||
|
||||
@subscribe "loaded", (o) ->
|
||||
i = me.pending.indexOf o.id
|
||||
me.pending.splice i, 1 if i >= 0
|
||||
me.spin false if me.pending.length is 0
|
||||
|
||||
($ @nzone).css "right", 0
|
||||
.css "top", "-3px"
|
||||
.css "height", ""
|
||||
.css "bottom", "0"
|
||||
.css "z-index", 1000000
|
||||
.hide()
|
||||
($ @fzone)
|
||||
#.css("z-index", 99999)
|
||||
.css("bottom", "0")
|
||||
.css("height", "")
|
||||
.hide()
|
||||
|
||||
pushout: (s, o, mfeed) ->
|
||||
d = {
|
||||
text: "[#{s}] #{o.name} (#{o.id}): #{o.data.m}",
|
||||
icon: o.data.icon,
|
||||
iconclass: o.data.iconclass,
|
||||
closable: true }
|
||||
@mlist.unshift d, true
|
||||
@notifeed d
|
||||
|
||||
notifeed: (d) ->
|
||||
me = @
|
||||
@mfeed.unshift d, true
|
||||
($ @fzone).show()
|
||||
timer = setTimeout () ->
|
||||
me.mfeed.remove d, true
|
||||
clearTimeout timer
|
||||
, 3000
|
||||
|
||||
awake: (e) ->
|
||||
if @view then ($ @nzone).hide() else ($ @nzone).show()
|
||||
@view = not @view
|
||||
me = @
|
||||
if not @cb
|
||||
@cb = (e) ->
|
||||
return if e.originalEvent.item and e.originalEvent.item.i isnt undefined
|
||||
if not ($ e.target).closest($ me.nzone).length and not ($ e.target).closest($ me.holder.root).length
|
||||
($ me.nzone).hide()
|
||||
$(document).unbind "click", me.cb
|
||||
me.view = not me.view
|
||||
if @view
|
||||
$(document).on "click", @cb
|
||||
else
|
||||
$(document).unbind "click", @cb
|
||||
|
||||
cleanup: (evt) ->
|
||||
# do nothing
|
||||
|
||||
this.OS.register "PushNotification",PushNotification
|
20
src/packages/CoreServices/Spotlight.coffee
Normal file
20
src/packages/CoreServices/Spotlight.coffee
Normal file
@ -0,0 +1,20 @@
|
||||
class Spotlight extends this.OS.GUI.BaseService
|
||||
constructor: (args) ->
|
||||
super "Spotlight", args
|
||||
@iconclass = "fa fa-search"
|
||||
init: ->
|
||||
@child = [
|
||||
{
|
||||
text: "#{@.name} (#{@.pid}): dummy notif",
|
||||
child: [ { text: "submenu" } ]
|
||||
}
|
||||
]
|
||||
# do nothing
|
||||
main: ->
|
||||
|
||||
awake: (e) ->
|
||||
console.log @name ,@pid
|
||||
cleanup: (evt) ->
|
||||
# do nothing
|
||||
|
||||
this.OS.register "Spotlight",Spotlight
|
14
src/packages/CoreServices/package.json
Normal file
14
src/packages/CoreServices/package.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"app":"CoreServices",
|
||||
"name":"CoreServices",
|
||||
"description":"This is the core services",
|
||||
"info":{
|
||||
"author": "Xuan Sang LE",
|
||||
"email": "xsang.le@gmail.com",
|
||||
"credit": "dedicated to some one here",
|
||||
"licences": "MIT"
|
||||
},
|
||||
"version":"0.1a",
|
||||
"category":"System",
|
||||
"mimes":["*"]
|
||||
}
|
@ -7,27 +7,5 @@ cssfiles = main.css
|
||||
copyfiles = scheme.html package.json
|
||||
|
||||
|
||||
BLUE=\033[1;34m
|
||||
NC=\033[0m
|
||||
|
||||
main: title clean js css copy
|
||||
|
||||
title:
|
||||
@echo "$(BLUE)======= Package DummyApp =======$(NC)"
|
||||
|
||||
coffee:
|
||||
- mkdir build
|
||||
for f in $(coffee_files); do (coffee -cs < $$f >build/"$$f.js");done
|
||||
for f in build/*.coffee.js; do (cat "$${f}"; echo) >> build/main.js; done
|
||||
- rm build/*.coffee.js
|
||||
|
||||
js: coffee
|
||||
for f in $(jsfiles); do (cat "$${f}"; echo) >> build/main.js; done
|
||||
|
||||
css:
|
||||
for f in $(cssfiles); do (cat "$${f}"; echo) >> build/main.css; done
|
||||
|
||||
copy:
|
||||
cp -rf $(copyfiles) build/
|
||||
clean:
|
||||
- rm -rf build/*
|
||||
PKG_NAME=DummyApp
|
||||
include ../pkg.mk
|
@ -7,27 +7,5 @@ cssfiles = main.css
|
||||
copyfiles = scheme.html package.json
|
||||
|
||||
|
||||
BLUE=\033[1;34m
|
||||
NC=\033[0m
|
||||
|
||||
main: title clean js css copy
|
||||
|
||||
title:
|
||||
@echo "$(BLUE)======= Package Files =======$(NC)"
|
||||
|
||||
coffee:
|
||||
- mkdir build
|
||||
for f in $(coffee_files); do (coffee -cs < $$f >build/"$$f.js");done
|
||||
for f in build/*.coffee.js; do (cat "$${f}"; echo) >> build/main.js; done
|
||||
- rm build/*.coffee.js
|
||||
|
||||
js: coffee
|
||||
for f in $(jsfiles); do (cat "$${f}"; echo) >> build/main.js; done
|
||||
|
||||
css:
|
||||
for f in $(cssfiles); do (cat "$${f}"; echo) >> build/main.css; done
|
||||
|
||||
copy:
|
||||
cp -rf $(copyfiles) build/
|
||||
clean:
|
||||
- rm -rf build/*
|
||||
PKG_NAME=ActivityFile
|
||||
include ../pkg.mk
|
@ -9,7 +9,6 @@ class Files extends this.OS.GUI.BaseApplication
|
||||
@navbar = @find "nav-bar"
|
||||
@prepaths = []
|
||||
@favo = @find "favouri"
|
||||
@loadSetting()
|
||||
|
||||
@view.contextmenuHandler = (e, m) ->
|
||||
m.set "items", [ me.mnFile(), me.mnEdit() ]
|
||||
@ -34,13 +33,7 @@ class Files extends this.OS.GUI.BaseApplication
|
||||
me._api.handler.scandir e.child.path,
|
||||
(d) -> f d.result
|
||||
, (e, s) -> me.error "Cannot fetch child dir #{e.child.path}"
|
||||
|
||||
@favo.set "items", @setting.favorite
|
||||
|
||||
loadSetting: () ->
|
||||
# view setting
|
||||
@view.set "view", @setting.view if @setting.view
|
||||
@view.set "showhidden", @setting.showhidden if @setting.showhidden
|
||||
|
||||
@setting.favorite = [
|
||||
{ text: "Applications", path: 'apps:///', iconclass:"fa fa-adn"},
|
||||
{ text: "Home", path: 'home:///', iconclass:"fa fa-home", selected:true},
|
||||
@ -48,8 +41,15 @@ class Files extends this.OS.GUI.BaseApplication
|
||||
{ text: "Desktop", path: 'home:///.desktop', iconclass: "fa fa-desktop" },
|
||||
] if not @setting.favorite
|
||||
@setting.sidebar = true if @setting.sidebar is undefined
|
||||
@toggleSidebar @setting.sidebar
|
||||
@setting.nav = true if @setting.nav is undefined
|
||||
@favo.set "items", @setting.favorite
|
||||
@applySetting()
|
||||
|
||||
applySetting: (k) ->
|
||||
# view setting
|
||||
@view.set "view", @setting.view if @setting.view
|
||||
@view.set "showhidden", @setting.showhidden if @setting.showhidden
|
||||
@toggleSidebar @setting.sidebar
|
||||
@toggleNav @setting.nav
|
||||
|
||||
chdir: (p, push) ->
|
||||
@ -123,16 +123,19 @@ class Files extends this.OS.GUI.BaseApplication
|
||||
actionView: (e) ->
|
||||
switch e.item.data.dataid
|
||||
when "#{@name}-hidden"
|
||||
@.view.set "showhidden", e.item.data.checked
|
||||
@.setting.showhidden = e.item.data.checked
|
||||
#@.view.set "showhidden", e.item.data.checked
|
||||
@registry "showhidden",e.item.data.checked
|
||||
#@.setting.showhidden = e.item.data.checked
|
||||
when "#{@name}-refresh"
|
||||
@.chdir ($ @.navinput).val(), false
|
||||
when "#{@name}-side"
|
||||
@setting.sidebar = e.item.data.checked
|
||||
@toggleSidebar e.item.data.checked
|
||||
@registry "sidebar",e.item.data.checked
|
||||
#@setting.sidebar = e.item.data.checked
|
||||
#@toggleSidebar e.item.data.checked
|
||||
when "#{@name}-nav"
|
||||
@setting.nav = e.item.data.checked
|
||||
@toggleNav e.item.data.checked
|
||||
@registry "nav", e.item.data.checked
|
||||
#@setting.nav = e.item.data.checked
|
||||
#@toggleNav e.item.data.checked
|
||||
|
||||
actionEdit: (e) ->
|
||||
switch e.item.data.dataid
|
||||
|
@ -7,27 +7,5 @@ cssfiles = main.css
|
||||
copyfiles = scheme.html package.json
|
||||
|
||||
|
||||
BLUE=\033[1;34m
|
||||
NC=\033[0m
|
||||
|
||||
main: title clean js css copy
|
||||
|
||||
title:
|
||||
@echo "$(BLUE)======= Package NotePad =======$(NC)"
|
||||
|
||||
coffee:
|
||||
- mkdir build
|
||||
for f in $(coffee_files); do (coffee -cs < $$f >build/"$$f.js");done
|
||||
for f in build/*.coffee.js; do (cat "$${f}"; echo) >> build/main.js; done
|
||||
- rm build/*.coffee.js
|
||||
|
||||
js: coffee
|
||||
for f in $(jsfiles); do (cat "$${f}"; echo) >> build/main.js; done
|
||||
|
||||
css:
|
||||
for f in $(cssfiles); do (cat "$${f}"; echo) >> build/main.css; done
|
||||
|
||||
copy:
|
||||
cp -rf $(copyfiles) build/
|
||||
clean:
|
||||
- rm -rf build/*
|
||||
PKG_NAME=NotePad
|
||||
include ../pkg.mk
|
25
src/packages/pkg.mk
Normal file
25
src/packages/pkg.mk
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
BLUE=\033[1;34m
|
||||
NC=\033[0m
|
||||
|
||||
main: title clean js css copy
|
||||
|
||||
title:
|
||||
@echo "$(BLUE)======= Package $(PKG_NAME) =======$(NC)"
|
||||
|
||||
coffee:
|
||||
- mkdir build
|
||||
for f in $(coffee_files); do (coffee -cs < $$f >build/"$$f.js");done
|
||||
for f in build/*.coffee.js; do (cat "$${f}"; echo) >> build/main.js; done
|
||||
- rm build/*.coffee.js
|
||||
|
||||
js: coffee
|
||||
for f in $(jsfiles); do (cat "$${f}"; echo) >> build/main.js; done
|
||||
|
||||
css:
|
||||
for f in $(cssfiles); do (cat "$${f}"; echo) >> build/main.css; done
|
||||
|
||||
copy:
|
||||
cp -rf $(copyfiles) build/
|
||||
clean:
|
||||
- rm -rf build/*
|
@ -7,28 +7,5 @@ cssfiles = xterm.css main.css
|
||||
copyfiles = scheme.html package.json
|
||||
|
||||
|
||||
BLUE=\033[1;34m
|
||||
NC=\033[0m
|
||||
|
||||
main: title clean js css copy
|
||||
|
||||
title:
|
||||
@echo "$(BLUE)======= Package wTerm =======$(NC)"
|
||||
- rm -rf build/*
|
||||
|
||||
coffee:
|
||||
- mkdir build
|
||||
for f in $(coffee_files); do (coffee -cs < $$f >build/"$$f.js");done
|
||||
for f in build/*.coffee.js; do (cat "$${f}"; echo) >> build/main.js; done
|
||||
- rm build/*.coffee.js
|
||||
|
||||
js: coffee
|
||||
for f in $(jsfiles); do (cat "$${f}"; echo) >> build/main.js; done
|
||||
|
||||
css:
|
||||
for f in $(cssfiles); do (cat "$${f}"; echo) >> build/main.css; done
|
||||
|
||||
copy:
|
||||
cp -rf $(copyfiles) build/
|
||||
clean:
|
||||
- rm -rf build/*
|
||||
PKG_NAME=wTerm
|
||||
include ../pkg.mk
|
Reference in New Issue
Block a user