mirror of
https://github.com/lxsang/antos-frontend.git
synced 2025-07-27 03:09:45 +02:00
add support for Global shortcut binding, Spotlight now can be called using CTRL+SPACE
This commit is contained in:
@ -4,7 +4,7 @@ jsfiles =
|
||||
|
||||
cssfiles = main.css
|
||||
|
||||
copyfiles = package.json notifications.html spotlight.html
|
||||
copyfiles = package.json
|
||||
|
||||
|
||||
PKG_NAME=CoreServices
|
||||
|
@ -7,8 +7,9 @@ class PushNotification extends this.OS.GUI.BaseService
|
||||
@pending = []
|
||||
init: ->
|
||||
@view = false
|
||||
path = path = "#{@meta().path}/notifications.html"
|
||||
@render path
|
||||
@_gui.htmlToScheme PushNotification.scheme, @, @host
|
||||
#path = path = "#{@meta().path}/notifications.html"
|
||||
#@render path
|
||||
|
||||
spin: (b) ->
|
||||
if b and @iconclass is "fa fa-bars"
|
||||
@ -93,5 +94,16 @@ class PushNotification extends this.OS.GUI.BaseService
|
||||
|
||||
cleanup: (evt) ->
|
||||
# do nothing
|
||||
|
||||
PushNotification.scheme = """
|
||||
<afx-dummy>
|
||||
<afx-overlay data-id = "notifyzone" width = "250">
|
||||
<afx-button text = "Clear all" data-id = "btclear"></afx-button>
|
||||
<afx-list-view data-id="notifylist"></afx-list-view>
|
||||
</afx-overlay>
|
||||
<afx-overlay data-id = "feedzone" width = "250">
|
||||
<afx-list-view data-id = "notifeed">
|
||||
</afx-list-view>
|
||||
</afx-overlay>
|
||||
</afx-dummy>
|
||||
"""
|
||||
this.OS.register "PushNotification",PushNotification
|
@ -3,8 +3,8 @@ class SpotlightDialog extends this.OS.GUI.BaseDialog
|
||||
super "SpotlightDialog"
|
||||
|
||||
init: () ->
|
||||
@render "#{@path()}/spotlight.html"
|
||||
|
||||
#@render "#{@path()}/spotlight.html"
|
||||
@_gui.htmlToScheme SpotlightDialog.scheme, @, @host
|
||||
main: () ->
|
||||
me = @
|
||||
@height = ($ @scheme).css("height")
|
||||
@ -37,7 +37,6 @@ class SpotlightDialog extends this.OS.GUI.BaseDialog
|
||||
($ document).unbind "click", me.fn1
|
||||
($ document).unbind "keyup", me.fn
|
||||
me.quit()
|
||||
|
||||
|
||||
|
||||
search: (e) ->
|
||||
@ -71,7 +70,17 @@ class SpotlightDialog extends this.OS.GUI.BaseDialog
|
||||
@container.set "items", result
|
||||
($ @scheme).css("height", @height)
|
||||
|
||||
|
||||
SpotlightDialog.scheme = """
|
||||
<afx-app-window data-id = "spotlight-win" apptitle="" minimizable="false" resizable = "false" width="500" height="300">
|
||||
<afx-vbox>
|
||||
<afx-hbox data-height="45">
|
||||
<div data-id = "searchicon" data-width="45"></div>
|
||||
<input type = "text" data-id="searchbox"/>
|
||||
</afx-hbox>
|
||||
<afx-list-view data-id="container"></afx-list-view>
|
||||
</afx-vbox>
|
||||
</afx-app-window>
|
||||
"""
|
||||
this.OS.register "SpotlightDialog", SpotlightDialog
|
||||
|
||||
class Spotlight extends this.OS.GUI.BaseService
|
||||
@ -80,6 +89,9 @@ class Spotlight extends this.OS.GUI.BaseService
|
||||
@iconclass = "fa fa-search"
|
||||
@show = false
|
||||
init: ->
|
||||
me = @
|
||||
@_gui.bindKey "CTRL- ", (e) ->
|
||||
me.awake(e)
|
||||
#@child = [
|
||||
# {
|
||||
# text: "#{@.name} (#{@.pid}): dummy notif",
|
||||
@ -88,7 +100,7 @@ class Spotlight extends this.OS.GUI.BaseService
|
||||
#]
|
||||
# do nothing
|
||||
main: ->
|
||||
|
||||
|
||||
awake: (e) ->
|
||||
me = @
|
||||
if not @show
|
||||
|
@ -1,10 +0,0 @@
|
||||
<afx-dummy>
|
||||
<afx-overlay data-id = "notifyzone" width = "250">
|
||||
<afx-button text = "Clear all" data-id = "btclear"></afx-button>
|
||||
<afx-list-view data-id="notifylist"></afx-list-view>
|
||||
</afx-overlay>
|
||||
<afx-overlay data-id = "feedzone" width = "250">
|
||||
<afx-list-view data-id = "notifeed">
|
||||
</afx-list-view>
|
||||
</afx-overlay>
|
||||
</afx-dummy>
|
@ -1,14 +0,0 @@
|
||||
<afx-app-window data-id = "spotlight-win" apptitle="" minimizable="false" resizable = "false" width="500" height="300">
|
||||
<afx-vbox>
|
||||
<afx-hbox data-height="45">
|
||||
<div data-id = "searchicon" data-width="45"></div>
|
||||
<input type = "text" data-id="searchbox"/>
|
||||
</afx-hbox>
|
||||
<afx-list-view data-id="container"></afx-list-view>
|
||||
<!--afx-hbox data-id="container">
|
||||
|
||||
<afx-resizer data-width ="5"></afx-resizer>
|
||||
<div data-id="preview"></div>
|
||||
</afx-hbox-->
|
||||
</afx-vbox>
|
||||
</afx-app-window>
|
Reference in New Issue
Block a user