mirror of
https://github.com/lxsang/antos-frontend.git
synced 2024-12-28 10:18:21 +01:00
remove riot and use the new tag engine
This commit is contained in:
parent
6c0f304767
commit
ae54c9a10c
2
Makefile
2
Makefile
@ -45,6 +45,8 @@ coffees= src/core/core.coffee \
|
|||||||
src/core/tags/ColorPickerTag.coffee \
|
src/core/tags/ColorPickerTag.coffee \
|
||||||
src/core/tags/FileViewTag.coffee \
|
src/core/tags/FileViewTag.coffee \
|
||||||
src/core/tags/OverlayTag.coffee \
|
src/core/tags/OverlayTag.coffee \
|
||||||
|
src/core/tags/AppDockTag.coffee \
|
||||||
|
src/core/tags/SystemPanelTag.coffee \
|
||||||
src/antos.coffee
|
src/antos.coffee
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
class BaseModel
|
class BaseModel
|
||||||
constructor: (@name, @args) ->
|
constructor: (@name, @args) ->
|
||||||
me = @
|
me = @
|
||||||
@observable = riot.observable()
|
@observable = new Announcer()
|
||||||
@_api = Ant.OS.API
|
@_api = Ant.OS.API
|
||||||
@_gui = Ant.OS.GUI
|
@_gui = Ant.OS.GUI
|
||||||
@systemsetting = Ant.OS.setting
|
@systemsetting = Ant.OS.setting
|
||||||
|
@ -24,6 +24,9 @@ class BaseService extends this.OS.GUI.BaseModel
|
|||||||
@text = ""
|
@text = ""
|
||||||
@timer = undefined
|
@timer = undefined
|
||||||
@holder = undefined
|
@holder = undefined
|
||||||
|
me = @
|
||||||
|
@onmenuselect = (d) ->
|
||||||
|
me.awake d
|
||||||
|
|
||||||
init: ()->
|
init: ()->
|
||||||
#implement by user
|
#implement by user
|
||||||
@ -34,10 +37,6 @@ class BaseService extends this.OS.GUI.BaseModel
|
|||||||
attach: (h) ->
|
attach: (h) ->
|
||||||
@holder = h
|
@holder = h
|
||||||
|
|
||||||
update: () ->
|
|
||||||
@holder.update() if @holder
|
|
||||||
@scheme.update() if @scheme
|
|
||||||
|
|
||||||
watch: ( t, f) ->
|
watch: ( t, f) ->
|
||||||
me = @
|
me = @
|
||||||
func = () ->
|
func = () ->
|
||||||
|
@ -31,10 +31,10 @@ Ant.OS.GUI =
|
|||||||
text: "",
|
text: "",
|
||||||
iconclass: "fa fa-eercast",
|
iconclass: "fa fa-eercast",
|
||||||
dataid: "sys-menu-root",
|
dataid: "sys-menu-root",
|
||||||
child: [
|
children: [
|
||||||
{
|
{
|
||||||
text: "__(Applications)",
|
text: "__(Applications)",
|
||||||
child: [],
|
children: [],
|
||||||
dataid: "sys-apps"
|
dataid: "sys-apps"
|
||||||
iconclass: "fa fa-adn",
|
iconclass: "fa fa-adn",
|
||||||
onmenuselect: (d) ->
|
onmenuselect: (d) ->
|
||||||
@ -53,7 +53,7 @@ Ant.OS.GUI =
|
|||||||
$(app.scheme).remove() if app.scheme
|
$(app.scheme).remove() if app.scheme
|
||||||
($ parent).append scheme
|
($ parent).append scheme
|
||||||
app.scheme = scheme[0]
|
app.scheme = scheme[0]
|
||||||
riot.mount ($ scheme), { observable: app.observable }
|
scheme[0].uify app.observable
|
||||||
app.main()
|
app.main()
|
||||||
app.show()
|
app.show()
|
||||||
loadScheme: (path, app, parent) ->
|
loadScheme: (path, app, parent) ->
|
||||||
@ -319,11 +319,15 @@ Ant.OS.GUI =
|
|||||||
Ant.OS.GUI.shortcut[fnk][c](event)
|
Ant.OS.GUI.shortcut[fnk][c](event)
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
# system menu and dock
|
# system menu and dock
|
||||||
riot.mount ($ "#syspanel", $ "#wrapper")
|
$("#syspanel")[0].uify()
|
||||||
riot.mount ($ "#sysdock", $ "#workspace"), { items: [] }
|
$("#sysdock")[0].uify()
|
||||||
riot.mount ($ "#systooltip", $ "#wrapper")
|
$("#systooltip")[0].uify()
|
||||||
|
$("#contextmenu")[0].uify()
|
||||||
|
#riot.mount ($ "#syspanel", $ "#wrapper")
|
||||||
|
#riot.mount ($ "#sysdock", $ "#workspace"), { items: [] }
|
||||||
|
#riot.mount ($ "#systooltip", $ "#wrapper")
|
||||||
# context menu
|
# context menu
|
||||||
riot.mount ($ "#contextmenu", $ "#wrapper")
|
#riot.mount ($ "#contextmenu", $ "#wrapper")
|
||||||
($ "#workspace").contextmenu (e) -> Ant.OS.GUI.bindContextMenu e
|
($ "#workspace").contextmenu (e) -> Ant.OS.GUI.bindContextMenu e
|
||||||
# tooltip
|
# tooltip
|
||||||
($ "#workspace").mouseover (e) ->
|
($ "#workspace").mouseover (e) ->
|
||||||
@ -409,7 +413,8 @@ Ant.OS.GUI =
|
|||||||
desktop[0].fetch() if d.data.file.hash() is fp.hash() or d.data.file.parent().hash() is fp.hash()
|
desktop[0].fetch() if d.data.file.hash() is fp.hash() or d.data.file.parent().hash() is fp.hash()
|
||||||
Ant.OS.announcer.ostrigger "desktoploaded"
|
Ant.OS.announcer.ostrigger "desktoploaded"
|
||||||
# mount it
|
# mount it
|
||||||
riot.mount desktop
|
desktop[0].uify()
|
||||||
|
# riot.mount desktop
|
||||||
, (e, s) ->
|
, (e, s) ->
|
||||||
alert __("System fail: Cannot init desktop manager")
|
alert __("System fail: Cannot init desktop manager")
|
||||||
console.log s, e
|
console.log s, e
|
||||||
@ -417,21 +422,21 @@ Ant.OS.GUI =
|
|||||||
($ Ant.OS.GUI.workspace)[0].fetch()
|
($ Ant.OS.GUI.workspace)[0].fetch()
|
||||||
|
|
||||||
refreshSystemMenu: () ->
|
refreshSystemMenu: () ->
|
||||||
Ant.OS.GUI.SYS_MENU[0].child.length = 1
|
Ant.OS.GUI.SYS_MENU[0].children.length = 1
|
||||||
Ant.OS.GUI.SYS_MENU[0].child[0].child.length = 0
|
Ant.OS.GUI.SYS_MENU[0].children[0].children.length = 0
|
||||||
Ant.OS.GUI.SYS_MENU[0].child[0].child.push v for k, v of Ant.OS.setting.system.packages when (v and v.app)
|
Ant.OS.GUI.SYS_MENU[0].children[0].children.push v for k, v of Ant.OS.setting.system.packages when (v and v.app)
|
||||||
Ant.OS.GUI.SYS_MENU[0].child.push v for k, v of Ant.OS.setting.system.menu
|
Ant.OS.GUI.SYS_MENU[0].children.push v for k, v of Ant.OS.setting.system.menu
|
||||||
Ant.OS.GUI.SYS_MENU[0].child.push
|
Ant.OS.GUI.SYS_MENU[0].children.push
|
||||||
text: "__(Toggle Full screen)",
|
text: "__(Toggle Full screen)",
|
||||||
dataid: "os-fullsize",
|
dataid: "os-fullsize",
|
||||||
iconclass: "fa fa-tv"
|
iconclass: "fa fa-tv"
|
||||||
Ant.OS.GUI.SYS_MENU[0].child.push
|
Ant.OS.GUI.SYS_MENU[0].children.push
|
||||||
text: "__(Log out)",
|
text: "__(Log out)",
|
||||||
dataid: "sys-logout",
|
dataid: "sys-logout",
|
||||||
iconclass: "fa fa-user-times"
|
iconclass: "fa fa-user-times"
|
||||||
($ "[data-id = 'os_menu']", "#syspanel")[0].update()
|
# Ant.OS.GUI.buildSystemMenu()
|
||||||
buildSystemMenu: () ->
|
buildSystemMenu: () ->
|
||||||
($ "[data-id = 'os_menu']", "#syspanel")[0].set "items", Ant.OS.GUI.SYS_MENU
|
($ "[data-id = 'osmenu']", "#syspanel")[0].set "items", Ant.OS.GUI.SYS_MENU
|
||||||
|
|
||||||
#console.log menu
|
#console.log menu
|
||||||
|
|
||||||
|
@ -86,4 +86,4 @@ class FloatListTag extends ListViewTag
|
|||||||
cleft = 20
|
cleft = 20
|
||||||
ctop += h + 20
|
ctop += h + 20
|
||||||
|
|
||||||
Ant.OS.GUI.define "afx-float-list1", FloatListTag
|
Ant.OS.GUI.define "afx-float-list", FloatListTag
|
||||||
|
@ -70,7 +70,7 @@ class ListViewTag extends Ant.OS.GUI.BaseTag
|
|||||||
@setopt "onlistdbclick", () ->
|
@setopt "onlistdbclick", () ->
|
||||||
@setopt "onitemclose", () -> true
|
@setopt "onitemclose", () -> true
|
||||||
@setopt "buttons", []
|
@setopt "buttons", []
|
||||||
@setopt "data", {}
|
@setopt "data", []
|
||||||
@setopt "dropdown", false
|
@setopt "dropdown", false
|
||||||
@setopt "itemtag", "afx-list-item"
|
@setopt "itemtag", "afx-list-item"
|
||||||
@setopt "multiselect", false
|
@setopt "multiselect", false
|
||||||
@ -116,6 +116,7 @@ class ListViewTag extends Ant.OS.GUI.BaseTag
|
|||||||
.set "onclose", (e) ->
|
.set "onclose", (e) ->
|
||||||
me.iclose e
|
me.iclose e
|
||||||
.set "data", item
|
.set "data", item
|
||||||
|
item.domel = el[0]
|
||||||
el[0]
|
el[0]
|
||||||
|
|
||||||
remove: (item) ->
|
remove: (item) ->
|
||||||
|
@ -162,6 +162,9 @@ class MenuTag extends Ant.OS.GUI.BaseTag
|
|||||||
@setopt "items", []
|
@setopt "items", []
|
||||||
@root.show = (e) ->
|
@root.show = (e) ->
|
||||||
me.showctxmenu e
|
me.showctxmenu e
|
||||||
|
@root.push = (e) -> me.push e
|
||||||
|
@root.remove = (e) -> me.remove e
|
||||||
|
@root.unshift = (e) -> me.unshift e
|
||||||
|
|
||||||
handleselect: (e) ->
|
handleselect: (e) ->
|
||||||
$(@root).hide() if @isctxmenu()
|
$(@root).hide() if @isctxmenu()
|
||||||
@ -184,31 +187,54 @@ class MenuTag extends Ant.OS.GUI.BaseTag
|
|||||||
|
|
||||||
mount: () ->
|
mount: () ->
|
||||||
me = @
|
me = @
|
||||||
|
$(@refs.container).css "display", "contents"
|
||||||
return unless me.isctxmenu()
|
return unless me.isctxmenu()
|
||||||
$(@refs.container).mouseleave (e) ->
|
$(@refs.wrapper).mouseleave (e) ->
|
||||||
return unless me.is_root()
|
return unless me.is_root()
|
||||||
$(me.root).hide()
|
$(me.root).hide()
|
||||||
|
|
||||||
__context__: (v) ->
|
__context__: (v) ->
|
||||||
$(@refs.container).removeClass("context")
|
$(@refs.wrapper).removeClass("context")
|
||||||
return unless v
|
return unless v
|
||||||
$(@refs.container).addClass("context")
|
$(@refs.wrapper).addClass("context")
|
||||||
$(@root).hide()
|
$(@root).hide()
|
||||||
|
|
||||||
__items__: (data) ->
|
unshift: (item) ->
|
||||||
me = @
|
@push item, true
|
||||||
$(@refs.container).empty()
|
|
||||||
$("<li>").appendTo(@refs.container).addClass("afx-corner-fix")
|
remove: (item) ->
|
||||||
for item in data
|
el = item.get "data"
|
||||||
el = $("<#{@get("contentag")}>").appendTo @refs.container
|
data = @get "items"
|
||||||
|
if data.includes el
|
||||||
|
data.splice data.indexOf(el), 1
|
||||||
|
$(item).remove()
|
||||||
|
|
||||||
|
push: (item, flag) ->
|
||||||
|
el = $("<#{@get("contentag")}>")
|
||||||
|
if flag
|
||||||
|
$(@refs.container).prepend el[0]
|
||||||
|
@get("items").unshift item
|
||||||
|
else
|
||||||
|
el.appendTo @refs.container
|
||||||
|
@get("items").push item
|
||||||
el[0].uify undefined
|
el[0].uify undefined
|
||||||
el[0].set "parent", me.get("parent")
|
el[0].set "parent", @get("parent")
|
||||||
el[0].set "root", if me.get("parent") then me.get("parent").get("root") else me
|
el[0].set "root", if @get("parent") then @get("parent").get("root") else @
|
||||||
el[0].set "data", item
|
el[0].set "data", item
|
||||||
item.domel = el[0]
|
item.domel = el[0]
|
||||||
$("<li>").appendTo(@refs.container).addClass("afx-corner-fix")
|
el[0]
|
||||||
|
|
||||||
|
__items__: (data) ->
|
||||||
|
$(@refs.container).empty()
|
||||||
|
for item in data
|
||||||
|
@push item, false
|
||||||
|
|
||||||
layout: () ->
|
layout: () ->
|
||||||
[{ el: "ul", ref: "container" }]
|
[{ el: "ul", ref: "wrapper", children: [
|
||||||
|
{ el: "li", class: "afx-corner-fix" },
|
||||||
|
{ el: "div", ref: "container" },
|
||||||
|
{ el: "li", class: "afx-corner-fix" }
|
||||||
|
] }]
|
||||||
|
|
||||||
Ant.OS.GUI.define "afx-menu", MenuTag
|
Ant.OS.GUI.define "afx-menu", MenuTag
|
||||||
Ant.OS.GUI.define "afx-menu-entry-proto", MenuEntryTag
|
Ant.OS.GUI.define "afx-menu-entry-proto", MenuEntryTag
|
||||||
|
@ -28,7 +28,6 @@ class OverlayTag extends Ant.OS.GUI.BaseTag
|
|||||||
}
|
}
|
||||||
|
|
||||||
layout: () ->
|
layout: () ->
|
||||||
[{
|
@refs.yield = @root
|
||||||
el: "div", ref: "yield"
|
[]
|
||||||
}]
|
|
||||||
Ant.OS.GUI.define "afx-overlay", OverlayTag
|
Ant.OS.GUI.define "afx-overlay", OverlayTag
|
42
src/core/tags/SystemPanelTag.coffee
Normal file
42
src/core/tags/SystemPanelTag.coffee
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
class SystemPanelTag extends Ant.OS.GUI.BaseTag
|
||||||
|
constructor: (r, o) ->
|
||||||
|
super r, o
|
||||||
|
me = @
|
||||||
|
@setopt "osmenu", { children: [] }
|
||||||
|
@setopt "appmenu", []
|
||||||
|
@setopt "systray", []
|
||||||
|
@root.attachservice = (s) -> me.attachservice s
|
||||||
|
@root.detachservice = (s) -> me.detachservice s
|
||||||
|
|
||||||
|
__osmenu__: (v) ->
|
||||||
|
@refs.osmenu.set "items", [v]
|
||||||
|
|
||||||
|
__appmenu__: (v) ->
|
||||||
|
@refs.appmenu.set "items", v
|
||||||
|
|
||||||
|
__systray__: (v) ->
|
||||||
|
@refs.systray.set "items", [v]
|
||||||
|
|
||||||
|
attachservice: (s) ->
|
||||||
|
@refs.systray.unshift s
|
||||||
|
s.attach @refs.systray
|
||||||
|
|
||||||
|
detachservice: (s) ->
|
||||||
|
@refs.systray.remove s
|
||||||
|
|
||||||
|
layout: () ->
|
||||||
|
[{
|
||||||
|
el: "div", children: [
|
||||||
|
{ el: "afx-menu", id: "osmenu", ref: "osmenu", class: "afx-panel-os-menu" },
|
||||||
|
{ el: "afx-menu", id: "appmenu", ref: "appmenu", class: "afx-panel-os-app" },
|
||||||
|
{ el: "afx-menu", id: "systray", ref: "systray", class: "afx-panel-os-stray" }
|
||||||
|
]
|
||||||
|
}]
|
||||||
|
|
||||||
|
mount: () ->
|
||||||
|
$(@refs.osmenu).css("z-index", 1000000)
|
||||||
|
$(@refs.appmenu).css("z-index", 1000000)
|
||||||
|
$(@refs.systray).css("z-index", 1000000)
|
||||||
|
Ant.OS.announcer.trigger("syspanelloaded")
|
||||||
|
|
||||||
|
Ant.OS.GUI.define "afx-sys-panel", SystemPanelTag
|
@ -77,6 +77,7 @@ class Ant.OS.GUI.BaseTag
|
|||||||
return undefined unless tag
|
return undefined unless tag
|
||||||
dom = $("<#{tag.el}>")
|
dom = $("<#{tag.el}>")
|
||||||
$(dom).addClass tag.class if tag.class
|
$(dom).addClass tag.class if tag.class
|
||||||
|
$(dom).attr "data-id", tag.id if tag.id
|
||||||
if tag.children
|
if tag.children
|
||||||
$(@mkui(v)).appendTo(dom) for v in tag.children
|
$(@mkui(v)).appendTo(dom) for v in tag.children
|
||||||
if tag.ref
|
if tag.ref
|
||||||
@ -102,7 +103,7 @@ Element.prototype.mount = () ->
|
|||||||
|
|
||||||
Element.prototype.uify = (observable) ->
|
Element.prototype.uify = (observable) ->
|
||||||
@mkui(observable)
|
@mkui(observable)
|
||||||
@sync()
|
@mount()
|
||||||
|
|
||||||
Ant.OS.GUI.define = (name, cls) ->
|
Ant.OS.GUI.define = (name, cls) ->
|
||||||
Ant.OS.GUI.tag[name] = cls
|
Ant.OS.GUI.tag[name] = cls
|
||||||
|
@ -27,7 +27,8 @@ class Calendar extends this.OS.GUI.BaseService
|
|||||||
@watch 1000, () ->
|
@watch 1000, () ->
|
||||||
now = new Date
|
now = new Date
|
||||||
me.text = now.toString()
|
me.text = now.toString()
|
||||||
me.update()
|
me.domel.set "text", me.text
|
||||||
|
|
||||||
|
|
||||||
awake: (e) ->
|
awake: (e) ->
|
||||||
@.openDialog "CalendarDialog", (d) ->
|
@.openDialog "CalendarDialog", (d) ->
|
||||||
@ -38,4 +39,4 @@ class Calendar extends this.OS.GUI.BaseService
|
|||||||
console.log "cleanup for quit"
|
console.log "cleanup for quit"
|
||||||
# do nothing
|
# do nothing
|
||||||
|
|
||||||
this.OS.register "Calendar",Calendar
|
this.OS.register "Calendar", Calendar
|
@ -20,7 +20,6 @@ class PushNotification extends this.OS.GUI.BaseService
|
|||||||
constructor: (args) ->
|
constructor: (args) ->
|
||||||
super "PushNotification", args
|
super "PushNotification", args
|
||||||
@iconclass = "fa fa-bars"
|
@iconclass = "fa fa-bars"
|
||||||
@onmenuselect = (e) -> console.log e
|
|
||||||
@cb = undefined
|
@cb = undefined
|
||||||
@pending = []
|
@pending = []
|
||||||
init: ->
|
init: ->
|
||||||
@ -45,7 +44,7 @@ class PushNotification extends this.OS.GUI.BaseService
|
|||||||
@mfeed = @find "notifeed"
|
@mfeed = @find "notifeed"
|
||||||
@nzone = @find "notifyzone"
|
@nzone = @find "notifyzone"
|
||||||
@fzone = @find "feedzone"
|
@fzone = @find "feedzone"
|
||||||
(@find "btclear").set "onbtclick", (e) -> me.mlist.set "items", []
|
(@find "btclear").set "onbtclick", (e) -> me.mlist.set "data", []
|
||||||
#@subscribe "fail", (e) -> console.log e
|
#@subscribe "fail", (e) -> console.log e
|
||||||
@subscribe "notification", (o) -> me.pushout 'INFO', o
|
@subscribe "notification", (o) -> me.pushout 'INFO', o
|
||||||
@subscribe "fail", (o) -> me.pushout 'FAIL', o
|
@subscribe "fail", (o) -> me.pushout 'FAIL', o
|
||||||
@ -64,15 +63,21 @@ class PushNotification extends this.OS.GUI.BaseService
|
|||||||
|
|
||||||
($ @nzone).css "right", 0
|
($ @nzone).css "right", 0
|
||||||
.css "top", "-3px"
|
.css "top", "-3px"
|
||||||
.css "height", ""
|
.css "height", "100%"
|
||||||
.css "bottom", "0"
|
.css "bottom", "0"
|
||||||
.css "z-index", 1000000
|
.css "z-index", 1000000
|
||||||
|
.css "display", "flex"
|
||||||
|
.css "flex-direction", "column"
|
||||||
.hide()
|
.hide()
|
||||||
|
($ @mlist).css "flex", "1"
|
||||||
($ @fzone)
|
($ @fzone)
|
||||||
#.css("z-index", 99999)
|
#.css("z-index", 99999)
|
||||||
.css("bottom", "0")
|
.css("bottom", "0")
|
||||||
.css("height", "")
|
.css("height", "100%")
|
||||||
|
.css "display", "flex"
|
||||||
|
.css "flex-direction", "column"
|
||||||
.hide()
|
.hide()
|
||||||
|
($ @mfeed).css "flex", "1"
|
||||||
|
|
||||||
pushout: (s, o, mfeed) ->
|
pushout: (s, o, mfeed) ->
|
||||||
d = {
|
d = {
|
||||||
@ -82,7 +87,7 @@ class PushNotification extends this.OS.GUI.BaseService
|
|||||||
closable: true }
|
closable: true }
|
||||||
#console.log o.data.s
|
#console.log o.data.s
|
||||||
#console.log o.data.e
|
#console.log o.data.e
|
||||||
@mlist.unshift d, true
|
@mlist.unshift d
|
||||||
@notifeed d
|
@notifeed d
|
||||||
|
|
||||||
notifeed: (d) ->
|
notifeed: (d) ->
|
||||||
@ -90,18 +95,17 @@ class PushNotification extends this.OS.GUI.BaseService
|
|||||||
@mfeed.unshift d, true
|
@mfeed.unshift d, true
|
||||||
($ @fzone).show()
|
($ @fzone).show()
|
||||||
timer = setTimeout () ->
|
timer = setTimeout () ->
|
||||||
me.mfeed.remove d, true
|
me.mfeed.remove d.domel
|
||||||
clearTimeout timer
|
clearTimeout timer
|
||||||
, 3000
|
, 3000
|
||||||
|
|
||||||
awake: (e) ->
|
awake: (evt) ->
|
||||||
if @view then ($ @nzone).hide() else ($ @nzone).show()
|
if @view then ($ @nzone).hide() else ($ @nzone).show()
|
||||||
@view = not @view
|
@view = not @view
|
||||||
me = @
|
me = @
|
||||||
if not @cb
|
if not @cb
|
||||||
@cb = (e) ->
|
@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(evt.data.item).length
|
||||||
if not ($ e.target).closest($ me.nzone).length and not ($ e.target).closest($ me.holder.root).length
|
|
||||||
($ me.nzone).hide()
|
($ me.nzone).hide()
|
||||||
$(document).unbind "click", me.cb
|
$(document).unbind "click", me.cb
|
||||||
me.view = not me.view
|
me.view = not me.view
|
||||||
@ -113,15 +117,15 @@ class PushNotification extends this.OS.GUI.BaseService
|
|||||||
cleanup: (evt) ->
|
cleanup: (evt) ->
|
||||||
# do nothing
|
# do nothing
|
||||||
PushNotification.scheme = """
|
PushNotification.scheme = """
|
||||||
<afx-dummy>
|
<divs>
|
||||||
<afx-overlay data-id = "notifyzone" width = "250">
|
<afx-overlay data-id = "notifyzone" width = "250">
|
||||||
<afx-button text = "__(Clear all)" data-id = "btclear"></afx-button>
|
<afx-button text = "__(Clear all)" data-id = "btclear" ></afx-button>
|
||||||
<afx-list-view data-id="notifylist"></afx-list-view>
|
<afx-list-view data-id="notifylist"></afx-list-view>
|
||||||
</afx-overlay>
|
</afx-overlay>
|
||||||
<afx-overlay data-id = "feedzone" width = "250">
|
<afx-overlay data-id = "feedzone" width = "250">
|
||||||
<afx-list-view data-id = "notifeed">
|
<afx-list-view data-id = "notifeed">
|
||||||
</afx-list-view>
|
</afx-list-view>
|
||||||
</afx-overlay>
|
</afx-overlay>
|
||||||
</afx-dummy>
|
</div>
|
||||||
"""
|
"""
|
||||||
this.OS.register "PushNotification",PushNotification
|
this.OS.register "PushNotification", PushNotification
|
@ -37,7 +37,7 @@ class SpotlightDialog extends this.OS.GUI.BaseDialog
|
|||||||
($ document).keyup @fn
|
($ document).keyup @fn
|
||||||
|
|
||||||
@fn1 = (e) ->
|
@fn1 = (e) ->
|
||||||
return if $(e.target).closest(me.parent.holder.root).length
|
return if $(e.target).closest(me.parent.holder).length
|
||||||
if not $(e.target).closest(me.scheme).length
|
if not $(e.target).closest(me.scheme).length
|
||||||
($ document).unbind "click", me.fn1
|
($ document).unbind "click", me.fn1
|
||||||
($ document).unbind "keyup", me.fn
|
($ document).unbind "keyup", me.fn
|
||||||
@ -49,7 +49,7 @@ class SpotlightDialog extends this.OS.GUI.BaseDialog
|
|||||||
($ @searchbox).focus()
|
($ @searchbox).focus()
|
||||||
($ @searchbox).keyup (e) ->
|
($ @searchbox).keyup (e) ->
|
||||||
me.search e
|
me.search e
|
||||||
@container.set "onlistdbclick", (e)->
|
@container.set "onlistdbclick", (e) ->
|
||||||
return if e.data.dataid and e.data.dataid is "header"
|
return if e.data.dataid and e.data.dataid is "header"
|
||||||
me.handler(e) if me.handler
|
me.handler(e) if me.handler
|
||||||
me._gui.openWith e.data
|
me._gui.openWith e.data
|
||||||
@ -86,11 +86,14 @@ class SpotlightDialog extends this.OS.GUI.BaseDialog
|
|||||||
return unless text.length >= 3
|
return unless text.length >= 3
|
||||||
result = @_api.search text
|
result = @_api.search text
|
||||||
return if result.length is 0
|
return if result.length is 0
|
||||||
@container.set "items", result
|
@container.set "data", result
|
||||||
|
console.log result
|
||||||
($ @scheme).css("height", @height)
|
($ @scheme).css("height", @height)
|
||||||
|
|
||||||
SpotlightDialog.scheme = """
|
SpotlightDialog.scheme = """
|
||||||
<afx-app-window data-id = "spotlight-win" apptitle="" minimizable="false" resizable = "false" width="500" height="300">
|
<afx-app-window data-id = "spotlight-win"
|
||||||
|
apptitle="" minimizable="false"
|
||||||
|
resizable = "false" width="500" height="300">
|
||||||
<afx-vbox>
|
<afx-vbox>
|
||||||
<afx-hbox data-height="45">
|
<afx-hbox data-height="45">
|
||||||
<div data-id = "searchicon" data-width="45"></div>
|
<div data-id = "searchicon" data-width="45"></div>
|
||||||
@ -111,13 +114,7 @@ class Spotlight extends this.OS.GUI.BaseService
|
|||||||
me = @
|
me = @
|
||||||
@_gui.bindKey "CTRL- ", (e) ->
|
@_gui.bindKey "CTRL- ", (e) ->
|
||||||
me.awake(e)
|
me.awake(e)
|
||||||
#@child = [
|
|
||||||
# {
|
|
||||||
# text: "#{@.name} (#{@.pid}): dummy notif",
|
|
||||||
# child: [ { text: "submenu" } ]
|
|
||||||
# }
|
|
||||||
#]
|
|
||||||
# do nothing
|
|
||||||
main: ->
|
main: ->
|
||||||
|
|
||||||
awake: (e) ->
|
awake: (e) ->
|
||||||
@ -134,4 +131,4 @@ class Spotlight extends this.OS.GUI.BaseService
|
|||||||
cleanup: (evt) ->
|
cleanup: (evt) ->
|
||||||
# do nothing
|
# do nothing
|
||||||
|
|
||||||
this.OS.register "Spotlight",Spotlight
|
this.OS.register "Spotlight", Spotlight
|
@ -19,26 +19,27 @@
|
|||||||
class UserService extends this.OS.GUI.BaseService
|
class UserService extends this.OS.GUI.BaseService
|
||||||
constructor: (args) ->
|
constructor: (args) ->
|
||||||
super "UserService", args
|
super "UserService", args
|
||||||
@text =@systemsetting.user.username
|
@text = @systemsetting.user.username
|
||||||
@iconclass = undefined
|
@iconclass = undefined
|
||||||
init: ->
|
|
||||||
me = @
|
me = @
|
||||||
@child = [
|
@children = [
|
||||||
{
|
{
|
||||||
text: "__(About)", dataid: "user-about",
|
text: "__(About)", dataid: "user-about",
|
||||||
iconclass: "fa fa-user-circle-o"
|
iconclass: "fa fa-user-circle-o"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "__(Logout)", dataid: "sys-logout",
|
text: "__(Logout)", dataid: "sys-logout",
|
||||||
iconclass: "fa fa-user-times"
|
iconclass: "fa fa-user-times",
|
||||||
|
onmenuselect: (d) ->
|
||||||
|
me.notify __("This feature is not implemented yet")
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@onmenuselect = (d) ->
|
|
||||||
return window.OS.exit() if d.item.data.dataid is "sys-logout"
|
init: ->
|
||||||
me.notify __("This feature is not implemented yet")
|
|
||||||
awake: (e) ->
|
awake: (e) ->
|
||||||
|
|
||||||
cleanup: (evt) ->
|
cleanup: (evt) ->
|
||||||
|
|
||||||
|
|
||||||
this.OS.register "UserService",UserService
|
this.OS.register "UserService", UserService
|
@ -65,7 +65,7 @@ class ShowCase extends this.OS.GUI.BaseApplication
|
|||||||
</afx-vbox>
|
</afx-vbox>
|
||||||
</afx-hbox>
|
</afx-hbox>
|
||||||
<afx-hbox tabname="Virtual desktop">
|
<afx-hbox tabname="Virtual desktop">
|
||||||
<afx-float-list1 data-id = "flist"/>
|
<afx-float-list data-id = "flist"/>
|
||||||
</afx-hbox>
|
</afx-hbox>
|
||||||
<afx-hbox tabname="Calendar">
|
<afx-hbox tabname="Calendar">
|
||||||
<afx-calendar-view data-id = "cal"/>
|
<afx-calendar-view data-id = "cal"/>
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
|
|
||||||
afx-float-list1 div.list-container > ul{
|
afx-float-list div.list-container > ul{
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
afx-float-list1 div.list-container > ul li{
|
afx-float-list div.list-container > ul li{
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
@ -2,5 +2,5 @@ afx-label i.icon-style {
|
|||||||
width: 16px;
|
width: 16px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
float:left;
|
float: left;
|
||||||
}
|
}
|
@ -2,7 +2,7 @@
|
|||||||
afx-menu {
|
afx-menu {
|
||||||
position:relative;
|
position:relative;
|
||||||
display:inline-block;
|
display:inline-block;
|
||||||
/*z-index: 100000;*/
|
z-index: 100000;
|
||||||
}
|
}
|
||||||
afx-menu a{
|
afx-menu a{
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@ -54,15 +54,16 @@ afx-menu ul li /*, afx-menu ul >afx-menu-entry > li*/{
|
|||||||
padding:3px;
|
padding:3px;
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
|
cursor:default;
|
||||||
}
|
}
|
||||||
afx-menu ul > li.fix_padding{
|
afx-menu ul li.fix_padding{
|
||||||
padding-top:1px;
|
padding-top:1px;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
afx-menu afx-menu ul > li.fix_padding{
|
afx-menu afx-menu ul li.fix_padding{
|
||||||
padding:3px;
|
padding:3px;
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
@ -79,6 +80,7 @@ afx-menu afx-menu i{
|
|||||||
afx-menu afx-menu li{
|
afx-menu afx-menu li{
|
||||||
float:none;
|
float:none;
|
||||||
min-width: 150px;
|
min-width: 150px;
|
||||||
|
cursor:default;
|
||||||
}
|
}
|
||||||
afx-menu afx-menu afx-menu, afx-menu ul.context afx-menu{
|
afx-menu afx-menu afx-menu, afx-menu ul.context afx-menu{
|
||||||
top:-4px;
|
top:-4px;
|
||||||
|
Loading…
Reference in New Issue
Block a user